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 @@ -1300,7 +1300,7 @@ private void enableUserSelectorIfNecessary() {
13001300 if (!UserManager .supportsMultipleUsers ()) {
13011301 return ; // device doesn't support multi-user mode
13021302 }
1303- UserManager um = (UserManager ) mContext .getSystemService (Context .USER_SERVICE );
1303+ final UserManager um = (UserManager ) mContext .getSystemService (Context .USER_SERVICE );
13041304 if (um == null ) {
13051305 Throwable t = new Throwable ();
13061306 t .fillInStackTrace ();
@@ -1309,16 +1309,23 @@ private void enableUserSelectorIfNecessary() {
13091309 }
13101310
13111311 // if there are multiple users, we need to enable to multi-user switcher
1312- List <UserInfo > users = um .getUsers (true );
1312+ final List <UserInfo > users = um .getUsers (true );
13131313 if (users == null ) {
13141314 Throwable t = new Throwable ();
13151315 t .fillInStackTrace ();
13161316 Log .e (TAG , "list of users is null." , t );
13171317 return ;
13181318 }
13191319
1320+ final View multiUserView = findViewById (R .id .keyguard_user_selector );
1321+ if (multiUserView == null ) {
1322+ Throwable t = new Throwable ();
1323+ t .fillInStackTrace ();
1324+ Log .e (TAG , "can't find user_selector in layout." , t );
1325+ return ;
1326+ }
1327+
13201328 if (users .size () > 1 ) {
1321- View multiUserView = findViewById (R .id .keyguard_user_selector );
13221329 if (multiUserView instanceof KeyguardMultiUserSelectorView ) {
13231330 KeyguardMultiUserSelectorView multiUser =
13241331 (KeyguardMultiUserSelectorView ) multiUserView ;
You can’t perform that action at this time.
0 commit comments