Remove summaries fro configure apps page
Bug: 22741399 Change-Id: Iead63e39eafdc9217a4e569b3b7b4e71f401e85e
This commit is contained in:
@@ -72,50 +72,6 @@ public class AdvancedAppSettings extends SettingsPreferenceFragment implements
|
|||||||
mHighPowerPreference = findPreference(KEY_HIGH_POWER_APPS);
|
mHighPowerPreference = findPreference(KEY_HIGH_POWER_APPS);
|
||||||
mSystemAlertWindowPreference = findPreference(KEY_SYSTEM_ALERT_WINDOW);
|
mSystemAlertWindowPreference = findPreference(KEY_SYSTEM_ALERT_WINDOW);
|
||||||
mWriteSettingsPreference = findPreference(KEY_WRITE_SETTINGS_APPS);
|
mWriteSettingsPreference = findPreference(KEY_WRITE_SETTINGS_APPS);
|
||||||
updateUI();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onDestroy() {
|
|
||||||
super.onDestroy();
|
|
||||||
if (mPermissionReceiver != null) {
|
|
||||||
getContext().unregisterReceiver(mPermissionReceiver);
|
|
||||||
mPermissionReceiver = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateUI() {
|
|
||||||
ArrayList<AppEntry> allApps = mSession.getAllApps();
|
|
||||||
|
|
||||||
int countAppWithDomainURLs = 0;
|
|
||||||
for (AppEntry entry : allApps) {
|
|
||||||
boolean hasDomainURLs =
|
|
||||||
(entry.info.privateFlags & ApplicationInfo.PRIVATE_FLAG_HAS_DOMAIN_URLS) != 0;
|
|
||||||
if (hasDomainURLs) countAppWithDomainURLs++;
|
|
||||||
}
|
|
||||||
String summary = getResources().getQuantityString(
|
|
||||||
R.plurals.domain_urls_apps_summary, countAppWithDomainURLs, countAppWithDomainURLs);
|
|
||||||
mAppDomainURLsPreference.setSummary(summary);
|
|
||||||
|
|
||||||
int highPowerCount = PowerWhitelistBackend.getInstance().getWhitelistSize();
|
|
||||||
mHighPowerPreference.setSummary(getResources().getQuantityString(R.plurals.high_power_count,
|
|
||||||
highPowerCount, highPowerCount));
|
|
||||||
|
|
||||||
if (mPermissionReceiver != null) {
|
|
||||||
getContext().unregisterReceiver(mPermissionReceiver);
|
|
||||||
}
|
|
||||||
mPermissionReceiver = PermissionsSummaryHelper.getAppWithPermissionsCounts(getContext(),
|
|
||||||
mPermissionCallback);
|
|
||||||
|
|
||||||
Activity activity = getActivity();
|
|
||||||
ApplicationsState appState = ApplicationsState.getInstance(activity
|
|
||||||
.getApplication());
|
|
||||||
AppStateOverlayBridge overlayBridge = new AppStateOverlayBridge(activity,
|
|
||||||
appState, null);
|
|
||||||
AppStateWriteSettingsBridge writeSettingsBridge = new AppStateWriteSettingsBridge(
|
|
||||||
activity, appState, null);
|
|
||||||
new CountAppsWithOverlayPermission().execute(overlayBridge);
|
|
||||||
new CountAppsWithWriteSettingsPermission().execute(writeSettingsBridge);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -130,7 +86,7 @@ public class AdvancedAppSettings extends SettingsPreferenceFragment implements
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPackageListChanged() {
|
public void onPackageListChanged() {
|
||||||
updateUI();
|
// No-op.
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Reference in New Issue
Block a user