Use UserManager.removeUserOrSetEphemeral() to remove current user.
Test: manual verification Bug: 173245580 Bug: 155913815 Change-Id: I74ac8d276f3a78f6c9483a980e4a05486b0c1a8c
This commit is contained in:
@@ -747,8 +747,9 @@ public class UserSettings extends SettingsPreferenceFragment
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
getContext().getSystemService(UserManager.class)
|
||||||
|
.removeUserOrSetEphemeral(UserHandle.myUserId());
|
||||||
ActivityManager.getService().switchUser(UserHandle.USER_SYSTEM);
|
ActivityManager.getService().switchUser(UserHandle.USER_SYSTEM);
|
||||||
getContext().getSystemService(UserManager.class).removeUser(UserHandle.myUserId());
|
|
||||||
} catch (RemoteException re) {
|
} catch (RemoteException re) {
|
||||||
Log.e(TAG, "Unable to remove self user");
|
Log.e(TAG, "Unable to remove self user");
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user