diff options
| author | 2023-08-22 01:15:38 +0000 | |
|---|---|---|
| committer | 2023-08-22 01:15:38 +0000 | |
| commit | 1ed59262c9e8d6f9eb5c8adfbe49142fe56c330f (patch) | |
| tree | e38362885ef806f32d94a2ef9f75ca9fe0b42ba3 | |
| parent | 1844a3100796bc6820718a73a37dd2faeb760c84 (diff) | |
| parent | 9d8de21a87fb67b6e40b84f160477184fcd6fdd3 (diff) | |
Merge "Update language to comply with Android's inclusive language guidance" into main am: 5842fcf9eb am: 84ea9c5e53 am: c07982cd9a am: 30f74148dc am: 9d8de21a87
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2718254
Change-Id: I198a944dbc469a618c654dd2a77d31ece334f723
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
3 files changed, 53 insertions, 53 deletions
diff --git a/services/core/java/com/android/server/net/NetworkPolicyLogger.java b/services/core/java/com/android/server/net/NetworkPolicyLogger.java index dc8fcb077f61..85731651dd59 100644 --- a/services/core/java/com/android/server/net/NetworkPolicyLogger.java +++ b/services/core/java/com/android/server/net/NetworkPolicyLogger.java @@ -338,8 +338,8 @@ public class NetworkPolicyLogger { return "App idle state of uid " + uid + ": " + idle; } - private static String getAppIdleWlChangedLog(int uid, boolean isWhitelisted) { - return "App idle whitelist state of uid " + uid + ": " + isWhitelisted; + private static String getAppIdleWlChangedLog(int uid, boolean isAllowlisted) { + return "App idle whitelist state of uid " + uid + ": " + isAllowlisted; } private static String getParoleStateChanged(boolean paroleOn) { @@ -519,14 +519,14 @@ public class NetworkPolicyLogger { data.timeStamp = System.currentTimeMillis(); } - public void appIdleWlChanged(int uid, boolean isWhitelisted) { + public void appIdleWlChanged(int uid, boolean isAllowlisted) { final Data data = getNextSlot(); if (data == null) return; data.reset(); data.type = EVENT_APP_IDLE_WL_CHANGED; data.ifield1 = uid; - data.bfield1 = isWhitelisted; + data.bfield1 = isAllowlisted; data.timeStamp = System.currentTimeMillis(); } diff --git a/services/core/java/com/android/server/net/NetworkPolicyManagerService.java b/services/core/java/com/android/server/net/NetworkPolicyManagerService.java index fb9bc017be0b..46e7041b8898 100644 --- a/services/core/java/com/android/server/net/NetworkPolicyManagerService.java +++ b/services/core/java/com/android/server/net/NetworkPolicyManagerService.java @@ -365,7 +365,7 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub { private static final String TAG_NETWORK_POLICY = "network-policy"; private static final String TAG_UID_POLICY = "uid-policy"; private static final String TAG_APP_POLICY = "app-policy"; - private static final String TAG_WHITELIST = "whitelist"; + private static final String TAG_ALLOWLIST = "whitelist"; private static final String TAG_RESTRICT_BACKGROUND = "restrict-background"; private static final String TAG_REVOKED_RESTRICT_BACKGROUND = "revoked-restrict-background"; private static final String TAG_XML_UTILS_INT_ARRAY = "int-array"; @@ -859,7 +859,7 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub { } @GuardedBy("mUidRulesFirstLock") - private void updatePowerSaveWhitelistUL() { + private void updatePowerSaveAllowlistUL() { int[] whitelist = mPowerWhitelistManager.getWhitelistedAppIds(/* includingIdle */ false); mPowerSaveWhitelistExceptIdleAppIds.clear(); for (int uid : whitelist) { @@ -950,7 +950,7 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub { synchronized (mUidRulesFirstLock) { synchronized (mNetworkPoliciesSecondLock) { - updatePowerSaveWhitelistUL(); + updatePowerSaveAllowlistUL(); mPowerManagerInternal = LocalServices.getService(PowerManagerInternal.class); mPowerManagerInternal.registerLowPowerModeObserver( new PowerManagerInternal.LowPowerModeListener() { @@ -1194,7 +1194,7 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub { public void onReceive(Context context, Intent intent) { // on background handler thread, and POWER_SAVE_WHITELIST_CHANGED is protected synchronized (mUidRulesFirstLock) { - updatePowerSaveWhitelistUL(); + updatePowerSaveAllowlistUL(); updateRulesForRestrictPowerUL(); updateRulesForAppIdleUL(); } @@ -2684,7 +2684,7 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub { } else { Slog.w(TAG, "unable to apply policy to UID " + uid + "; ignoring"); } - } else if (TAG_WHITELIST.equals(tag)) { + } else if (TAG_ALLOWLIST.equals(tag)) { insideAllowlist = true; } else if (TAG_RESTRICT_BACKGROUND.equals(tag) && insideAllowlist) { final int uid = readIntAttribute(in, ATTR_UID); @@ -2694,7 +2694,7 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub { mRestrictBackgroundAllowlistRevokedUids.put(uid, true); } } else if (type == END_TAG) { - if (TAG_WHITELIST.equals(tag)) { + if (TAG_ALLOWLIST.equals(tag)) { insideAllowlist = false; } @@ -2870,7 +2870,7 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub { out.endTag(null, TAG_POLICY_LIST); // write all allowlists - out.startTag(null, TAG_WHITELIST); + out.startTag(null, TAG_ALLOWLIST); // revoked restrict background allowlist int size = mRestrictBackgroundAllowlistRevokedUids.size(); @@ -2881,7 +2881,7 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub { out.endTag(null, TAG_REVOKED_RESTRICT_BACKGROUND); } - out.endTag(null, TAG_WHITELIST); + out.endTag(null, TAG_ALLOWLIST); out.endDocument(); @@ -4395,7 +4395,7 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub { void updateRulesForPowerSaveUL() { Trace.traceBegin(Trace.TRACE_TAG_NETWORK, "updateRulesForPowerSaveUL"); try { - updateRulesForWhitelistedPowerSaveUL(mRestrictPower, FIREWALL_CHAIN_POWERSAVE, + updateRulesForAllowlistedPowerSaveUL(mRestrictPower, FIREWALL_CHAIN_POWERSAVE, mUidFirewallPowerSaveRules); } finally { Trace.traceEnd(Trace.TRACE_TAG_NETWORK); @@ -4404,14 +4404,14 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub { @GuardedBy("mUidRulesFirstLock") void updateRuleForRestrictPowerUL(int uid) { - updateRulesForWhitelistedPowerSaveUL(uid, mRestrictPower, FIREWALL_CHAIN_POWERSAVE); + updateRulesForAllowlistedPowerSaveUL(uid, mRestrictPower, FIREWALL_CHAIN_POWERSAVE); } @GuardedBy("mUidRulesFirstLock") void updateRulesForDeviceIdleUL() { Trace.traceBegin(Trace.TRACE_TAG_NETWORK, "updateRulesForDeviceIdleUL"); try { - updateRulesForWhitelistedPowerSaveUL(mDeviceIdleMode, FIREWALL_CHAIN_DOZABLE, + updateRulesForAllowlistedPowerSaveUL(mDeviceIdleMode, FIREWALL_CHAIN_DOZABLE, mUidFirewallDozableRules); } finally { Trace.traceEnd(Trace.TRACE_TAG_NETWORK); @@ -4420,26 +4420,26 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub { @GuardedBy("mUidRulesFirstLock") void updateRuleForDeviceIdleUL(int uid) { - updateRulesForWhitelistedPowerSaveUL(uid, mDeviceIdleMode, FIREWALL_CHAIN_DOZABLE); + updateRulesForAllowlistedPowerSaveUL(uid, mDeviceIdleMode, FIREWALL_CHAIN_DOZABLE); } // NOTE: since both fw_dozable and fw_powersave uses the same map // (mPowerSaveTempWhitelistAppIds) for allowlisting, we can reuse their logic in this method. @GuardedBy("mUidRulesFirstLock") - private void updateRulesForWhitelistedPowerSaveUL(boolean enabled, int chain, + private void updateRulesForAllowlistedPowerSaveUL(boolean enabled, int chain, SparseIntArray rules) { if (enabled) { - // Sync the whitelists before enabling the chain. We don't care about the rules if + // Sync the allowlists before enabling the chain. We don't care about the rules if // we are disabling the chain. final SparseIntArray uidRules = rules; uidRules.clear(); final List<UserInfo> users = mUserManager.getUsers(); for (int ui = users.size() - 1; ui >= 0; ui--) { UserInfo user = users.get(ui); - updateRulesForWhitelistedAppIds(uidRules, mPowerSaveTempWhitelistAppIds, user.id); - updateRulesForWhitelistedAppIds(uidRules, mPowerSaveWhitelistAppIds, user.id); + updateRulesForAllowlistedAppIds(uidRules, mPowerSaveTempWhitelistAppIds, user.id); + updateRulesForAllowlistedAppIds(uidRules, mPowerSaveWhitelistAppIds, user.id); if (chain == FIREWALL_CHAIN_POWERSAVE) { - updateRulesForWhitelistedAppIds(uidRules, + updateRulesForAllowlistedAppIds(uidRules, mPowerSaveWhitelistExceptIdleAppIds, user.id); } } @@ -4454,7 +4454,7 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub { } } - private void updateRulesForWhitelistedAppIds(final SparseIntArray uidRules, + private void updateRulesForAllowlistedAppIds(final SparseIntArray uidRules, final SparseBooleanArray whitelistedAppIds, int userId) { for (int i = whitelistedAppIds.size() - 1; i >= 0; --i) { if (whitelistedAppIds.valueAt(i)) { @@ -4515,12 +4515,12 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub { * allowlisted. */ @GuardedBy("mUidRulesFirstLock") - private boolean isWhitelistedFromPowerSaveUL(int uid, boolean deviceIdleMode) { + private boolean isAllowlistedFromPowerSaveUL(int uid, boolean deviceIdleMode) { final int appId = UserHandle.getAppId(uid); boolean isWhitelisted = mPowerSaveTempWhitelistAppIds.get(appId) || mPowerSaveWhitelistAppIds.get(appId); if (!deviceIdleMode) { - isWhitelisted = isWhitelisted || isWhitelistedFromPowerSaveExceptIdleUL(uid); + isWhitelisted = isWhitelisted || isAllowlistedFromPowerSaveExceptIdleUL(uid); } return isWhitelisted; } @@ -4530,7 +4530,7 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub { * (eg: Battery Saver and app idle). */ @GuardedBy("mUidRulesFirstLock") - private boolean isWhitelistedFromPowerSaveExceptIdleUL(int uid) { + private boolean isAllowlistedFromPowerSaveExceptIdleUL(int uid) { final int appId = UserHandle.getAppId(uid); return mPowerSaveWhitelistExceptIdleAppIds.get(appId); } @@ -4546,9 +4546,9 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub { // NOTE: since both fw_dozable and fw_powersave uses the same map // (mPowerSaveTempWhitelistAppIds) for allowlisting, we can reuse their logic in this method. @GuardedBy("mUidRulesFirstLock") - private void updateRulesForWhitelistedPowerSaveUL(int uid, boolean enabled, int chain) { + private void updateRulesForAllowlistedPowerSaveUL(int uid, boolean enabled, int chain) { if (enabled) { - final boolean isWhitelisted = isWhitelistedFromPowerSaveUL(uid, + final boolean isWhitelisted = isAllowlistedFromPowerSaveUL(uid, chain == FIREWALL_CHAIN_DOZABLE); if (isWhitelisted || isUidForegroundOnRestrictPowerUL(uid)) { setUidFirewallRuleUL(chain, uid, FIREWALL_RULE_ALLOW); @@ -4806,7 +4806,7 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub { } @GuardedBy("mUidRulesFirstLock") - private void updateRulesForTempWhitelistChangeUL(int appId) { + private void updateRulesForTempAllowlistChangeUL(int appId) { final List<UserInfo> users = mUserManager.getUsers(); final int numUsers = users.size(); for (int i = 0; i < numUsers; i++) { @@ -5197,7 +5197,7 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub { final boolean isForeground = isUidForegroundOnRestrictPowerUL(uid); final boolean isTop = isUidTop(uid); - final boolean isWhitelisted = isWhitelistedFromPowerSaveUL(uid, mDeviceIdleMode); + final boolean isWhitelisted = isAllowlistedFromPowerSaveUL(uid, mDeviceIdleMode); final int oldEffectiveBlockedReasons; final int newEffectiveBlockedReasons; @@ -5220,9 +5220,9 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub { newAllowedReasons |= (isSystem(uid) ? ALLOWED_REASON_SYSTEM : 0); newAllowedReasons |= (isForeground ? ALLOWED_REASON_FOREGROUND : 0); newAllowedReasons |= (isTop ? ALLOWED_REASON_TOP : 0); - newAllowedReasons |= (isWhitelistedFromPowerSaveUL(uid, true) + newAllowedReasons |= (isAllowlistedFromPowerSaveUL(uid, true) ? ALLOWED_REASON_POWER_SAVE_ALLOWLIST : 0); - newAllowedReasons |= (isWhitelistedFromPowerSaveExceptIdleUL(uid) + newAllowedReasons |= (isAllowlistedFromPowerSaveExceptIdleUL(uid) ? ALLOWED_REASON_POWER_SAVE_EXCEPT_IDLE_ALLOWLIST : 0); newAllowedReasons |= (uidBlockedState.allowedReasons & ALLOWED_REASON_RESTRICTED_MODE_PERMISSIONS); @@ -6137,7 +6137,7 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub { } else { mPowerSaveTempWhitelistAppIds.delete(appId); } - updateRulesForTempWhitelistChangeUL(appId); + updateRulesForTempAllowlistChangeUL(appId); } } diff --git a/services/core/java/com/android/server/net/NetworkPolicyManagerShellCommand.java b/services/core/java/com/android/server/net/NetworkPolicyManagerShellCommand.java index 47bb8f009920..34c8a0d19e23 100644 --- a/services/core/java/com/android/server/net/NetworkPolicyManagerShellCommand.java +++ b/services/core/java/com/android/server/net/NetworkPolicyManagerShellCommand.java @@ -154,13 +154,13 @@ class NetworkPolicyManagerShellCommand extends ShellCommand { } switch(type) { case "app-idle-whitelist": - return listAppIdleWhitelist(); + return listAppIdleAllowlist(); case "wifi-networks": return listWifiNetworks(); case "restrict-background-whitelist": - return listRestrictBackgroundWhitelist(); + return listRestrictBackgroundAllowlist(); case "restrict-background-blacklist": - return listRestrictBackgroundBlacklist(); + return listRestrictBackgroundDenylist(); } pw.println("Error: unknown list type '" + type + "'"); return -1; @@ -175,11 +175,11 @@ class NetworkPolicyManagerShellCommand extends ShellCommand { } switch(type) { case "restrict-background-whitelist": - return addRestrictBackgroundWhitelist(); + return addRestrictBackgroundAllowlist(); case "restrict-background-blacklist": - return addRestrictBackgroundBlacklist(); + return addRestrictBackgroundDenylist(); case "app-idle-whitelist": - return addAppIdleWhitelist(); + return addAppIdleAllowlist(); } pw.println("Error: unknown add type '" + type + "'"); return -1; @@ -194,11 +194,11 @@ class NetworkPolicyManagerShellCommand extends ShellCommand { } switch(type) { case "restrict-background-whitelist": - return removeRestrictBackgroundWhitelist(); + return removeRestrictBackgroundAllowlist(); case "restrict-background-blacklist": - return removeRestrictBackgroundBlacklist(); + return removeRestrictBackgroundDenylist(); case "app-idle-whitelist": - return removeAppIdleWhitelist(); + return removeAppIdleAllowlist(); } pw.println("Error: unknown remove type '" + type + "'"); return -1; @@ -241,17 +241,17 @@ class NetworkPolicyManagerShellCommand extends ShellCommand { return 0; } - private int listRestrictBackgroundWhitelist() throws RemoteException { + private int listRestrictBackgroundAllowlist() throws RemoteException { return listUidPolicies("Restrict background whitelisted UIDs", POLICY_ALLOW_METERED_BACKGROUND); } - private int listRestrictBackgroundBlacklist() throws RemoteException { + private int listRestrictBackgroundDenylist() throws RemoteException { return listUidPolicies("Restrict background blacklisted UIDs", POLICY_REJECT_METERED_BACKGROUND); } - private int listAppIdleWhitelist() throws RemoteException { + private int listAppIdleAllowlist() throws RemoteException { final PrintWriter pw = getOutPrintWriter(); final int[] uids = mInterface.getAppIdleWhitelist(); return listUidList("App Idle whitelisted UIDs", uids); @@ -311,23 +311,23 @@ class NetworkPolicyManagerShellCommand extends ShellCommand { return 0; } - private int addRestrictBackgroundWhitelist() throws RemoteException { + private int addRestrictBackgroundAllowlist() throws RemoteException { return setUidPolicy(POLICY_ALLOW_METERED_BACKGROUND); } - private int removeRestrictBackgroundWhitelist() throws RemoteException { + private int removeRestrictBackgroundAllowlist() throws RemoteException { return resetUidPolicy("not whitelisted", POLICY_ALLOW_METERED_BACKGROUND); } - private int addRestrictBackgroundBlacklist() throws RemoteException { + private int addRestrictBackgroundDenylist() throws RemoteException { return setUidPolicy(POLICY_REJECT_METERED_BACKGROUND); } - private int removeRestrictBackgroundBlacklist() throws RemoteException { + private int removeRestrictBackgroundDenylist() throws RemoteException { return resetUidPolicy("not blacklisted", POLICY_REJECT_METERED_BACKGROUND); } - private int setAppIdleWhitelist(boolean isWhitelisted) { + private int setAppIdleAllowlist(boolean isWhitelisted) { final int uid = getUidFromNextArg(); if (uid < 0) { return uid; @@ -336,12 +336,12 @@ class NetworkPolicyManagerShellCommand extends ShellCommand { return 0; } - private int addAppIdleWhitelist() throws RemoteException { - return setAppIdleWhitelist(true); + private int addAppIdleAllowlist() throws RemoteException { + return setAppIdleAllowlist(true); } - private int removeAppIdleWhitelist() throws RemoteException { - return setAppIdleWhitelist(false); + private int removeAppIdleAllowlist() throws RemoteException { + return setAppIdleAllowlist(false); } private int listWifiNetworks() { |