Skip lockdown setup if user is not up yet
Sometimes USER_UNLOCKED can be sent before USER_STARTED. This puts lockdown in a bad state as it needs a fully-functioning user to tie itself to and listen for connectivity events. Bug: 27637943 Change-Id: I41a784a75a8c8674cb61dbba10693dd56c9396dd
This commit is contained in:
@@ -3253,8 +3253,12 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
||||
}
|
||||
int user = UserHandle.getUserId(Binder.getCallingUid());
|
||||
synchronized(mVpns) {
|
||||
setLockdownTracker(new LockdownVpnTracker(mContext, mNetd, this, mVpns.get(user),
|
||||
profile));
|
||||
Vpn vpn = mVpns.get(user);
|
||||
if (vpn == null) {
|
||||
Slog.w(TAG, "VPN for user " + user + " not ready yet. Skipping lockdown");
|
||||
return false;
|
||||
}
|
||||
setLockdownTracker(new LockdownVpnTracker(mContext, mNetd, this, vpn, profile));
|
||||
}
|
||||
} else {
|
||||
setLockdownTracker(null);
|
||||
|
||||
Reference in New Issue
Block a user