Closed Bug 1369650 Opened 5 years ago Closed 5 years ago

Fix lint: NewApi issues in WebAppActivity.java

Categories

(Firefox for Android Graveyard :: General, defect)

55 Branch
defect
Not set
normal

Tracking

(firefox56 fixed)

RESOLVED FIXED
Firefox 56
Tracking Status
firefox56 --- fixed

People

(Reporter: tyu, Assigned: tyu)

References

Details

Attachments

(1 file)

4 occurrence:

../../../../../../../mobile/android/base/java/org/mozilla/gecko/webapps/WebAppActivity.java:138: Call requires API level 21 (current min is 15): new android.app.ActivityManager.TaskDescription

 135             final String name = readNameFromManifest(manifestField);
 136             final Bitmap icon = readIconFromManifest(manifest);
 137             mScope = readScopeFromManifest(manifest, manifestPath);
 138             final ActivityManager.TaskDescription taskDescription = (color == null)
 139                     ? new ActivityManager.TaskDescription(name, icon)
 140                     : new ActivityManager.TaskDescription(name, icon, color);

Applies to variants: localOldAustralisDebug, localOldAustralisRelease, localOldPhotonDebug, localOldPhotonRelease, officialAustralisDebug, officialAustralisRelease, officialPhotonDebug, officialPhotonRelease
Does not apply to variants: localAustralisDebug, localAustralisRelease, localPhotonDebug, localPhotonRelease
../../../../../../../mobile/android/base/java/org/mozilla/gecko/webapps/WebAppActivity.java:140: Call requires API level 21 (current min is 15): new android.app.ActivityManager.TaskDescription

 137             mScope = readScopeFromManifest(manifest, manifestPath);
 138             final ActivityManager.TaskDescription taskDescription = (color == null)
 139                     ? new ActivityManager.TaskDescription(name, icon)
 140                     : new ActivityManager.TaskDescription(name, icon, color);
 141 
 142             updateStatusBarColor(color);

Applies to variants: localOldAustralisDebug, localOldAustralisRelease, localOldPhotonDebug, localOldPhotonRelease, officialAustralisDebug, officialAustralisRelease, officialPhotonDebug, officialPhotonRelease
Does not apply to variants: localAustralisDebug, localAustralisRelease, localPhotonDebug, localPhotonRelease
../../../../../../../mobile/android/base/java/org/mozilla/gecko/webapps/WebAppActivity.java:143: Call requires API level 21 (current min is 15): android.app.Activity#setTaskDescription

 140                     : new ActivityManager.TaskDescription(name, icon, color);
 141 
 142             updateStatusBarColor(color);
 143             setTaskDescription(taskDescription);
 144 
 145         } catch (IOException | JSONException e) {

Applies to variants: localOldAustralisDebug, localOldAustralisRelease, localOldPhotonDebug, localOldPhotonRelease, officialAustralisDebug, officialAustralisRelease, officialPhotonDebug, officialPhotonRelease
Does not apply to variants: localAustralisDebug, localAustralisRelease, localPhotonDebug, localPhotonRelease
../../../../../../../mobile/android/base/java/org/mozilla/gecko/webapps/WebAppActivity.java:154: Call requires API level 21 (current min is 15): android.view.Window#setStatusBarColor

 151         if (themeColor != null) {
 152             final Window window = getWindow();
 153             window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
 154             window.setStatusBarColor(ColorUtil.darken(themeColor, 0.25));
 155         }
 156     }

Applies to variants: localOldAustralisDebug, localOldAustralisRelease, localOldPhotonDebug, localOldPhotonRelease, officialAustralisDebug, officialAustralisRelease, officialPhotonDebug, officialPhotonRelease
Does not apply to variants: localAustralisDebug, localAustralisRelease, localPhotonDebug, localPhotonRelease
Blocks: lint-newapi
Assignee: nobody → osimpleo
Comment on attachment 8873781 [details]
Bug 1369650 - Fix lint: NewApi issues in WebAppActivity.java;

https://reviewboard.mozilla.org/r/145186/#review149792

::: mobile/android/base/java/org/mozilla/gecko/webapps/WebAppActivity.java:226
(Diff revision 1)
>              }
>          };
>      }
>  
>      private void loadManifest(String manifestPath) {
> -        if (TextUtils.isEmpty(manifestPath)) {
> +        if (AppConstants.Versions.preLollipop) {

How about let's use AppConstants.Versions.feature21Plus and skip the empty base method?
Comment on attachment 8873781 [details]
Bug 1369650 - Fix lint: NewApi issues in WebAppActivity.java;

https://reviewboard.mozilla.org/r/145186/#review155722
Attachment #8873781 - Flags: review?(max) → review-
Comment on attachment 8873781 [details]
Bug 1369650 - Fix lint: NewApi issues in WebAppActivity.java;

https://reviewboard.mozilla.org/r/145186/#review156242

LGTM
Attachment #8873781 - Flags: review?(max) → review+
Keywords: checkin-needed
Autoland can't push this until all pending issues in MozReview are marked as resolved.
Keywords: checkin-needed
Keywords: checkin-needed
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/02bae2b97fb3
Fix lint: NewApi issues in WebAppActivity.java; r=maliu
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/02bae2b97fb3
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 56
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.