diff options
author | Ying Zheng <yizheng@google.com> | 2018-06-22 16:54:51 -0700 |
---|---|---|
committer | Ying Zheng <yizheng@google.com> | 2018-06-25 10:28:21 -0700 |
commit | cf20f44f515ca802baad7d73f86cbd829e1a2183 (patch) | |
tree | 41550771b70052f3539b496665800a8e956741b1 /car-lib | |
parent | c3cb52abdbd7dd9b0fb70947242f452440db736c (diff) | |
download | Car-cf20f44f515ca802baad7d73f86cbd829e1a2183.tar.gz |
Update last active user.
Test: Unit test
Bug: 110156344
Change-Id: If8967f3acc434759e4f5b8bc25d6d913c1fa4ee6
Diffstat (limited to 'car-lib')
-rw-r--r-- | car-lib/src/android/car/user/CarUserManagerHelper.java | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/car-lib/src/android/car/user/CarUserManagerHelper.java b/car-lib/src/android/car/user/CarUserManagerHelper.java index a0f4e15d7b..db28d21cba 100644 --- a/car-lib/src/android/car/user/CarUserManagerHelper.java +++ b/car-lib/src/android/car/user/CarUserManagerHelper.java @@ -34,7 +34,6 @@ import android.os.UserManager; import android.provider.Settings; import android.util.Log; -import com.android.internal.annotations.VisibleForTesting; import com.android.internal.util.UserIcons; import com.google.android.collect.Sets; @@ -109,9 +108,7 @@ public class CarUserManagerHelper { * Set default boot into user. * * @param userId default user id to boot into. - * @deprecated Setting default user is obsolete */ - @Deprecated public void setDefaultBootUser(int userId) { Settings.Global.putInt( mContext.getContentResolver(), @@ -136,9 +133,7 @@ public class CarUserManagerHelper { * Get user id for the default boot into user. * * @return user id of the default boot into user - * @deprecated Use {@link #getLastActiveUser()} instead. */ - @Deprecated public int getDefaultBootUser() { // Make user 10 the original default boot user. return Settings.Global.getInt( @@ -371,10 +366,7 @@ public class CarUserManagerHelper { * * @param userInfo User to check against system user. * @return {@code true} if is default user, {@code false} otherwise. - * - * @deprecated Default user is obsolete */ - @Deprecated public boolean isDefaultUser(UserInfo userInfo) { return userInfo.id == getDefaultBootUser(); } @@ -426,6 +418,17 @@ public class CarUserManagerHelper { } /** + * Checks if the given user is non-ephemeral. + * + * @param userId User to check + * @return {@code true} if given user is persistent user. + */ + public boolean isPersistentUser(int userId) { + UserInfo user = mUserManager.getUserInfo(userId); + return !user.isEphemeral(); + } + + /** * Returns whether this user can be removed from the system. * * @param userInfo User to be removed |