From 8fca3c2df182af6e145cd6067a4a3bbafd4e2df3 Mon Sep 17 00:00:00 2001 From: Jay Thomas Sullivan Date: Tue, 4 Feb 2025 17:43:53 -0800 Subject: Keep info icon shown when permission is fixed Currently there is an issue on this screen that occurs when a permission is fixed: an "info" icon should, but does not, appear on the right side of the text "Enabled by admin" (or "Disabled by admin"). The root cause appears to be that, when the permission is fixed, the following sequence occurs: 1. On screen load the setAdminSupportDetail method is called, which actually does make the info icon visible (almost; see #2), because: - `mDetails.setExtraWidgetIconRes(info)` is called, which turns the icon into an info icon. - `mDetails.setOnSecondTargetClickListener(...)` is called, which results in the icon being visible (due to intentional logic in PermissionTwoTargetPreference). 2. But then just afterward, setDetail is called, which in this scenario invokes `mDetails.setOnSecondTargetClickListener(null)`, which results in actually hiding the icon. Upon comparing to LegacyAppPermissionFragment, it appears the call to `mDetails.set...Listener(null)` is the culprit, and that it probably should never have been added; removing it better matches the previous logic in LegacyAppPermissionFragment. Bug: 381455443 Relnote: N/A Test: manual test with CtsVerifier, test case [BYOD Managed Provisioning] -> [Permissions lockdown] Flag: com.android.permission.flags.app_permission_fragment_uses_preferences NO_IFTTT=this bug does not apply to LegacyAppPermissionFragment Change-Id: I46a0194a7be1b54e8d55aff7910e904bcfac8c96 --- .../permission/ui/handheld/v36/AppPermissionFragment.java | 1 - 1 file changed, 1 deletion(-) (limited to 'PermissionController') diff --git a/PermissionController/src/com/android/permissioncontroller/permission/ui/handheld/v36/AppPermissionFragment.java b/PermissionController/src/com/android/permissioncontroller/permission/ui/handheld/v36/AppPermissionFragment.java index 4fde26c9d..fc25c0f85 100644 --- a/PermissionController/src/com/android/permissioncontroller/permission/ui/handheld/v36/AppPermissionFragment.java +++ b/PermissionController/src/com/android/permissioncontroller/permission/ui/handheld/v36/AppPermissionFragment.java @@ -560,7 +560,6 @@ public class AppPermissionFragment extends SettingsWithLargeHeader mDetails.setSummary(getPreferenceManager().getContext().getString( detailResIds.getFirst(), detailResIds.getSecond())); } else { - mDetails.setOnSecondTargetClickListener(null); mDetails.setSummary(getPreferenceManager().getContext().getString( detailResIds.getFirst())); } -- cgit v1.2.3-59-g8ed1b