summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/profiles/SetupDefaultProfileReceiver.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/settings/profiles/SetupDefaultProfileReceiver.java')
-rw-r--r--src/com/android/settings/profiles/SetupDefaultProfileReceiver.java27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/com/android/settings/profiles/SetupDefaultProfileReceiver.java b/src/com/android/settings/profiles/SetupDefaultProfileReceiver.java
new file mode 100644
index 0000000..10addf1
--- /dev/null
+++ b/src/com/android/settings/profiles/SetupDefaultProfileReceiver.java
@@ -0,0 +1,27 @@
+package com.android.settings.profiles;
+
+import android.app.Profile;
+import android.app.ProfileManager;
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.provider.Settings;
+
+public class SetupDefaultProfileReceiver extends BroadcastReceiver {
+
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ if (Settings.System.getInt(context.getContentResolver(),
+ Settings.System.SYSTEM_PROFILES_ENABLED, 1) == 1) {
+ ProfileManager profileManager = (ProfileManager) context
+ .getSystemService(Context.PROFILE_SERVICE);
+ Profile defaultProfile = profileManager.getProfile("Default");
+ if (defaultProfile != null) {
+ SetupActionsFragment.fillProfileWithCurrentSettings(context, defaultProfile);
+ profileManager.updateProfile(defaultProfile);
+ }
+ }
+
+
+ }
+}