mirror of https://github.com/perkeep/perkeep.git
move some stuff out of try block
This commit is contained in:
parent
078760fed5
commit
d4566398d6
|
@ -107,30 +107,29 @@ public class UploadService extends Service {
|
||||||
stopServiceIfEmpty();
|
stopServiceIfEmpty();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
String action = intent.getAction();
|
String action = intent.getAction();
|
||||||
|
if (Intent.ACTION_SEND.equals(action)) {
|
||||||
|
handleSend(intent);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Intent.ACTION_SEND_MULTIPLE.equals(action)) {
|
||||||
|
handleSendMultiple(intent);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (INTENT_POWER_CONNECTED.equals(intent.getAction())) {
|
if (INTENT_POWER_CONNECTED.equals(action)) {
|
||||||
service.resume();
|
service.resume();
|
||||||
startBackgroundWatchers();
|
startBackgroundWatchers();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (INTENT_POWER_DISCONNECTED.equals(intent.getAction())
|
if (INTENT_POWER_DISCONNECTED.equals(action)
|
||||||
&& mPrefs.getBoolean(Preferences.AUTO_REQUIRE_POWER, false)) {
|
&& mPrefs.getBoolean(Preferences.AUTO_REQUIRE_POWER, false)) {
|
||||||
service.pause();
|
service.pause();
|
||||||
stopBackgroundWatchers();
|
stopBackgroundWatchers();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Intent.ACTION_SEND.equals(action)) {
|
|
||||||
handleSend(intent);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Intent.ACTION_SEND_MULTIPLE.equals(action)) {
|
|
||||||
handleSendMultiple(intent);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
// Ignore.
|
// Ignore.
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue