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

Commit 33fc94d5 authored by Oliver Scott's avatar Oliver Scott Committed by Michael Bestas
Browse files

fixup! Insert added packages to restricted networking mode's allowlist

Only packages with INTERNET permission need allowlisting

Change-Id: I5c235d4fdfc849ca2b4df01bfc395ea1293c8432
parent 9880c403
Loading
Loading
Loading
Loading
+8 −4
Original line number Original line Diff line number Diff line
@@ -1146,10 +1146,14 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub {
                if (LOGV) Slog.v(TAG, "ACTION_PACKAGE_ADDED for uid=" + uid);
                if (LOGV) Slog.v(TAG, "ACTION_PACKAGE_ADDED for uid=" + uid);
                // Clear the cache for the app
                // Clear the cache for the app
                synchronized (mUidRulesFirstLock) {
                synchronized (mUidRulesFirstLock) {
                    if (hasInternetPermissionUL(uid)) {
                        Set<Integer> uids =
                        Set<Integer> uids =
                            ConnectivitySettingsManager.getUidsAllowedOnRestrictedNetworks(context);
                                ConnectivitySettingsManager.getUidsAllowedOnRestrictedNetworks(
                                        context);
                        uids.add(uid);
                        uids.add(uid);
                    ConnectivitySettingsManager.setUidsAllowedOnRestrictedNetworks(context, uids);
                        ConnectivitySettingsManager.setUidsAllowedOnRestrictedNetworks(context,
                                uids);
                    }
                    mInternetPermissionMap.delete(uid);
                    mInternetPermissionMap.delete(uid);
                    updateRestrictionRulesForUidUL(uid);
                    updateRestrictionRulesForUidUL(uid);
                }
                }