UserInfo.isDemo() to also check UserInfo.FLAG_DEMO

With the refactoring in ag/9507174, UserInfo.FLAG_DEMO is
deprecated, but ARC demo mode is still relying on it. This is
a temporary fix to keep ARC demo mode working. A proper fix will
be put in by b/179010471.

Bug: 178460880
Bug: 179010471
Test: UserManager.isDemoUser() returns true during ARC demo session.
Apps show demo mode behaviors.

Change-Id: I825d3e6c0a799005982372baa3fea5fa16c99fd2
(cherry picked from commit b652b79cb36166092063ff9df82e404129f67f3c)
(cherry picked from commit 3a72c3ec0bbc0a1dc41a8187c37504f3db4c1da1)
This commit is contained in:
Cherie Cheung
2021-02-01 21:08:09 +09:00
parent 00a8be3e37
commit 3667b31ae9

View File

@@ -343,7 +343,7 @@ public class UserInfo implements Parcelable {
}
public boolean isDemo() {
return UserManager.isUserTypeDemo(userType);
return UserManager.isUserTypeDemo(userType) || (flags & FLAG_DEMO) != 0;
}
public boolean isFull() {