[FileEncap5] Move conditional logic to caller
Change-Id: I6599539059f86dc8902210d325439c08035b2e2amain
parent
88f466678c
commit
9283644c41
|
@ -99,7 +99,9 @@ public final class UploaderService extends IntentService {
|
||||||
@Override
|
@Override
|
||||||
protected void onHandleIntent(Intent intent) {
|
protected void onHandleIntent(Intent intent) {
|
||||||
if (!isPossibleToUpload()) return;
|
if (!isPossibleToUpload()) return;
|
||||||
doUpload(isUploadingUnconditionally(intent.getExtras()));
|
if (isUploadingUnconditionally(intent.getExtras()) || isConvenientToUpload()) {
|
||||||
|
doUpload();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isUploadingUnconditionally(final Bundle bundle) {
|
private boolean isUploadingUnconditionally(final Bundle bundle) {
|
||||||
|
@ -129,8 +131,7 @@ public final class UploaderService extends IntentService {
|
||||||
return wifiInfo.isConnected();
|
return wifiInfo.isConnected();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void doUpload(final boolean isUploadingUnconditionally) {
|
private void doUpload() {
|
||||||
if (!(isUploadingUnconditionally || isConvenientToUpload())) return;
|
|
||||||
if (mFilesDir == null) {
|
if (mFilesDir == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue