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

Commit 00a77668 authored by Hui Yu's avatar Hui Yu
Browse files

Only check on launcher proc state when param visible is true.

When launcher moves away from TOP, param visible is false, should skip
the proc state check and move ahead to update AppOps.

Bug: 151835293
Test: Manual test, open another app and move launcher away from top
screen, observe AppOps is updated.

Change-Id: I4b1562994d205d7e5b0327b95cf59e08b91ae048
parent a08e8e07
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -3647,11 +3647,13 @@ class AppWidgetServiceImpl extends IAppWidgetService.Stub implements WidgetBacku
    }

    private void updateAppOpsLocked(Host host, boolean visible) {
        // The launcher must be at TOP.
        if (visible) {
            final int procState = mActivityManagerInternal.getUidProcessState(host.id.uid);
            if (procState > ActivityManager.PROCESS_STATE_TOP) {
                // The launcher must be at TOP.
                return;
            }
        }

        final List<ResolveInfo> allHomeCandidates = new ArrayList<>();
        // Default launcher from package manager.