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

Commit 18566c1b authored by Robin Lee's avatar Robin Lee
Browse files

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
parent 77bf1bb9
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -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);