AOSP/Camera2 - Update language to comply with Android's inclusive language guidance. Changed blacklist to disallowedlist.

See https://source.android.com/setup/contribute/respectful-code for reference.

BUG=161896447

Test: manual - Tested the camera builds because there was no logic change.

$ make -j 40
$ make Camera2 -j
$ make Camera2Tests -j

$ ls -l out/target/product/bonito/product/app/Camera2/Camera2.apk out/target/product/bonito/testcases/Camera2Tests/arm64/Camera2Tests.apk
  -rw-r----- 1 rtenneti primarygroup 9739371 Jul 31 14:20 out/target/product/bonito/product/app/Camera2/Camera2.apk
  -rw-r----- 1 rtenneti primarygroup 2679496 Jul 31 14:22 out/target/product/bonito/testcases/Camera2Tests/arm64/Camera2Tests.apk

Change-Id: Ia22e43f9d457fc4b2897e69a206a52c0f841de64
diff --git a/src/com/android/camera/settings/PictureSizeLoader.java b/src/com/android/camera/settings/PictureSizeLoader.java
index 582d77f..2df3757 100644
--- a/src/com/android/camera/settings/PictureSizeLoader.java
+++ b/src/com/android/camera/settings/PictureSizeLoader.java
@@ -109,7 +109,7 @@
      * devices running Camera API 1.
      * <p>
      * We then calculate the resolutions that should be available and in the end
-     * filter it in case a resolution is on the blacklist for this device.
+     * filter it in case a resolution is on the disallowedlist for this device.
      */
     public PictureSizes computePictureSizes() {
         List<Size> backCameraSizes = computeSizesForCamera(SettingsUtil.CAMERA_FACING_BACK);
@@ -137,9 +137,9 @@
                 sizes = ResolutionUtil
                         .getDisplayableSizesFromSupported(sizes,
                                 facingSelector == SettingsUtil.CAMERA_FACING_BACK);
-                String blacklisted = GservicesHelper
-                        .getBlacklistedResolutionsBack(mContentResolver);
-                sizes = ResolutionUtil.filterBlackListedSizes(sizes, blacklisted);
+                String disallowedlisted = GservicesHelper
+                        .getDisallowedlistedResolutionsBack(mContentResolver);
+                sizes = ResolutionUtil.filterDisallowedListedSizes(sizes, disallowedlisted);
                 return sizes;
             }
         }
diff --git a/src/com/android/camera/settings/ResolutionSetting.java b/src/com/android/camera/settings/ResolutionSetting.java
index 50ee90c..a90bf66 100644
--- a/src/com/android/camera/settings/ResolutionSetting.java
+++ b/src/com/android/camera/settings/ResolutionSetting.java
@@ -43,8 +43,8 @@
 
     private final SettingsManager mSettingsManager;
     private final OneCameraManager mOneCameraManager;
