Merge \\\"Don\\\'t send user to permissions screen if none requested\\\" into nyc-dev am: 3e5318496e am: 650cc723d1

am: 1fb5f435cf

Change-Id: I53ff5a78a82154b75650e1b00bd389facfb5ca52
This commit is contained in:
Svet Ganov
2016-06-09 23:05:21 +00:00
committed by android-build-merger

View File

@@ -1207,6 +1207,8 @@ public class InstalledAppDetails extends AppInfoBase
if (requestedPermissionCount == 0) { if (requestedPermissionCount == 0) {
summary = res.getString( summary = res.getString(
R.string.runtime_permissions_summary_no_permissions_requested); R.string.runtime_permissions_summary_no_permissions_requested);
mPermissionsPreference.setOnPreferenceClickListener(null);
mPermissionsPreference.setEnabled(false);
} else { } else {
final ArrayList<CharSequence> list = new ArrayList<>(grantedGroupLabels); final ArrayList<CharSequence> list = new ArrayList<>(grantedGroupLabels);
if (additionalGrantedPermissionCount > 0) { if (additionalGrantedPermissionCount > 0) {
@@ -1221,6 +1223,8 @@ public class InstalledAppDetails extends AppInfoBase
} else { } else {
summary = ListFormatter.getInstance().format(list); summary = ListFormatter.getInstance().format(list);
} }
mPermissionsPreference.setOnPreferenceClickListener(InstalledAppDetails.this);
mPermissionsPreference.setEnabled(true);
} }
mPermissionsPreference.setSummary(summary); mPermissionsPreference.setSummary(summary);
} }