@@ -2286,34 +2286,84 @@ public static Intent createChooser(Intent target, CharSequence title) {
22862286 public static final String ACTION_PRE_BOOT_COMPLETED =
22872287 "android.intent.action.PRE_BOOT_COMPLETED" ;
22882288
2289+ /**
2290+ * Sent the first time a user is starting, to allow system apps to
2291+ * perform one time initialization. (This will not be seen by third
2292+ * party applications because a newly initialized user does not have any
2293+ * third party applications installed for it.) This is sent early in
2294+ * starting the user, around the time the home app is started, before
2295+ * {@link #ACTION_BOOT_COMPLETED} is sent.
2296+ */
2297+ public static final String ACTION_USER_INITIALIZE =
2298+ "android.intent.action.USER_INITIALIZE" ;
2299+
2300+ /**
2301+ * Sent when a user switch is happening, causing the process's user to be
2302+ * brought to the foreground. This is only sent to receivers registered
2303+ * through {@link Context#registerReceiver(BroadcastReceiver, IntentFilter)
2304+ * Context.registerReceiver}. It is sent to the user that is going to the
2305+ * foreground.
2306+ */
2307+ public static final String ACTION_USER_FOREGROUND =
2308+ "android.intent.action.USER_FOREGROUND" ;
2309+
2310+ /**
2311+ * Sent when a user switch is happening, causing the process's user to be
2312+ * sent to the background. This is only sent to receivers registered
2313+ * through {@link Context#registerReceiver(BroadcastReceiver, IntentFilter)
2314+ * Context.registerReceiver}. It is sent to the user that is going to the
2315+ * background.
2316+ */
2317+ public static final String ACTION_USER_BACKGROUND =
2318+ "android.intent.action.USER_BACKGROUND" ;
2319+
22892320 /**
22902321 * Broadcast sent to the system when a user is added. Carries an extra EXTRA_USER_HANDLE that has the
2291- * userHandle of the new user.
2322+ * userHandle of the new user. It is sent to all running users. You must hold
2323+ * {@link android.Manifest.permission#MANAGE_USERS} to receive this broadcast.
22922324 * @hide
22932325 */
22942326 public static final String ACTION_USER_ADDED =
22952327 "android.intent.action.USER_ADDED" ;
22962328
2329+ /**
2330+ * Broadcast sent to the system when a user is started. Carries an extra EXTRA_USER_HANDLE that has
2331+ * the userHandle of the user. This is only sent to
2332+ * registered receivers, not manifest receivers. It is sent to the user
2333+ * that has been started.
2334+ * @hide
2335+ */
2336+ public static final String ACTION_USER_STARTED =
2337+ "android.intent.action.USER_STARTED" ;
2338+
22972339 /**
22982340 * Broadcast sent to the system when a user is stopped. Carries an extra EXTRA_USER_HANDLE that has
22992341 * the userHandle of the user. This is similar to {@link #ACTION_PACKAGE_RESTARTED},
2300- * but for an entire user instead of a specific package.
2342+ * but for an entire user instead of a specific package. This is only sent to
2343+ * registered receivers, not manifest receivers. It is sent to all running
2344+ * users <em>except</em> the one that has just been stopped (which is no
2345+ * longer running).
23012346 * @hide
23022347 */
23032348 public static final String ACTION_USER_STOPPED =
23042349 "android.intent.action.USER_STOPPED" ;
23052350
23062351 /**
23072352 * Broadcast sent to the system when a user is removed. Carries an extra EXTRA_USER_HANDLE that has
2308- * the userHandle of the user.
2353+ * the userHandle of the user. It is sent to all running users except the
2354+ * one that has been removed. You must hold
2355+ * {@link android.Manifest.permission#MANAGE_USERS} to receive this broadcast.
23092356 * @hide
23102357 */
23112358 public static final String ACTION_USER_REMOVED =
23122359 "android.intent.action.USER_REMOVED" ;
23132360
23142361 /**
23152362 * Broadcast sent to the system when the user switches. Carries an extra EXTRA_USER_HANDLE that has
2316- * the userHandle of the user to become the current one.
2363+ * the userHandle of the user to become the current one. This is only sent to
2364+ * registered receivers, not manifest receivers. It is sent to all running users.
2365+ * You must hold
2366+ * {@link android.Manifest.permission#MANAGE_USERS} to receive this broadcast.
23172367 * @hide
23182368 */
23192369 public static final String ACTION_USER_SWITCHED =
0 commit comments