-    private final String mResolutionBlackListBack;
-    private final String mResolutionBlackListFront;
+    private final String mResolutionDisallowedListBack;
+    private final String mResolutionDisallowedListFront;
 
     public ResolutionSetting(SettingsManager settingsManager,
             OneCameraManager oneCameraManager,
@@ -52,8 +52,10 @@
         mSettingsManager = settingsManager;
         mOneCameraManager = oneCameraManager;
 
-        mResolutionBlackListBack = GservicesHelper.getBlacklistedResolutionsBack(contentResolver);
-        mResolutionBlackListFront = GservicesHelper.getBlacklistedResolutionsFront(contentResolver);
+        mResolutionDisallowedListBack = GservicesHelper.getDisallowedlistedResolutionsBack(
+                contentResolver);
+        mResolutionDisallowedListFront = GservicesHelper.getDisallowedlistedResolutionsFront(
+                contentResolver);
     }
 
     /**
@@ -74,8 +76,8 @@
         // the choice for front camera.
         final String pictureSizeSettingKey = cameraFacing == OneCamera.Facing.FRONT ?
                 Keys.KEY_PICTURE_SIZE_FRONT : Keys.KEY_PICTURE_SIZE_BACK;
-        final String blacklist = cameraFacing == OneCamera.Facing.FRONT ? mResolutionBlackListFront
-                : mResolutionBlackListBack;
+        final String disallowedlist = cameraFacing == OneCamera.Facing.FRONT ?
+                mResolutionDisallowedListFront : mResolutionDisallowedListBack;
 
         // All resolutions supported by the camera.
         List<Size> supportedPictureSizes = cameraCharacteristics
@@ -88,8 +90,8 @@
                 supportedPictureSizes, cameraFacing == OneCamera.Facing.BACK);
 
         // Filter the remaining sizes through our backlist.
-        supportedPictureSizes = ResolutionUtil.filterBlackListedSizes(supportedPictureSizes,
-                blacklist);
+        supportedPictureSizes = ResolutionUtil.filterDisallowedListedSizes(supportedPictureSizes,
+                disallowedlist);
 
         final Size chosenPictureSize =
                 ResolutionUtil.getLargestPictureSize(aspectRatio, supportedPictureSizes);
@@ -102,7 +104,7 @@
     /**
      * Reads the picture size setting for the cameras with specified facing.
      * This specifically avoids reading camera characteristics unless the size
-     * is blacklisted or is not cached to prevent a crash.
+     * is disallowedlisted or is not cached to prevent a crash.
      */
     public Size getPictureSize(CameraId cameraId, Facing cameraFacing)
             throws OneCameraAccessException {
@@ -111,47 +113,48 @@
 
         Size pictureSize = null;
 
-        String blacklist = "";
+        String disallowedlist = "";
         if (cameraFacing == OneCamera.Facing.BACK) {
-            blacklist = mResolutionBlackListBack;
+            disallowedlist = mResolutionDisallowedListBack;
         } else if (cameraFacing == OneCamera.Facing.FRONT) {
-            blacklist = mResolutionBlackListFront;
+            disallowedlist = mResolutionDisallowedListFront;
         }
 
         // If there is no saved picture size preference or the saved on is
-        // blacklisted., pick a largest size with 4:3 aspect
+        // disallowedlisted., pick a largest size with 4:3 aspect
         boolean isPictureSizeSettingSet =
                 mSettingsManager.isSet(SettingsManager.SCOPE_GLOBAL, pictureSizeSettingKey);
-        boolean isPictureSizeBlacklisted = false;
+        boolean isPictureSizeDisallowedlisted = false;
 
-        // If a picture size is set, check whether it's blacklisted.
+        // If a picture size is set, check whether it's disallowedlisted.
         if (isPictureSizeSettingSet) {
             pictureSize = SettingsUtil.sizeFromSettingString(
                     mSettingsManager.getString(SettingsManager.SCOPE_GLOBAL,
                             pictureSizeSettingKey));
-            isPictureSizeBlacklisted = pictureSize == null ||
-                    ResolutionUtil.isBlackListed(pictureSize, blacklist);
+            isPictureSizeDisallowedlisted = pictureSize == null ||
+                    ResolutionUtil.isDisallowedListed(pictureSize, disallowedlist);
         }
 
         // Due to b/21758681, it is possible that an invalid picture size has
         // been saved to the settings. Therefore, picture size is set AND is not
-        // blacklisted, but completely invalid. In these cases, need to take the
+        // disallowedlisted, but completely invalid. In these cases, need to take the
         // fallback, instead of the saved value. This logic should now save a
         // valid picture size to the settings and self-correct the state of the
         // settings.
         final boolean isPictureSizeFromSettingsValid = pictureSize != null &&
                 pictureSize.width() > 0 && pictureSize.height() > 0;
 
-        if (!isPictureSizeSettingSet || isPictureSizeBlacklisted || !isPictureSizeFromSettingsValid) {
+        if (!isPictureSizeSettingSet || isPictureSizeDisallowedlisted ||
+                    !isPictureSizeFromSettingsValid) {
             final Rational aspectRatio = ResolutionUtil.ASPECT_RATIO_4x3;
 
             OneCameraCharacteristics cameraCharacteristics =
                     mOneCameraManager.getOneCameraCharacteristics(cameraId);
 
             final List<Size> supportedPictureSizes =
-                    ResolutionUtil.filterBlackListedSizes(
+                    ResolutionUtil.filterDisallowedListedSizes(
                             cameraCharacteristics.getSupportedPictureSizes(ImageFormat.JPEG),
-                            blacklist);
+                            disallowedlist);
             final Size fallbackPictureSize =
                     ResolutionUtil.getLargestPictureSize(aspectRatio, supportedPictureSizes);
             mSettingsManager.set(
diff --git a/src/com/android/camera/settings/ResolutionUtil.java b/src/com/android/camera/settings/ResolutionUtil.java
index 73586d0..632bce0 100644
--- a/src/com/android/camera/settings/ResolutionUtil.java
+++ b/src/com/android/camera/settings/ResolutionUtil.java
@@ -415,25 +415,27 @@
     }
 
     /**
-     * Takes selected sizes and a list of blacklisted sizes. All the blacklistes
+     * Takes selected sizes and a list of disallowedlisted sizes. All the disallowedlistes
      * sizes will be removed from the 'sizes' list.
      *
      * @param sizes the sizes to be filtered.
-     * @param blacklistString a String containing a comma-separated list of
+     * @param disallowedlistString a String containing a comma-separated list of
      *            sizes that should be removed from the original list.
      * @return A list that contains the filtered items.
      */
     @ParametersAreNonnullByDefault
-    public static List<Size> filterBlackListedSizes(List<Size> sizes, String blacklistString) {
-        String[] blacklistStringArray = blacklistString.split(",");
-        if (blacklistStringArray.length == 0) {
+    public static List<Size> filterDisallowedListedSizes(List<Size> sizes,
+            String disallowedlistString) {
+        String[] disallowedlistStringArray = disallowedlistString.split(",");
+        if (disallowedlistStringArray.length == 0) {
             return sizes;
         }
 
-        Set<String> blacklistedSizes = new HashSet(Lists.newArrayList(blacklistStringArray));
+        Set<String> disallowedlistedSizes = new HashSet(Lists.newArrayList(
+                disallowedlistStringArray));
         List<Size> newSizeList = new ArrayList<>();
         for (Size size : sizes) {
-            if (!isBlackListed(size, blacklistedSizes)) {
+            if (!isDisallowedListed(size, disallowedlistedSizes)) {
                 newSizeList.add(size);
             }
         }
@@ -441,24 +443,27 @@
     }
 
     /**
-     * Returns whether the given size is within the blacklist string.
+     * Returns whether the given size is within the disallowedlist string.
      *
      * @param size the size to check
-     * @param blacklistString a String containing a comma-separated list of
+     * @param disallowedlistString a String containing a comma-separated list of
      *            sizes that should not be available on the device.
-     * @return Whether the given size is blacklisted.
+     * @return Whether the given size is disallowedlisted.
      */
-    public static boolean isBlackListed(@Nonnull Size size, @Nonnull String blacklistString) {
-        String[] blacklistStringArray = blacklistString.split(",");
-        if (blacklistStringArray.length == 0) {
+    public static boolean isDisallowedListed(@Nonnull Size size,
+            @Nonnull String disallowedlistString) {
+        String[] disallowedlistStringArray = disallowedlistString.split(",");
+        if (disallowedlistStringArray.length == 0) {
             return false;
         }
-        Set<String> blacklistedSizes = new HashSet(Lists.newArrayList(blacklistStringArray));
-        return isBlackListed(size, blacklistedSizes);
+        Set<String> disallowedlistedSizes = new HashSet(Lists.newArrayList(
+                disallowedlistStringArray));
+        return isDisallowedListed(size, disallowedlistedSizes);
     }
 
-    private static boolean isBlackListed(@Nonnull Size size, @Nonnull Set<String> blacklistedSizes) {
+    private static boolean isDisallowedListed(@Nonnull Size size,
+            @Nonnull Set<String> disallowedlistedSizes) {
         String sizeStr = size.getWidth() + "x" + size.getHeight();
-        return blacklistedSizes.contains(sizeStr);
+        return disallowedlistedSizes.contains(sizeStr);
     }
 }
diff --git a/src_pd/com/android/camera/util/GservicesHelper.java b/src_pd/com/android/camera/util/GservicesHelper.java
index 12ae56a..f11580a 100644
--- a/src_pd/com/android/camera/util/GservicesHelper.java
+++ b/src_pd/com/android/camera/util/GservicesHelper.java
@@ -21,11 +21,11 @@
 
 public class GservicesHelper {
 
-    public static String getBlacklistedResolutionsBack(ContentResolver contentResolver) {
+    public static String getDisallowedlistedResolutionsBack(ContentResolver contentResolver) {
         return "";
     }
 
-    public static String getBlacklistedResolutionsFront(ContentResolver contentResolver) {
+    public static String getDisallowedlistedResolutionsFront(ContentResolver contentResolver) {
         return "";
     }