summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/users
diff options
context:
space:
mode:
authorAmith Yamasani <yamasani@google.com>2013-05-21 16:07:28 -0700
committerAmith Yamasani <yamasani@google.com>2013-05-21 16:07:28 -0700
commit0b2781ae537e6d3d27863080eea0a0a5fa6c83b8 (patch)
tree86b3f6798cb350a0b4741e4802d8c1b476f398a3 /src/com/android/settings/users
parentf88e6e5ae6a5a31d47677dcbd9be2b26c6615136 (diff)
downloadpackages_apps_Settings-0b2781ae537e6d3d27863080eea0a0a5fa6c83b8.zip
packages_apps_Settings-0b2781ae537e6d3d27863080eea0a0a5fa6c83b8.tar.gz
packages_apps_Settings-0b2781ae537e6d3d27863080eea0a0a5fa6c83b8.tar.bz2
Write restriction bundle right away for required apps.
User shouldn't have to go tap on the settings icon for an app that is ON by default in a restricted profile. This way apps can write some defaults to the restricted profile when it is created. The app entry is also automatically removed from the list if there are no visible restrictions. Bug: 9074051 Also fix an incorrect dialog label. Bug: 9068877 Change-Id: I2a7ddc31fe695f58611d2ba36a8bf541b7817b10
Diffstat (limited to 'src/com/android/settings/users')
-rw-r--r--src/com/android/settings/users/AppRestrictionsFragment.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/com/android/settings/users/AppRestrictionsFragment.java b/src/com/android/settings/users/AppRestrictionsFragment.java
index bfcc677..3d68024 100644
--- a/src/com/android/settings/users/AppRestrictionsFragment.java
+++ b/src/com/android/settings/users/AppRestrictionsFragment.java
@@ -607,6 +607,11 @@ public class AppRestrictionsFragment extends SettingsPreferenceFragment implemen
p.setImmutable(true);
// If the app is required and has no restrictions, skip showing it
if (!hasSettings && !isSettingsApp) continue;
+ // Get and populate the defaults, since the user is not going to be
+ // able to toggle this app ON (it's ON by default and immutable).
+ if (hasSettings) {
+ requestRestrictionsForApp(packageName, p);
+ }
} else if (!mNewUser && appInfoListHasPackage(mUserApps, packageName)) {
p.setChecked(true);
}
@@ -896,6 +901,12 @@ public class AppRestrictionsFragment extends SettingsPreferenceFragment implemen
}
}
preference.setRestrictions(restrictions);
+ if (count == 1 // No visible restrictions
+ && preference.isImmutable()
+ && preference.isChecked()) {
+ // Special case of required app with no visible restrictions. Remove it
+ mAppList.removePreference(preference);
+ }
}
/**
@@ -1001,7 +1012,7 @@ public class AppRestrictionsFragment extends SettingsPreferenceFragment implemen
mSavedPhoto, drawable);
mEditUserInfoDialog = new AlertDialog.Builder(getActivity())
- .setTitle(R.string.user_info_settings_title)
+ .setTitle(R.string.profile_info_settings_title)
.setIconAttribute(R.drawable.ic_settings_multiuser)
.setView(content)
.setCancelable(true)