[FileEncap3] Extract isUploadingUnconditionally method
- remove isUploadingUnconditionally local variable
Change-Id: I69be8708c1f306568cbb9c5cbefc9e42a87df497
diff --git a/java/src/com/android/inputmethod/research/UploaderService.java b/java/src/com/android/inputmethod/research/UploaderService.java
index ed195ba..13a9856 100644
--- a/java/src/com/android/inputmethod/research/UploaderService.java
+++ b/java/src/com/android/inputmethod/research/UploaderService.java
@@ -99,12 +99,15 @@
@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()));
+ }
+
+ 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() {