Merge "Hide preference when no app restricted" into pi-dev am: 1f02712e7a

am: 1b82df6906

Change-Id: I665bdb8e3107c3152242b28561ea5ae01427ead7
This commit is contained in:
Lei Yu
2018-04-10 12:13:43 -07:00
committed by android-build-merger
2 changed files with 6 additions and 5 deletions

View File

@@ -72,8 +72,8 @@ public class RestrictAppPreferenceController extends BasePreferenceController {
mAppInfos = BatteryTipUtils.getRestrictedAppsList(mAppOpsManager, mUserManager);
final int num = mAppInfos.size();
// Enable the preference if some apps already been restricted, otherwise disable it
preference.setEnabled(num > 0);
// Don't show it if no app been restricted
preference.setVisible(num > 0);
preference.setSummary(
mContext.getResources().getQuantityString(R.plurals.restricted_app_summary, num,
num));