Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7bd8b480 authored by Anna Bauza's avatar Anna Bauza
Browse files

Fix early access to cacheUserSerialNumber API

The cacheUserSerialNumber API is a read only flag that is used to fix early access to the API. The flag will be removed after the cacheUserSerialNumberReadOnly is fully rolled out.

Change-Id: I690d452820152a8a5f6554479cd4bdb7315240ab
Flag: android.multiuser.cache_user_serial_number_read_only
Bug: 353134536
Test: atest UserManagerTest
parent f71346ec
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -6442,7 +6442,11 @@ public class UserManager {
     */
    @UnsupportedAppUsage
    public int getUserSerialNumber(@UserIdInt int userId) {
        if (android.multiuser.Flags.cacheUserSerialNumber()) {
        // Read only flag should is to fix early access to this API
        // cacheUserSerialNumber to be removed after the
        // cacheUserSerialNumberReadOnly is fully rolled out
        if (android.multiuser.Flags.cacheUserSerialNumberReadOnly()
                || android.multiuser.Flags.cacheUserSerialNumber()) {
            // System user serial number is always 0, and it always exists.
            // There is no need to call binder for that.
            if (userId == UserHandle.USER_SYSTEM) {