diff options
| author | 2023-08-18 22:34:26 +0000 | |
|---|---|---|
| committer | 2023-08-23 17:16:33 +0000 | |
| commit | 29b544d595f7367bff2956d71a3421657e5b4713 (patch) | |
| tree | 02521ffb8e1779b0295d4df0a66a8e008c69da6d | |
| parent | e1ee1aab9f99d05ca97dee3701afb894a6129446 (diff) | |
Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference
For this round, the fixes are only applied to the following to minimize breaking dependencies:
* comments (excluding javaDoc annotations)
* private constants
* private functions
* parameters within functions
BYPASS_INCLUSIVE_LANGUAGE_REASON=Just updating a few select inclusive language violations.
No-Typo-Check: Changes focused on inclusive language violations.
BUG: 295342157
Change-Id: I1fe31787cc020685f7bc736a217d867844dc6591
3 files changed, 28 insertions, 28 deletions
diff --git a/apct-tests/perftests/autofill/src/android/view/autofill/LoginTest.java b/apct-tests/perftests/autofill/src/android/view/autofill/LoginTest.java index a5d1e00139b5..59f08f645def 100644 --- a/apct-tests/perftests/autofill/src/android/view/autofill/LoginTest.java +++ b/apct-tests/perftests/autofill/src/android/view/autofill/LoginTest.java @@ -140,7 +140,7 @@ public class LoginTest extends AbstractAutofillPerfTestCase { state.resumeTiming(); } - // Sanity check + // Check for no errors callback.assertNoAsyncErrors(); } finally { mAfm.unregisterCallback(callback); @@ -190,7 +190,7 @@ public class LoginTest extends AbstractAutofillPerfTestCase { state.resumeTiming(); } - // Sanity check + // Check for no errors callback.assertNoAsyncErrors(); } finally { mAfm.unregisterCallback(callback); @@ -303,7 +303,7 @@ public class LoginTest extends AbstractAutofillPerfTestCase { callback.expectEvent(mPassword, EVENT_INPUT_SHOWN); } - // Sanity check + // Check for no errors callback.assertNoAsyncErrors(); } finally { mAfm.unregisterCallback(callback); diff --git a/apct-tests/perftests/multiuser/src/android/multiuser/UserLifecycleTests.java b/apct-tests/perftests/multiuser/src/android/multiuser/UserLifecycleTests.java index a44d93972ae1..4d24c8c42530 100644 --- a/apct-tests/perftests/multiuser/src/android/multiuser/UserLifecycleTests.java +++ b/apct-tests/perftests/multiuser/src/android/multiuser/UserLifecycleTests.java @@ -97,16 +97,16 @@ public class UserLifecycleTests { /** Name of users/profiles in the test. Users with this name may be freely removed. */ private static final String TEST_USER_NAME = "UserLifecycleTests_test_user"; - /** Name of dummy package used when timing how long app launches take. */ + /** Name of placeholder package used when timing how long app launches take. */ private static final String DUMMY_PACKAGE_NAME = "perftests.multiuser.apps.dummyapp"; - // Copy of UserSystemPackageInstaller whitelist mode constants. - private static final String PACKAGE_WHITELIST_MODE_PROP = + // Copy of UserSystemPackageInstaller allowlist mode constants. + private static final String PACKAGE_ALLOWLIST_MODE_PROP = "persist.debug.user.package_whitelist_mode"; - private static final int USER_TYPE_PACKAGE_WHITELIST_MODE_DISABLE = 0; - private static final int USER_TYPE_PACKAGE_WHITELIST_MODE_ENFORCE = 0b001; - private static final int USER_TYPE_PACKAGE_WHITELIST_MODE_IMPLICIT_WHITELIST = 0b100; - private static final int USER_TYPE_PACKAGE_WHITELIST_MODE_DEVICE_DEFAULT = -1; + private static final int USER_TYPE_PACKAGE_ALLOWLIST_MODE_DISABLE = 0; + private static final int USER_TYPE_PACKAGE_ALLOWLIST_MODE_ENFORCE = 0b001; + private static final int USER_TYPE_PACKAGE_ALLOWLIST_MODE_IMPLICIT_ALLOWLIST = 0b100; + private static final int USER_TYPE_PACKAGE_ALLOWLIST_MODE_DEVICE_DEFAULT = -1; private UserManager mUm; private ActivityManager mAm; @@ -563,13 +563,13 @@ public class UserLifecycleTests { } // TODO: This is just a POC. Do this properly and add more. - /** Tests starting (unlocking) a newly-created profile using the user-type-pkg-whitelist. */ + /** Tests starting (unlocking) a newly-created profile using the user-type-pkg-allowlist. */ @Test(timeout = TIMEOUT_MAX_TEST_TIME_MS) public void managedProfileUnlock_usingWhitelist() { assumeTrue(mHasManagedUserFeature); - final int origMode = getUserTypePackageWhitelistMode(); - setUserTypePackageWhitelistMode(USER_TYPE_PACKAGE_WHITELIST_MODE_ENFORCE - | USER_TYPE_PACKAGE_WHITELIST_MODE_IMPLICIT_WHITELIST); + final int origMode = getUserTypePackageAllowlistMode(); + setUserTypePackageAllowlistMode(USER_TYPE_PACKAGE_ALLOWLIST_MODE_ENFORCE + | USER_TYPE_PACKAGE_ALLOWLIST_MODE_IMPLICIT_ALLOWLIST); try { while (mRunner.keepRunning()) { @@ -586,15 +586,15 @@ public class UserLifecycleTests { mRunner.resumeTimingForNextIteration(); } } finally { - setUserTypePackageWhitelistMode(origMode); + setUserTypePackageAllowlistMode(origMode); } } - /** Tests starting (unlocking) a newly-created profile NOT using the user-type-pkg-whitelist. */ + /** Tests starting (unlocking) a newly-created profile NOT using the user-type-pkg-allowlist. */ @Test(timeout = TIMEOUT_MAX_TEST_TIME_MS) public void managedProfileUnlock_notUsingWhitelist() { assumeTrue(mHasManagedUserFeature); - final int origMode = getUserTypePackageWhitelistMode(); - setUserTypePackageWhitelistMode(USER_TYPE_PACKAGE_WHITELIST_MODE_DISABLE); + final int origMode = getUserTypePackageAllowlistMode(); + setUserTypePackageAllowlistMode(USER_TYPE_PACKAGE_ALLOWLIST_MODE_DISABLE); try { while (mRunner.keepRunning()) { @@ -611,7 +611,7 @@ public class UserLifecycleTests { mRunner.resumeTimingForNextIteration(); } } finally { - setUserTypePackageWhitelistMode(origMode); + setUserTypePackageAllowlistMode(origMode); } } @@ -822,17 +822,17 @@ public class UserLifecycleTests { attestTrue(errMsg, success); } - /** Gets the PACKAGE_WHITELIST_MODE_PROP System Property. */ - private int getUserTypePackageWhitelistMode() { - return SystemProperties.getInt(PACKAGE_WHITELIST_MODE_PROP, - USER_TYPE_PACKAGE_WHITELIST_MODE_DEVICE_DEFAULT); + /** Gets the PACKAGE_ALLOWLIST_MODE_PROP System Property. */ + private int getUserTypePackageAllowlistMode() { + return SystemProperties.getInt(PACKAGE_ALLOWLIST_MODE_PROP, + USER_TYPE_PACKAGE_ALLOWLIST_MODE_DEVICE_DEFAULT); } - /** Sets the PACKAGE_WHITELIST_MODE_PROP System Property to the given value. */ - private void setUserTypePackageWhitelistMode(int mode) { + /** Sets the PACKAGE_ALLOWLIST_MODE_PROP System Property to the given value. */ + private void setUserTypePackageAllowlistMode(int mode) { String result = ShellHelper.runShellCommand( - String.format("setprop %s %d", PACKAGE_WHITELIST_MODE_PROP, mode)); - attestFalse("Failed to set sysprop " + PACKAGE_WHITELIST_MODE_PROP + ": " + result, + String.format("setprop %s %d", PACKAGE_ALLOWLIST_MODE_PROP, mode)); + attestFalse("Failed to set sysprop " + PACKAGE_ALLOWLIST_MODE_PROP + ": " + result, result != null && result.contains("Failed")); } diff --git a/apct-tests/perftests/windowmanager/src/android/wm/RelayoutPerfTest.java b/apct-tests/perftests/windowmanager/src/android/wm/RelayoutPerfTest.java index fb62920681de..9e29820706c7 100644 --- a/apct-tests/perftests/windowmanager/src/android/wm/RelayoutPerfTest.java +++ b/apct-tests/perftests/windowmanager/src/android/wm/RelayoutPerfTest.java @@ -111,7 +111,7 @@ public class RelayoutPerfTest extends WindowManagerPerfTestBase stopProfiling(); } - /** A dummy view to get IWindow. */ + /** A placeholder view to get IWindow. */ private static class ContentView extends LinearLayout { ContentView(Context context) { super(context); |