Merge "Merge "Improved user callbacks on SystemService:" into rvc-dev am: 9fa3a870c6 am: ae74c70a9d" into rvc-d1-dev-plus-aosp
This commit is contained in:
committed by
Android (Google) Code Review
commit
02f1087d45
@@ -49,14 +49,15 @@ package com.android.server {
|
|||||||
public abstract class SystemService {
|
public abstract class SystemService {
|
||||||
ctor public SystemService(@NonNull android.content.Context);
|
ctor public SystemService(@NonNull android.content.Context);
|
||||||
method @NonNull public final android.content.Context getContext();
|
method @NonNull public final android.content.Context getContext();
|
||||||
method public boolean isSupportedUser(@NonNull com.android.server.SystemService.TargetUser);
|
method public boolean isUserSupported(@NonNull com.android.server.SystemService.TargetUser);
|
||||||
method public void onBootPhase(int);
|
method public void onBootPhase(int);
|
||||||
method public void onCleanupUser(@NonNull com.android.server.SystemService.TargetUser);
|
|
||||||
method public abstract void onStart();
|
method public abstract void onStart();
|
||||||
method public void onStartUser(@NonNull com.android.server.SystemService.TargetUser);
|
method public void onUserStarting(@NonNull com.android.server.SystemService.TargetUser);
|
||||||
method public void onStopUser(@NonNull com.android.server.SystemService.TargetUser);
|
method public void onUserStopped(@NonNull com.android.server.SystemService.TargetUser);
|
||||||
method public void onSwitchUser(@Nullable com.android.server.SystemService.TargetUser, @NonNull com.android.server.SystemService.TargetUser);
|
method public void onUserStopping(@NonNull com.android.server.SystemService.TargetUser);
|
||||||
method public void onUnlockUser(@NonNull com.android.server.SystemService.TargetUser);
|
method public void onUserSwitching(@Nullable com.android.server.SystemService.TargetUser, @NonNull com.android.server.SystemService.TargetUser);
|
||||||
|
method public void onUserUnlocked(@NonNull com.android.server.SystemService.TargetUser);
|
||||||
|
method public void onUserUnlocking(@NonNull com.android.server.SystemService.TargetUser);
|
||||||
method protected final void publishBinderService(@NonNull String, @NonNull android.os.IBinder);
|
method protected final void publishBinderService(@NonNull String, @NonNull android.os.IBinder);
|
||||||
method protected final void publishBinderService(@NonNull String, @NonNull android.os.IBinder, boolean);
|
method protected final void publishBinderService(@NonNull String, @NonNull android.os.IBinder, boolean);
|
||||||
field public static final int PHASE_ACTIVITY_MANAGER_READY = 550; // 0x226
|
field public static final int PHASE_ACTIVITY_MANAGER_READY = 550; // 0x226
|
||||||
|
|||||||
@@ -331,7 +331,7 @@ public final class AutofillManagerService
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override // from SystemService
|
@Override // from SystemService
|
||||||
public boolean isSupportedUser(TargetUser user) {
|
public boolean isUserSupported(TargetUser user) {
|
||||||
return user.getUserInfo().isFull() || user.getUserInfo().isManagedProfile();
|
return user.getUserInfo().isFull() || user.getUserInfo().isManagedProfile();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -201,7 +201,7 @@ public final class ContentCaptureManagerService extends
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override // from SystemService
|
@Override // from SystemService
|
||||||
public boolean isSupportedUser(TargetUser user) {
|
public boolean isUserSupported(TargetUser user) {
|
||||||
return user.getUserInfo().isFull() || user.getUserInfo().isManagedProfile();
|
return user.getUserInfo().isFull() || user.getUserInfo().isManagedProfile();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -279,7 +279,7 @@ class StorageManagerService extends IStorageManager.Stub
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onStartUser(TargetUser user) {
|
public void onUserStarting(TargetUser user) {
|
||||||
mStorageManagerService.snapshotAndMonitorLegacyStorageAppOp(user.getUserHandle());
|
mStorageManagerService.snapshotAndMonitorLegacyStorageAppOp(user.getUserHandle());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -238,12 +238,12 @@ public abstract class SystemService {
|
|||||||
* <p>By default returns {@code true}, but subclasses should extend for optimization, if they
|
* <p>By default returns {@code true}, but subclasses should extend for optimization, if they
|
||||||
* don't support some types (like headless system user).
|
* don't support some types (like headless system user).
|
||||||
*/
|
*/
|
||||||
public boolean isSupportedUser(@NonNull TargetUser user) {
|
public boolean isUserSupported(@NonNull TargetUser user) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper method used to dump which users are {@link #onStartUser(TargetUser) supported}.
|
* Helper method used to dump which users are {@link #onUserStarting(TargetUser) supported}.
|
||||||
*
|
*
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@@ -264,7 +264,7 @@ public abstract class SystemService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated subclasses should extend {@link #onStartUser(TargetUser)} instead
|
* @deprecated subclasses should extend {@link #onUserStarting(TargetUser)} instead
|
||||||
* (which by default calls this method).
|
* (which by default calls this method).
|
||||||
*
|
*
|
||||||
* @hide
|
* @hide
|
||||||
@@ -273,7 +273,7 @@ public abstract class SystemService {
|
|||||||
public void onStartUser(@UserIdInt int userId) {}
|
public void onStartUser(@UserIdInt int userId) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated subclasses should extend {@link #onStartUser(TargetUser)} instead
|
* @deprecated subclasses should extend {@link #onUserStarting(TargetUser)} instead
|
||||||
* (which by default calls this method).
|
* (which by default calls this method).
|
||||||
*
|
*
|
||||||
* @hide
|
* @hide
|
||||||
@@ -287,17 +287,17 @@ public abstract class SystemService {
|
|||||||
* Called when a new user is starting, for system services to initialize any per-user
|
* Called when a new user is starting, for system services to initialize any per-user
|
||||||
* state they maintain for running users.
|
* state they maintain for running users.
|
||||||
*
|
*
|
||||||
* <p>This method is only called when the service {@link #isSupportedUser(TargetUser) supports}
|
* <p>This method is only called when the service {@link #isUserSupported(TargetUser) supports}
|
||||||
* this user.
|
* this user.
|
||||||
*
|
*
|
||||||
* @param user target user
|
* @param user target user
|
||||||
*/
|
*/
|
||||||
public void onStartUser(@NonNull TargetUser user) {
|
public void onUserStarting(@NonNull TargetUser user) {
|
||||||
onStartUser(user.getUserInfo());
|
onStartUser(user.getUserInfo());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated subclasses should extend {@link #onUnlockUser(TargetUser)} instead (which by
|
* @deprecated subclasses should extend {@link #onUserUnlocking(TargetUser)} instead (which by
|
||||||
* default calls this method).
|
* default calls this method).
|
||||||
*
|
*
|
||||||
* @hide
|
* @hide
|
||||||
@@ -306,7 +306,7 @@ public abstract class SystemService {
|
|||||||
public void onUnlockUser(@UserIdInt int userId) {}
|
public void onUnlockUser(@UserIdInt int userId) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated subclasses should extend {@link #onUnlockUser(TargetUser)} instead (which by
|
* @deprecated subclasses should extend {@link #onUserUnlocking(TargetUser)} instead (which by
|
||||||
* default calls this method).
|
* default calls this method).
|
||||||
*
|
*
|
||||||
* @hide
|
* @hide
|
||||||
@@ -326,19 +326,30 @@ public abstract class SystemService {
|
|||||||
* the user will transition into the {@code STATE_RUNNING_UNLOCKED} state.
|
* the user will transition into the {@code STATE_RUNNING_UNLOCKED} state.
|
||||||
* Code written inside system services should use
|
* Code written inside system services should use
|
||||||
* {@link UserManager#isUserUnlockingOrUnlocked(int)} to handle both of
|
* {@link UserManager#isUserUnlockingOrUnlocked(int)} to handle both of
|
||||||
* these states.
|
* these states, or use {@link #onUserUnlocked(TargetUser)} instead.
|
||||||
* <p>
|
* <p>
|
||||||
* This method is only called when the service {@link #isSupportedUser(TargetUser) supports}
|
* This method is only called when the service {@link #isUserSupported(TargetUser) supports}
|
||||||
* this user.
|
* this user.
|
||||||
*
|
*
|
||||||
* @param user target user
|
* @param user target user
|
||||||
*/
|
*/
|
||||||
public void onUnlockUser(@NonNull TargetUser user) {
|
public void onUserUnlocking(@NonNull TargetUser user) {
|
||||||
onUnlockUser(user.getUserInfo());
|
onUnlockUser(user.getUserInfo());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated subclasses should extend {@link #onSwitchUser(TargetUser, TargetUser)} instead
|
* Called after an existing user is unlocked.
|
||||||
|
*
|
||||||
|
* <p>This method is only called when the service {@link #isUserSupported(TargetUser) supports}
|
||||||
|
* this user.
|
||||||
|
*
|
||||||
|
* @param user target user
|
||||||
|
*/
|
||||||
|
public void onUserUnlocked(@NonNull TargetUser user) {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated subclasses should extend {@link #onUserSwitching(TargetUser, TargetUser)} instead
|
||||||
* (which by default calls this method).
|
* (which by default calls this method).
|
||||||
*
|
*
|
||||||
* @hide
|
* @hide
|
||||||
@@ -347,7 +358,7 @@ public abstract class SystemService {
|
|||||||
public void onSwitchUser(@UserIdInt int toUserId) {}
|
public void onSwitchUser(@UserIdInt int toUserId) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated subclasses should extend {@link #onSwitchUser(TargetUser, TargetUser)} instead
|
* @deprecated subclasses should extend {@link #onUserSwitching(TargetUser, TargetUser)} instead
|
||||||
* (which by default calls this method).
|
* (which by default calls this method).
|
||||||
*
|
*
|
||||||
* @hide
|
* @hide
|
||||||
@@ -362,7 +373,7 @@ public abstract class SystemService {
|
|||||||
* special behavior for whichever user is currently in the foreground. This is called
|
* special behavior for whichever user is currently in the foreground. This is called
|
||||||
* before any application processes are aware of the new user.
|
* before any application processes are aware of the new user.
|
||||||
*
|
*
|
||||||
* <p>This method is only called when the service {@link #isSupportedUser(TargetUser) supports}
|
* <p>This method is only called when the service {@link #isUserSupported(TargetUser) supports}
|
||||||
* either of the users ({@code from} or {@code to}).
|
* either of the users ({@code from} or {@code to}).
|
||||||
*
|
*
|
||||||
* <b>NOTE: </b> both {@code from} and {@code to} are "live" objects
|
* <b>NOTE: </b> both {@code from} and {@code to} are "live" objects
|
||||||
@@ -371,12 +382,12 @@ public abstract class SystemService {
|
|||||||
* @param from the user switching from
|
* @param from the user switching from
|
||||||
* @param to the user switching to
|
* @param to the user switching to
|
||||||
*/
|
*/
|
||||||
public void onSwitchUser(@Nullable TargetUser from, @NonNull TargetUser to) {
|
public void onUserSwitching(@Nullable TargetUser from, @NonNull TargetUser to) {
|
||||||
onSwitchUser((from == null ? null : from.getUserInfo()), to.getUserInfo());
|
onSwitchUser((from == null ? null : from.getUserInfo()), to.getUserInfo());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated subclasses should extend {@link #onStopUser(TargetUser)} instead
|
* @deprecated subclasses should extend {@link #onUserStopping(TargetUser)} instead
|
||||||
* (which by default calls this method).
|
* (which by default calls this method).
|
||||||
*
|
*
|
||||||
* @hide
|
* @hide
|
||||||
@@ -385,7 +396,7 @@ public abstract class SystemService {
|
|||||||
public void onStopUser(@UserIdInt int userId) {}
|
public void onStopUser(@UserIdInt int userId) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated subclasses should extend {@link #onStopUser(TargetUser)} instead
|
* @deprecated subclasses should extend {@link #onUserStopping(TargetUser)} instead
|
||||||
* (which by default calls this method).
|
* (which by default calls this method).
|
||||||
*
|
*
|
||||||
* @hide
|
* @hide
|
||||||
@@ -402,19 +413,19 @@ public abstract class SystemService {
|
|||||||
* broadcast to the user; it is a good place to stop making use of any resources of that
|
* broadcast to the user; it is a good place to stop making use of any resources of that
|
||||||
* user (such as binding to a service running in the user).
|
* user (such as binding to a service running in the user).
|
||||||
*
|
*
|
||||||
* <p>This method is only called when the service {@link #isSupportedUser(TargetUser) supports}
|
* <p>This method is only called when the service {@link #isUserSupported(TargetUser) supports}
|
||||||
* this user.
|
* this user.
|
||||||
*
|
*
|
||||||
* <p>NOTE: This is the last callback where the callee may access the target user's CE storage.
|
* <p>NOTE: This is the last callback where the callee may access the target user's CE storage.
|
||||||
*
|
*
|
||||||
* @param user target user
|
* @param user target user
|
||||||
*/
|
*/
|
||||||
public void onStopUser(@NonNull TargetUser user) {
|
public void onUserStopping(@NonNull TargetUser user) {
|
||||||
onStopUser(user.getUserInfo());
|
onStopUser(user.getUserInfo());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated subclasses should extend {@link #onCleanupUser(TargetUser)} instead (which by
|
* @deprecated subclasses should extend {@link #onUserStopped(TargetUser)} instead (which by
|
||||||
* default calls this method).
|
* default calls this method).
|
||||||
*
|
*
|
||||||
* @hide
|
* @hide
|
||||||
@@ -423,7 +434,7 @@ public abstract class SystemService {
|
|||||||
public void onCleanupUser(@UserIdInt int userId) {}
|
public void onCleanupUser(@UserIdInt int userId) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated subclasses should extend {@link #onCleanupUser(TargetUser)} instead (which by
|
* @deprecated subclasses should extend {@link #onUserStopped(TargetUser)} instead (which by
|
||||||
* default calls this method).
|
* default calls this method).
|
||||||
*
|
*
|
||||||
* @hide
|
* @hide
|
||||||
@@ -434,20 +445,16 @@ public abstract class SystemService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when an existing user is stopping, for system services to finalize any per-user
|
* Called after an existing user is stopped.
|
||||||
* state they maintain for running users. This is called after all application process
|
|
||||||
* teardown of the user is complete.
|
|
||||||
*
|
*
|
||||||
* <p>This method is only called when the service {@link #isSupportedUser(TargetUser) supports}
|
* <p>This is called after all application process teardown of the user is complete.
|
||||||
|
*
|
||||||
|
* <p>This method is only called when the service {@link #isUserSupported(TargetUser) supports}
|
||||||
* this user.
|
* this user.
|
||||||
*
|
*
|
||||||
* <p>NOTE: When this callback is called, the CE storage for the target user may not be
|
|
||||||
* accessible already. Use {@link #onStopUser(TargetUser)} instead if you need to access the CE
|
|
||||||
* storage.
|
|
||||||
*
|
|
||||||
* @param user target user
|
* @param user target user
|
||||||
*/
|
*/
|
||||||
public void onCleanupUser(@NonNull TargetUser user) {
|
public void onUserStopped(@NonNull TargetUser user) {
|
||||||
onCleanupUser(user.getUserInfo());
|
onCleanupUser(user.getUserInfo());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -51,7 +51,8 @@ public class SystemServiceManager {
|
|||||||
|
|
||||||
// Constants used on onUser(...)
|
// Constants used on onUser(...)
|
||||||
private static final String START = "Start";
|
private static final String START = "Start";
|
||||||
private static final String UNLOCK = "Unlock";
|
private static final String UNLOCKING = "Unlocking";
|
||||||
|
private static final String UNLOCKED = "Unlocked";
|
||||||
private static final String SWITCH = "Switch";
|
private static final String SWITCH = "Switch";
|
||||||
private static final String STOP = "Stop";
|
private static final String STOP = "Stop";
|
||||||
private static final String CLEANUP = "Cleanup";
|
private static final String CLEANUP = "Cleanup";
|
||||||
@@ -260,7 +261,14 @@ public class SystemServiceManager {
|
|||||||
* Unlocks the given user.
|
* Unlocks the given user.
|
||||||
*/
|
*/
|
||||||
public void unlockUser(final @UserIdInt int userHandle) {
|
public void unlockUser(final @UserIdInt int userHandle) {
|
||||||
onUser(UNLOCK, userHandle);
|
onUser(UNLOCKING, userHandle);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called after the user was unlocked.
|
||||||
|
*/
|
||||||
|
public void onUserUnlocked(final @UserIdInt int userHandle) {
|
||||||
|
onUser(UNLOCKED, userHandle);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -304,12 +312,12 @@ public class SystemServiceManager {
|
|||||||
for (int i = 0; i < serviceLen; i++) {
|
for (int i = 0; i < serviceLen; i++) {
|
||||||
final SystemService service = mServices.get(i);
|
final SystemService service = mServices.get(i);
|
||||||
final String serviceName = service.getClass().getName();
|
final String serviceName = service.getClass().getName();
|
||||||
boolean supported = service.isSupportedUser(curUser);
|
boolean supported = service.isUserSupported(curUser);
|
||||||
|
|
||||||
// Must check if either curUser or prevUser is supported (for example, if switching from
|
// Must check if either curUser or prevUser is supported (for example, if switching from
|
||||||
// unsupported to supported, we still need to notify the services)
|
// unsupported to supported, we still need to notify the services)
|
||||||
if (!supported && prevUser != null) {
|
if (!supported && prevUser != null) {
|
||||||
supported = service.isSupportedUser(prevUser);
|
supported = service.isUserSupported(prevUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!supported) {
|
if (!supported) {
|
||||||
@@ -328,19 +336,22 @@ public class SystemServiceManager {
|
|||||||
try {
|
try {
|
||||||
switch (onWhat) {
|
switch (onWhat) {
|
||||||
case SWITCH:
|
case SWITCH:
|
||||||
service.onSwitchUser(prevUser, curUser);
|
service.onUserSwitching(prevUser, curUser);
|
||||||
break;
|
break;
|
||||||
case START:
|
case START:
|
||||||
service.onStartUser(curUser);
|
service.onUserStarting(curUser);
|
||||||
break;
|
break;
|
||||||
case UNLOCK:
|
case UNLOCKING:
|
||||||
service.onUnlockUser(curUser);
|
service.onUserUnlocking(curUser);
|
||||||
|
break;
|
||||||
|
case UNLOCKED:
|
||||||
|
service.onUserUnlocked(curUser);
|
||||||
break;
|
break;
|
||||||
case STOP:
|
case STOP:
|
||||||
service.onStopUser(curUser);
|
service.onUserStopping(curUser);
|
||||||
break;
|
break;
|
||||||
case CLEANUP:
|
case CLEANUP:
|
||||||
service.onCleanupUser(curUser);
|
service.onUserStopped(curUser);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new IllegalArgumentException(onWhat + " what?");
|
throw new IllegalArgumentException(onWhat + " what?");
|
||||||
|
|||||||
@@ -146,6 +146,7 @@ class UserController implements Handler.Callback {
|
|||||||
static final int REPORT_USER_SWITCH_COMPLETE_MSG = 80;
|
static final int REPORT_USER_SWITCH_COMPLETE_MSG = 80;
|
||||||
static final int USER_SWITCH_CALLBACKS_TIMEOUT_MSG = 90;
|
static final int USER_SWITCH_CALLBACKS_TIMEOUT_MSG = 90;
|
||||||
static final int USER_UNLOCK_MSG = 100;
|
static final int USER_UNLOCK_MSG = 100;
|
||||||
|
static final int USER_UNLOCKED_MSG = 105;
|
||||||
static final int REPORT_LOCKED_BOOT_COMPLETE_MSG = 110;
|
static final int REPORT_LOCKED_BOOT_COMPLETE_MSG = 110;
|
||||||
static final int START_USER_SWITCH_FG_MSG = 120;
|
static final int START_USER_SWITCH_FG_MSG = 120;
|
||||||
|
|
||||||
@@ -625,6 +626,9 @@ class UserController implements Handler.Callback {
|
|||||||
FrameworkStatsLog.BOOT_TIME_EVENT_ELAPSED_TIME__EVENT__FRAMEWORK_BOOT_COMPLETED,
|
FrameworkStatsLog.BOOT_TIME_EVENT_ELAPSED_TIME__EVENT__FRAMEWORK_BOOT_COMPLETED,
|
||||||
elapsedTimeMs);
|
elapsedTimeMs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mHandler.obtainMessage(USER_UNLOCKED_MSG, userId, 0).sendToTarget();
|
||||||
|
|
||||||
final Intent bootIntent = new Intent(Intent.ACTION_BOOT_COMPLETED, null);
|
final Intent bootIntent = new Intent(Intent.ACTION_BOOT_COMPLETED, null);
|
||||||
bootIntent.putExtra(Intent.EXTRA_USER_HANDLE, userId);
|
bootIntent.putExtra(Intent.EXTRA_USER_HANDLE, userId);
|
||||||
bootIntent.addFlags(Intent.FLAG_RECEIVER_NO_ABORT
|
bootIntent.addFlags(Intent.FLAG_RECEIVER_NO_ABORT
|
||||||
@@ -2366,6 +2370,9 @@ class UserController implements Handler.Callback {
|
|||||||
});
|
});
|
||||||
finishUserUnlocked((UserState) msg.obj);
|
finishUserUnlocked((UserState) msg.obj);
|
||||||
break;
|
break;
|
||||||
|
case USER_UNLOCKED_MSG:
|
||||||
|
mInjector.getSystemServiceManager().onUserUnlocked(msg.arg1);
|
||||||
|
break;
|
||||||
case USER_CURRENT_MSG:
|
case USER_CURRENT_MSG:
|
||||||
mInjector.batteryStatsServiceNoteEvent(
|
mInjector.batteryStatsServiceNoteEvent(
|
||||||
BatteryStats.HistoryItem.EVENT_USER_FOREGROUND_FINISH,
|
BatteryStats.HistoryItem.EVENT_USER_FOREGROUND_FINISH,
|
||||||
|
|||||||
@@ -713,7 +713,7 @@ public abstract class AbstractMasterSystemService<M extends AbstractMasterSystem
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a list of all supported users (i.e., those that pass the
|
* Gets a list of all supported users (i.e., those that pass the
|
||||||
* {@link #isSupportedUser(TargetUser)}check).
|
* {@link #isUserSupported(TargetUser)}check).
|
||||||
*/
|
*/
|
||||||
@NonNull
|
@NonNull
|
||||||
protected List<UserInfo> getSupportedUsers() {
|
protected List<UserInfo> getSupportedUsers() {
|
||||||
@@ -722,7 +722,7 @@ public abstract class AbstractMasterSystemService<M extends AbstractMasterSystem
|
|||||||
final List<UserInfo> supportedUsers = new ArrayList<>(size);
|
final List<UserInfo> supportedUsers = new ArrayList<>(size);
|
||||||
for (int i = 0; i < size; i++) {
|
for (int i = 0; i < size; i++) {
|
||||||
final UserInfo userInfo = allUsers[i];
|
final UserInfo userInfo = allUsers[i];
|
||||||
if (isSupportedUser(new TargetUser(userInfo))) {
|
if (isUserSupported(new TargetUser(userInfo))) {
|
||||||
supportedUsers.add(userInfo);
|
supportedUsers.add(userInfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,12 +71,12 @@ public class PeopleService extends SystemService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onUnlockUser(@NonNull TargetUser targetUser) {
|
public void onUserUnlocking(@NonNull TargetUser targetUser) {
|
||||||
mDataManager.onUserUnlocked(targetUser.getUserIdentifier());
|
mDataManager.onUserUnlocked(targetUser.getUserIdentifier());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onStopUser(@NonNull TargetUser targetUser) {
|
public void onUserStopping(@NonNull TargetUser targetUser) {
|
||||||
mDataManager.onUserStopped(targetUser.getUserIdentifier());
|
mDataManager.onUserStopped(targetUser.getUserIdentifier());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -110,18 +110,18 @@ public class UsbService extends IUsbManager.Stub {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSwitchUser(TargetUser from, TargetUser to) {
|
public void onUserSwitching(TargetUser from, TargetUser to) {
|
||||||
FgThread.getHandler()
|
FgThread.getHandler()
|
||||||
.postAtFrontOfQueue(() -> mUsbService.onSwitchUser(to.getUserIdentifier()));
|
.postAtFrontOfQueue(() -> mUsbService.onSwitchUser(to.getUserIdentifier()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onStopUser(TargetUser userInfo) {
|
public void onUserStopping(TargetUser userInfo) {
|
||||||
mUsbService.onStopUser(userInfo.getUserHandle());
|
mUsbService.onStopUser(userInfo.getUserHandle());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onUnlockUser(TargetUser userInfo) {
|
public void onUserUnlocking(TargetUser userInfo) {
|
||||||
mUsbService.onUnlockUser(userInfo.getUserIdentifier());
|
mUsbService.onUnlockUser(userInfo.getUserIdentifier());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ public class VoiceInteractionManagerService extends SystemService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isSupportedUser(TargetUser user) {
|
public boolean isUserSupported(TargetUser user) {
|
||||||
return isSupported(user.getUserInfo());
|
return isSupported(user.getUserInfo());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user