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
This commit is contained in:
Hui Yu
2020-03-18 10:25:55 -07:00
parent a08e8e075d
commit 00a776682c

View File

@@ -3647,10 +3647,12 @@ class AppWidgetServiceImpl extends IAppWidgetService.Stub implements WidgetBacku
}
private void updateAppOpsLocked(Host host, boolean visible) {
// The launcher must be at TOP.
final int procState = mActivityManagerInternal.getUidProcessState(host.id.uid);
if (procState > ActivityManager.PROCESS_STATE_TOP) {
return;
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<>();