Reinstate USER_PRESENT for ConnectivityService
Reverts half of commit829f7c72e5Reverts parts of commit9b747914f3Lockdown VPN still needs this to start properly on devices without FBE, such as phones upgraded from M. Without listening to USER_PRESENT the first unlock of keystore may get missed, since USER_UNLOCKED is sent too soon to be useful. Bug: 34587043 Change-Id: If7a2f5a3173b0f6856244a5f7904bf00c9a5b5e7
This commit is contained in:
@@ -815,6 +815,8 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
||||
intentFilter.addAction(Intent.ACTION_USER_UNLOCKED);
|
||||
mContext.registerReceiverAsUser(
|
||||
mUserIntentReceiver, UserHandle.ALL, intentFilter, null, null);
|
||||
mContext.registerReceiverAsUser(mUserPresentReceiver, UserHandle.SYSTEM,
|
||||
new IntentFilter(Intent.ACTION_USER_PRESENT), null, null);
|
||||
|
||||
try {
|
||||
mNetd.registerObserver(mTethering);
|
||||
@@ -4000,6 +4002,16 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
||||
}
|
||||
};
|
||||
|
||||
private BroadcastReceiver mUserPresentReceiver = new BroadcastReceiver() {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
// Try creating lockdown tracker, since user present usually means
|
||||
// unlocked keystore.
|
||||
updateLockdownVpn();
|
||||
mContext.unregisterReceiver(this);
|
||||
}
|
||||
};
|
||||
|
||||
private final HashMap<Messenger, NetworkFactoryInfo> mNetworkFactoryInfos =
|
||||
new HashMap<Messenger, NetworkFactoryInfo>();
|
||||
private final HashMap<NetworkRequest, NetworkRequestInfo> mNetworkRequests =
|
||||
|
||||
Reference in New Issue
Block a user