File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
policy/src/com/android/internal/policy/impl/keyguard Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -1311,7 +1311,7 @@ private void enableUserSelectorIfNecessary() {
13111311 if (!UserManager .supportsMultipleUsers ()) {
13121312 return ; // device doesn't support multi-user mode
13131313 }
1314- UserManager um = (UserManager ) mContext .getSystemService (Context .USER_SERVICE );
1314+ final UserManager um = (UserManager ) mContext .getSystemService (Context .USER_SERVICE );
13151315 if (um == null ) {
13161316 Throwable t = new Throwable ();
13171317 t .fillInStackTrace ();
@@ -1320,16 +1320,23 @@ private void enableUserSelectorIfNecessary() {
13201320 }
13211321
13221322 // if there are multiple users, we need to enable to multi-user switcher
1323- List <UserInfo > users = um .getUsers (true );
1323+ final List <UserInfo > users = um .getUsers (true );
13241324 if (users == null ) {
13251325 Throwable t = new Throwable ();
13261326 t .fillInStackTrace ();
13271327 Log .e (TAG , "list of users is null." , t );
13281328 return ;
13291329 }
13301330
1331+ final View multiUserView = findViewById (R .id .keyguard_user_selector );
1332+ if (multiUserView == null ) {
1333+ Throwable t = new Throwable ();
1334+ t .fillInStackTrace ();
1335+ Log .e (TAG , "can't find user_selector in layout." , t );
1336+ return ;
1337+ }
1338+
13311339 if (users .size () > 1 ) {
1332- View multiUserView = findViewById (R .id .keyguard_user_selector );
13331340 if (multiUserView instanceof KeyguardMultiUserSelectorView ) {
13341341 KeyguardMultiUserSelectorView multiUser =
13351342 (KeyguardMultiUserSelectorView ) multiUserView ;
You can’t perform that action at this time.
0 commit comments