[FileEncap3] Extract isUploadingUnconditionally method

- remove isUploadingUnconditionally local variable

Change-Id: I69be8708c1f306568cbb9c5cbefc9e42a87df497
main
Kurt Partridge 2013-02-27 12:17:49 -08:00
parent 466e665b3c
commit 7f7850d23a
1 changed files with 8 additions and 5 deletions

View File

@ -99,12 +99,15 @@ public final class UploaderService extends IntentService {
@Override @Override
protected void onHandleIntent(Intent intent) { protected void onHandleIntent(Intent intent) {
if (!isPossibleToUpload()) return; if (!isPossibleToUpload()) return;
boolean isUploadingUnconditionally = false; doUpload(isUploadingUnconditionally(intent.getExtras()));
Bundle bundle = intent.getExtras(); }
if (bundle != null && bundle.containsKey(EXTRA_UPLOAD_UNCONDITIONALLY)) {
isUploadingUnconditionally = bundle.getBoolean(EXTRA_UPLOAD_UNCONDITIONALLY); private boolean isUploadingUnconditionally(final Bundle bundle) {
if (bundle == null) return false;
if (bundle.containsKey(EXTRA_UPLOAD_UNCONDITIONALLY)) {
return bundle.getBoolean(EXTRA_UPLOAD_UNCONDITIONALLY);
} }
doUpload(isUploadingUnconditionally); return false;
} }
private boolean isExternallyPowered() { private boolean isExternallyPowered() {