am 719bb3aa: Merge "[FileEncap3] Extract isUploadingUnconditionally method"

* commit '719bb3aa39c6456b7d672258432d18ad917ba263':
  [FileEncap3] Extract isUploadingUnconditionally method
main
Kurt Partridge 2013-03-06 11:16:00 -08:00 committed by Android Git Automerger
commit 0d4c792316
1 changed files with 8 additions and 5 deletions

View File

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