Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7dee98a9 authored by Ricky Wai's avatar Ricky Wai
Browse files

Allow current active live wallpaper app to bypass app switching protection

For example, if user clicks home button and clicks the live wallpaper
to read something, we allow the current live wallpaper to bypass app switching
protection to show activity.

Bug: 183838549
Test: Install a live wallpaper app and set it as wallpaper, click home button, click live wallpaper, live wallpaper can start an activity successfully.
Change-Id: I140e6dc832d4de949f44b489b9c1c441cadefb7b
parent ac9a73d1
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -1275,7 +1275,11 @@ class ActivityStarter {
                || callingUidProcState == ActivityManager.PROCESS_STATE_BOUND_TOP;
        final boolean isCallingUidPersistentSystemProcess =
                callingUidProcState <= ActivityManager.PROCESS_STATE_PERSISTENT_UI;
        if ((appSwitchAllowed && callingUidHasAnyVisibleWindow)

        // Normal apps with visible app window will be allowed to start activity if app switching
        // is allowed, or apps like live wallpaper with non app visible window will be allowed.
        if (((appSwitchAllowed || mService.mActiveUids.hasNonAppVisibleWindow(callingUid))
                && callingUidHasAnyVisibleWindow)
                || isCallingUidPersistentSystemProcess) {
            if (DEBUG_ACTIVITY_STARTS) {
                Slog.d(TAG, "Activity start allowed: callingUidHasAnyVisibleWindow = " + callingUid