Closed Bug 1312686 Opened 6 years ago Closed 6 years ago

Link "default browser" setting to app info screen on Android 7+

Categories

(Firefox for Android Graveyard :: General, defect)

All
Android
defect
Not set
normal

Tracking

(firefox54 verified)

VERIFIED FIXED
Firefox 54
Tracking Status
firefox54 --- verified

People

(Reporter: sebastian, Assigned: gautamprajapati06, Mentored)

References

Details

Attachments

(2 files)

Attached image default_browser.png
Android 6.0 introduced a default browser setting, but it was buried in the device's settings. Now with Android 7 or 7.1 this setting is linked from the app info screen (see attached screenshots).

Instead of linking "Make default browser" to a SUMO article we could link to the app info screen directly.
(In reply to Sebastian Kaspari (:sebastian) from comment #0)
> Created attachment 8804185 [details]
> default_browser.png
> Instead of linking "Make default browser" to a SUMO article we could link to
> the app info screen directly.

YES.
Mentor: s.kaspari
As suggested by Sebastian, I would like totry fix this.

Thanks
It's yours! Thank you. :)

If you have any questions then just flag me. For UX related questions just flag antlam.
Assignee: nobody → svezauzeto12
Status: NEW → ASSIGNED
Hi Sebastian, I would need some guidance for starting.
TBH I have no idea where to start looking.

You mentioned in your 0# post:

"Instead of linking "Make default browser" to a SUMO article we could link to the app info screen directly."

Any ideas how can this be done ? Where to look in mozilla-central ?

Thanks a lot.
if(Build.VERSION.SDK_INT >= 24) {
   Intent iChangeDefaultApps = new Intent(Settings.ACTION_MANAGE_DEFAULT_APPS_SETTINGS);
   startActivity(iChangeDefaultApps);
}

Note that, for downlevel versions, it's possible to at least programmatically clear the current default, even if you can't push the user to set a new one.
Hi Sebastian, I have successfully built the fennec project. I'd like to work on this issue as my starting point.
Gautam: Great! We'll assign the bug to you after you have upload the first version of your patch. Let me know (here or on IRC in #mobile) if you need help!
Hi Sebastian, for lower API levels than 24, I don't think we can clear defaults of all other apps programmatically. We can clear the defaults of our application though, with this:
  
getPackageManager().clearPackagePreferredActivities(getPackageName());
 
I'd appreciate your inputs here. Should I direct the user to App info screen for lower API levels?
For lower API levels just keep the code as-is: Open a support web page that explains how this can be done manually.
Comment on attachment 8836789 [details]
Bug 1312686 - Link "default browser" setting to app info screen on Android 7+;

https://reviewboard.mozilla.org/r/112116/#review113820

::: mobile/android/base/java/org/mozilla/gecko/preferences/LinkPreference.java:37
(Diff revision 1)
> +    /**
> +     * Open Default apps screen of Settings for API Levels>=24. Support URL will open for lower API levels
> +     */
>      @Override
>      protected void onClick() {
> +        if (Build.VERSION.SDK_INT >= 24) {

Please use (or add) a constant for this to AppConstants.

::: mobile/android/base/java/org/mozilla/gecko/preferences/LinkPreference.java:40
(Diff revision 1)
> +        }
> +        else {

nit: style:
> } else {
Attachment #8836789 - Flags: review?(s.kaspari)
Comment on attachment 8836789 [details]
Bug 1312686 - Link "default browser" setting to app info screen on Android 7+;

Hi Sebastian, thanks for reviewing, I have updated the commit.
Comment on attachment 8836789 [details]
Bug 1312686 - Link "default browser" setting to app info screen on Android 7+;

https://reviewboard.mozilla.org/r/112116/#review114060

Thank you! This is looking good.

I pushed your patch to the try server (to run all our automated tests):
https://treeherder.mozilla.org/#/jobs?repo=try&revision=305507310f04

If this was successfull then we can land the patch. You can just edit the bug and add the "checkin-needed" keyword to it. A tree sherrif will take care of landing your patch after that.
Attachment #8836789 - Flags: review?(s.kaspari) → review+
(In reply to Sebastian Kaspari (:sebastian) from comment #14)
> If this was successfull then we can land the patch. You can just edit the
> bug and add the "checkin-needed" keyword to it. A tree sherrif will take
> care of landing your patch after that.

Oh, and please go to Mozreview and mark the review comments as "Fixed" now that you pushed a new patch. Otherwise this patch can't be landed. :)
> Oh, and please go to Mozreview and mark the review comments as "Fixed" now that you pushed a new patch. 
> Otherwise this patch can't be landed. :)

Thanks, Sebastian! I have marked the review comments as 'Fixed'. 
By the way, it doesn't matter if this issue is not assigned to me, right? Can we close this issue as fixed?
Assignee: svezauzeto12 → gautamprajapati06
(In reply to Gautam Prajapati from comment #16)
> By the way, it doesn't matter if this issue is not assigned to me, right?

I just assigned it to you.

(In reply to Gautam Prajapati from comment #16)
> Can we close this issue as fixed?

It will be closed automatically as soon as the patch has been merged to mozilla-central. All tests have been passed successfully. You can add the checkin-needed keyword to the bug now.
Keywords: checkin-needed
Pushed by cbook@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/742e4f33e3d6
Link "default browser" setting to app info screen on Android 7+; r=sebastian
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/742e4f33e3d6
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 54
Verified as fixed in build 54.0a1 (2017-02-20);
Device: Nexus 9 (Android 7.1.1).

'Make default browser' from Nightly Settings page goes to app info from Android settings.
Status: RESOLVED → VERIFIED
Depends on: 1342329
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.