Loading src/com/android/settings/users/AppRestrictionsFragment.java +4 −3 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.content.RestrictionEntry; import android.content.RestrictionsManager; import android.content.pm.ActivityInfo; import android.content.pm.ApplicationInfo; import android.content.pm.IPackageManager; Loading Loading @@ -841,7 +842,7 @@ public class AppRestrictionsFragment extends SettingsPreferenceFragment implemen continue; } mUserManager.setApplicationRestrictions(packageName, RestrictionUtils.restrictionsToBundle(restrictions), RestrictionsManager.convertRestrictionsToBundle(restrictions), mUser); break; } Loading Loading @@ -915,7 +916,7 @@ public class AppRestrictionsFragment extends SettingsPreferenceFragment implemen onRestrictionsReceived(preference, packageName, restrictions); if (mRestrictedProfile) { mUserManager.setApplicationRestrictions(packageName, RestrictionUtils.restrictionsToBundle(restrictions), mUser); RestrictionsManager.convertRestrictionsToBundle(restrictions), mUser); } } else if (restrictionsIntent != null) { preference.setRestrictions(restrictions); Loading Loading @@ -1046,7 +1047,7 @@ public class AppRestrictionsFragment extends SettingsPreferenceFragment implemen // If there's a valid result, persist it to the user manager. pref.setRestrictions(list); mUserManager.setApplicationRestrictions(packageName, RestrictionUtils.restrictionsToBundle(list), mUser); RestrictionsManager.convertRestrictionsToBundle(list), mUser); } else if (bundle != null) { // If there's a valid result, persist it to the user manager. mUserManager.setApplicationRestrictions(packageName, bundle, mUser); Loading src/com/android/settings/users/RestrictionUtils.java +0 −14 Original line number Diff line number Diff line Loading @@ -90,18 +90,4 @@ public class RestrictionUtils { } um.setUserRestrictions(userRestrictions, user); } public static Bundle restrictionsToBundle(ArrayList<RestrictionEntry> entries) { final Bundle bundle = new Bundle(); for (RestrictionEntry entry : entries) { if (entry.getType() == RestrictionEntry.TYPE_BOOLEAN) { bundle.putBoolean(entry.getKey(), entry.getSelectedState()); } else if (entry.getType() == RestrictionEntry.TYPE_MULTI_SELECT) { bundle.putStringArray(entry.getKey(), entry.getAllSelectedStrings()); } else { bundle.putString(entry.getKey(), entry.getSelectedString()); } } return bundle; } } Loading
src/com/android/settings/users/AppRestrictionsFragment.java +4 −3 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.content.RestrictionEntry; import android.content.RestrictionsManager; import android.content.pm.ActivityInfo; import android.content.pm.ApplicationInfo; import android.content.pm.IPackageManager; Loading Loading @@ -841,7 +842,7 @@ public class AppRestrictionsFragment extends SettingsPreferenceFragment implemen continue; } mUserManager.setApplicationRestrictions(packageName, RestrictionUtils.restrictionsToBundle(restrictions), RestrictionsManager.convertRestrictionsToBundle(restrictions), mUser); break; } Loading Loading @@ -915,7 +916,7 @@ public class AppRestrictionsFragment extends SettingsPreferenceFragment implemen onRestrictionsReceived(preference, packageName, restrictions); if (mRestrictedProfile) { mUserManager.setApplicationRestrictions(packageName, RestrictionUtils.restrictionsToBundle(restrictions), mUser); RestrictionsManager.convertRestrictionsToBundle(restrictions), mUser); } } else if (restrictionsIntent != null) { preference.setRestrictions(restrictions); Loading Loading @@ -1046,7 +1047,7 @@ public class AppRestrictionsFragment extends SettingsPreferenceFragment implemen // If there's a valid result, persist it to the user manager. pref.setRestrictions(list); mUserManager.setApplicationRestrictions(packageName, RestrictionUtils.restrictionsToBundle(list), mUser); RestrictionsManager.convertRestrictionsToBundle(list), mUser); } else if (bundle != null) { // If there's a valid result, persist it to the user manager. mUserManager.setApplicationRestrictions(packageName, bundle, mUser); Loading
src/com/android/settings/users/RestrictionUtils.java +0 −14 Original line number Diff line number Diff line Loading @@ -90,18 +90,4 @@ public class RestrictionUtils { } um.setUserRestrictions(userRestrictions, user); } public static Bundle restrictionsToBundle(ArrayList<RestrictionEntry> entries) { final Bundle bundle = new Bundle(); for (RestrictionEntry entry : entries) { if (entry.getType() == RestrictionEntry.TYPE_BOOLEAN) { bundle.putBoolean(entry.getKey(), entry.getSelectedState()); } else if (entry.getType() == RestrictionEntry.TYPE_MULTI_SELECT) { bundle.putStringArray(entry.getKey(), entry.getAllSelectedStrings()); } else { bundle.putString(entry.getKey(), entry.getSelectedString()); } } return bundle; } }