Don't send user to permissions screen if none requested
bug:29105157
Change-Id: I90ef18f41deae9a7cf28192bd47f16c3af262c29
diff --git a/src/com/android/settings/applications/InstalledAppDetails.java b/src/com/android/settings/applications/InstalledAppDetails.java
index 0025b20..0964abe 100755
--- a/src/com/android/settings/applications/InstalledAppDetails.java
+++ b/src/com/android/settings/applications/InstalledAppDetails.java
@@ -1207,6 +1207,8 @@
if (requestedPermissionCount == 0) {
summary = res.getString(
R.string.runtime_permissions_summary_no_permissions_requested);
+ mPermissionsPreference.setOnPreferenceClickListener(null);
+ mPermissionsPreference.setEnabled(false);
} else {
final ArrayList<CharSequence> list = new ArrayList<>(grantedGroupLabels);
if (additionalGrantedPermissionCount > 0) {
@@ -1221,6 +1223,8 @@
} else {
summary = ListFormatter.getInstance().format(list);
}
+ mPermissionsPreference.setOnPreferenceClickListener(InstalledAppDetails.this);
+ mPermissionsPreference.setEnabled(true);
}
mPermissionsPreference.setSummary(summary);
}