Revert "Revert "Update the UIDs only after the native network is created""
This reverts commit 13b96bc651.
Reason for revert:
- The reverted CL fixes a bootloop on Fi devices and must be submitted again for droidfood stability purposes.
- It's not clear whether the revert actually fixes the test that prompted it.
Change-Id: I68200501d1c587d1c6b3ad81053175c74961a440
This commit is contained in:
@@ -7043,7 +7043,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
||||
nai.notifyRegistered();
|
||||
NetworkInfo networkInfo = nai.networkInfo;
|
||||
updateNetworkInfo(nai, networkInfo);
|
||||
updateUids(nai, null, nai.networkCapabilities);
|
||||
updateVpnUids(nai, null, nai.networkCapabilities);
|
||||
}
|
||||
|
||||
private class NetworkOfferInfo implements IBinder.DeathRecipient {
|
||||
@@ -7679,7 +7679,8 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
||||
updateNetworkPermissions(nai, newNc);
|
||||
final NetworkCapabilities prevNc = nai.getAndSetNetworkCapabilities(newNc);
|
||||
|
||||
updateUids(nai, prevNc, newNc);
|
||||
updateVpnUids(nai, prevNc, newNc);
|
||||
updateAccessUids(nai, prevNc, newNc);
|
||||
nai.updateScoreForNetworkAgentUpdate();
|
||||
|
||||
if (nai.getCurrentScore() == oldScore && newNc.equalRequestableCapabilities(prevNc)) {
|
||||
@@ -7849,12 +7850,6 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
||||
}
|
||||
}
|
||||
|
||||
private void updateUids(@NonNull NetworkAgentInfo nai, @Nullable NetworkCapabilities prevNc,
|
||||
@Nullable NetworkCapabilities newNc) {
|
||||
updateVpnUids(nai, prevNc, newNc);
|
||||
updateAccessUids(nai, prevNc, newNc);
|
||||
}
|
||||
|
||||
private void updateVpnUids(@NonNull NetworkAgentInfo nai, @Nullable NetworkCapabilities prevNc,
|
||||
@Nullable NetworkCapabilities newNc) {
|
||||
Set<UidRange> prevRanges = null == prevNc ? null : prevNc.getUidRanges();
|
||||
@@ -7911,7 +7906,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// Never crash!
|
||||
loge("Exception in updateUids: ", e);
|
||||
loge("Exception in updateVpnUids: ", e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7950,6 +7945,9 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
||||
intsToUidRangeStableParcels(toRemove),
|
||||
PREFERENCE_ORDER_IRRELEVANT_BECAUSE_NOT_DEFAULT));
|
||||
}
|
||||
} catch (ServiceSpecificException e) {
|
||||
// Has the interface disappeared since the network was built ?
|
||||
Log.i(TAG, "Can't set access UIDs for network " + nai.network, e);
|
||||
} catch (RemoteException e) {
|
||||
// Netd died. This usually causes a runtime restart anyway.
|
||||
}
|
||||
@@ -8864,6 +8862,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
||||
}
|
||||
networkAgent.created = true;
|
||||
networkAgent.onNetworkCreated();
|
||||
updateAccessUids(networkAgent, null, networkAgent.networkCapabilities);
|
||||
}
|
||||
|
||||
if (!networkAgent.everConnected && state == NetworkInfo.State.CONNECTED) {
|
||||
@@ -8917,7 +8916,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
||||
} else if (state == NetworkInfo.State.DISCONNECTED) {
|
||||
networkAgent.disconnect();
|
||||
if (networkAgent.isVPN()) {
|
||||
updateUids(networkAgent, networkAgent.networkCapabilities, null);
|
||||
updateVpnUids(networkAgent, networkAgent.networkCapabilities, null);
|
||||
}
|
||||
disconnectAndDestroyNetwork(networkAgent);
|
||||
if (networkAgent.isVPN()) {
|
||||
|
||||
Reference in New Issue
Block a user