Skip to content

Instantly share code, notes, and snippets.

@bengalih
Last active March 8, 2024 05:11
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bengalih/ee939232fcde3c22516134e10cabbf11 to your computer and use it in GitHub Desktop.
Save bengalih/ee939232fcde3c22516134e10cabbf11 to your computer and use it in GitHub Desktop.
Detailing issues of repeated prompts for Home Launcher when using 3rd party launchers

Detailing issues of repeated prompts for Home Launcher when using 3rd party launchers

Testing Environment:

  • Phone: Pixel 3 XL
  • OS: Android 11, Build RQ3A.211001.001
  • Security Update: 10/1/21
  • Google Play System Update: 1/1/21

The explanations and steps described herein are also illustrated at the following youtube video: https://youtu.be/ncuql3hUiyc

Observation is that at intervals (seemingly random, but no doubt with an underlying cause) system will prompt for default launcher when hitting the home button to return to the main screen. While multiple root causes may be leading to this, I have diagnosed at least one recreatable occurence on my configuration. The issue appears to be related to Bedtime mode and the Digital Wellbeing app.

When using Digital Wellbeing version 1.1.463639936 (409067) which is the latest available as of 8/20/22 on the Play Store, the issue can be recreated at will by performing the steps in the following sections.

It appears that this update was released on 7/28/22, approximately 3 weeks ago. It may be that users began seeing this issue only when they updated or it is possible that another app upgrade deployed by Google in combination with this (or in addition to) has been causing issues. I definiitively state that this particular app may not be the only cause of the problems, but I have been able to re-create at will the issue and it appears this at-will recreation is solved following removal of the update.

RECREATE ISSUE

  1. Enter Bedtime Mode settings though Digital Wellbeing app or Quick Launch tile.
  2. Change Bedtime Schedule to begin at a time prior to the current time of testing. Doing this will immediately cause Bedtime mode to go active.
  3. Press the Home button and observe the prompt for selecting default launcher.
  4. Select Nova Launcher (or preferred Launcher). After selecting "Always" on first or second prompt the issue should be gone - at least temporarily until affected by another outside process.
  5. The same behavior will repeat everytime that Bedtime Mode is toggled on or off. Alternately, instead of disabling Bedtime Mode through direct on/off, simply changing the day or time of its start to either cover or exclude the current time will present the same results.

What is interesting to note is that this behavior will occur even if Pixel Launcher is set as the Default Launcher. As long as alternate launchers are installed on the device.

SOLVE ISSUE

To prevent this behavior, revert the installed version of Digital Wellbeing.

  1. Open Google Play Store and search for "Digitial Wellbeing Google"
  2. Click the found result
  3. Click on "Uninstall" which will uninstall update to the system app.
  4. You may no longer find an icon for Digital Wellbeing as it should now solely be a system app. You can find the version if you search for it within your System Settings > Apps. On my device, the installed system version is 1.0.351358120

Once this is completed you should be able to follow the recreation steps above and observe that the issue no longer occurs. While this isn't a guarantee it will not reoccur, it shows a direct link between enabling Bedtime Mode and this issue.

MORE INFORMATION

The following has been gathered via logcats on my device.

I have observed that when changing the preferred launcher via system settings the following entries are observed: (note these are filtered on some key search terms and do not represent ALL logged events)

When switching from Nova to Pixel:

08-20 16:38:56.994  1715  3462 I ActivityTaskManager: START u0 {cmp=com.google.android.permissioncontroller/com.android.permissioncontroller.role.ui.DefaultAppActivity (has extras)} from uid 10240
08-20 16:38:57.035  1715  1820 I ActivityTaskManager: Displayed com.google.android.permissioncontroller/com.android.permissioncontroller.role.ui.DefaultAppActivity: +41ms
08-20 16:39:06.194  1715  3462 I ActivityTaskManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10000000 cmp=com.google.android.apps.nexuslauncher/.NexusLauncherActivity} from uid 10240

When switching from Pixel to Nova:

08-20 16:38:56.994  1715  3462 I ActivityTaskManager: START u0 {cmp=com.google.android.permissioncontroller/com.android.permissioncontroller.role.ui.DefaultAppActivity (has extras)} from uid 10240
08-20 16:38:57.035  1715  1820 I ActivityTaskManager: Displayed com.google.android.permissioncontroller/com.android.permissioncontroller.role.ui.DefaultAppActivity: +41ms
08-20 16:39:06.194  1715  3462 I ActivityTaskManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10000000 cmp=com.google.android.apps.nexuslauncher/.NexusLauncherActivity} from uid 10240

The PID of 1715 is the system-server process on the device. uid 10240 is from package com.google.android.permissioncontroller

When pressing the Home button with Nova set as default launcher, the following is logged:

08-20 16:49:46.190  1715  1811 I ActivityTaskManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10000100 cmp=com.teslacoilsw.launcher/.NovaLauncher (has extras)} from uid 0

When recreating the issue as listed above, the following will be logged following the toggle of Bedtime Mode (* see more in ADDITIONAL INTERESTING FINDS section below):

Line 1603: 08-20 15:32:51.989  1715  1811 I PackageManager: Result set changed, dropping preferred activity for Intent { act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x100 } type null

This clearly shows the issue occuring, as it explicitly states that the preferred activity for HOME is being dropped. What isn't clear is what specifically is forcing this to happen (apart from the overall Bedtime Mode/Digitial Wellbeing).

It, after toggling Bedtime Mode, and prior to hitting Home, you enter the following via adb:

adb shell cmd package set-home-activity "com.teslacoilsw.launcher/.NovaLauncher

The issue will not occur. Seemingly because we are resetting the home activity.

ADDITONAL INTERESTING FINDS

What is interesting is that I cannot find anything in the logcat apart from the above mentioned line that indicates the launcher is being dropped:

Line 1603: 08-20 15:32:51.989  1715  1811 I PackageManager: Result set changed, dropping preferred activity for Intent { act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x100 } type null

This message is logged when toggling Bedtime Mode, but only if you have reset the launcher via "Always" prior to toggling again. IOW, you can toggle Bedtime back and forth 20 times in a row, but it will only log this once unless you have reset it in-between.

EDIT: In my first testing of this entry being logged it appeared to show in the log only after toggling Bedtime Mode and then pressing the Home button. However when I was testing again writing this I was experiencing the log entry showing immediately after toggling Bedtime Mode, without the Home button needing to be pressed. As I test this again it appears to once again only be happening after both events occur.

What is also interesting is that if you toggle Bedtime Mode, then "freeze/disable" Digital Wellbeing and then defrost it immediately after toggling (and receiving the above logcat entry) then when pressing the Home key the issue does not appear.

You can use an app like Titanium Backup or issue the following adb commands to observe this:

adb shell pm disable-user --user 0 com.google.android.apps.wellbeing

adb shell pm enable com.google.android.apps.wellbeing

TO BE CONTINUED....

@pritster5
Copy link

Thank you for compiling this info, I've been having this bug with Nova Launcher and it started for the first time out of nowhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment