Loading packages/SystemUI/src/com/android/systemui/quicksettings/ProfileTile.java +1 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ public class ProfileTile extends QuickSettingsTile { super(context, qsc); qsc.registerAction(ProfileManagerService.INTENT_ACTION_PROFILE_SELECTED, this); qsc.registerAction(ProfileManagerService.INTENT_ACTION_PROFILE_UPDATED, this); mProfileManager = (ProfileManager) mContext.getSystemService(Context.PROFILE_SERVICE); Loading services/java/com/android/server/ProfileManagerService.java +17 −0 Original line number Diff line number Diff line Loading @@ -54,6 +54,15 @@ public class ProfileManagerService extends IProfileManager.Stub { */ public static final String INTENT_ACTION_PROFILE_SELECTED = "android.intent.action.PROFILE_SELECTED"; /** * <p>Broadcast Action: Current profile has been updated. This is triggered every time the * currently active profile is updated, instead of selected.</p> * <p> For instance, this includes profile updates caused by a locale change, which doesn't * trigger a profile selection, but causes its name to change.</p> * @hide */ public static final String INTENT_ACTION_PROFILE_UPDATED = "android.intent.action.PROFILE_UPDATED"; public static final String PERMISSION_CHANGE_SETTINGS = "android.permission.WRITE_SETTINGS"; private static final String PROFILE_FILENAME = "/data/system/profiles.xml"; Loading Loading @@ -218,6 +227,14 @@ public class ProfileManagerService extends IProfileManager.Stub { restoreCallingIdentity(token); persistIfDirty(); } else if (lastProfile != mActiveProfile) { // Something definitely changed: notify. long token = clearCallingIdentity(); Intent broadcast = new Intent(INTENT_ACTION_PROFILE_UPDATED); broadcast.putExtra("name", mActiveProfile.getName()); broadcast.putExtra("uuid", mActiveProfile.getUuid().toString()); mContext.sendBroadcastAsUser(broadcast, UserHandle.ALL); restoreCallingIdentity(token); } return true; } catch (Exception ex) { Loading Loading
packages/SystemUI/src/com/android/systemui/quicksettings/ProfileTile.java +1 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ public class ProfileTile extends QuickSettingsTile { super(context, qsc); qsc.registerAction(ProfileManagerService.INTENT_ACTION_PROFILE_SELECTED, this); qsc.registerAction(ProfileManagerService.INTENT_ACTION_PROFILE_UPDATED, this); mProfileManager = (ProfileManager) mContext.getSystemService(Context.PROFILE_SERVICE); Loading
services/java/com/android/server/ProfileManagerService.java +17 −0 Original line number Diff line number Diff line Loading @@ -54,6 +54,15 @@ public class ProfileManagerService extends IProfileManager.Stub { */ public static final String INTENT_ACTION_PROFILE_SELECTED = "android.intent.action.PROFILE_SELECTED"; /** * <p>Broadcast Action: Current profile has been updated. This is triggered every time the * currently active profile is updated, instead of selected.</p> * <p> For instance, this includes profile updates caused by a locale change, which doesn't * trigger a profile selection, but causes its name to change.</p> * @hide */ public static final String INTENT_ACTION_PROFILE_UPDATED = "android.intent.action.PROFILE_UPDATED"; public static final String PERMISSION_CHANGE_SETTINGS = "android.permission.WRITE_SETTINGS"; private static final String PROFILE_FILENAME = "/data/system/profiles.xml"; Loading Loading @@ -218,6 +227,14 @@ public class ProfileManagerService extends IProfileManager.Stub { restoreCallingIdentity(token); persistIfDirty(); } else if (lastProfile != mActiveProfile) { // Something definitely changed: notify. long token = clearCallingIdentity(); Intent broadcast = new Intent(INTENT_ACTION_PROFILE_UPDATED); broadcast.putExtra("name", mActiveProfile.getName()); broadcast.putExtra("uuid", mActiveProfile.getUuid().toString()); mContext.sendBroadcastAsUser(broadcast, UserHandle.ALL); restoreCallingIdentity(token); } return true; } catch (Exception ex) { Loading