diff options
author | 2013-02-27 12:17:49 -0800 | |
---|---|---|
committer | 2013-03-06 07:19:41 -0800 | |
commit | 7f7850d23a34f918bc44843bbc68862b45dc2752 (patch) | |
tree | 22f7c0090bd771d02d9520fa0c09ae32eb585f5f /java/src | |
parent | 466e665b3cfdaee0f6149d16d5244b54ddb86838 (diff) | |
download | latinime-7f7850d23a34f918bc44843bbc68862b45dc2752.tar.gz latinime-7f7850d23a34f918bc44843bbc68862b45dc2752.tar.xz latinime-7f7850d23a34f918bc44843bbc68862b45dc2752.zip |
[FileEncap3] Extract isUploadingUnconditionally method
- remove isUploadingUnconditionally local variable
Change-Id: I69be8708c1f306568cbb9c5cbefc9e42a87df497
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/research/UploaderService.java | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/java/src/com/android/inputmethod/research/UploaderService.java b/java/src/com/android/inputmethod/research/UploaderService.java index ed195ba4b..13a98567e 100644 --- a/java/src/com/android/inputmethod/research/UploaderService.java +++ b/java/src/com/android/inputmethod/research/UploaderService.java @@ -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())); + } + + 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() { |