Merge SP2A.220405.004 to aosp-master - DO NOT MERGE

Merged-In: I5e11fdec669da196c60acdebf0bb40404d85f03c
Merged-In: I04152035d96dfaffd745acca04f46b124fd14b88
Change-Id: I243228b419a69d8edf753f77737322f15842e47f
diff --git a/res/values-bs/strings.xml b/res/values-bs/strings.xml
index f3838af..9f96b11 100644
--- a/res/values-bs/strings.xml
+++ b/res/values-bs/strings.xml
@@ -44,7 +44,7 @@
     <string name="daily_refresh_tile_title" msgid="3270456074558525091">"Dnevna pozadinska slika"</string>
     <string name="daily_refresh_tile_subtitle" msgid="3976682014885446443">"Dodirnite da uključite"</string>
     <string name="start_rotation_dialog_body_live_wallpaper_needed" msgid="5132580257563846082">"Pozadinska slika će se automatski mijenjati svakodnevno. Da završite postavljanje, na sljedećem ekranu dodirnite &lt;strong&gt;Postavi pozadinsku sliku&lt;/strong&gt;."</string>
-    <string name="start_rotation_dialog_wifi_only_option_message" msgid="3126269859713666225">"Preuzimaj nove pozadinske slike samo putem WiFi mreže"</string>
+    <string name="start_rotation_dialog_wifi_only_option_message" msgid="3126269859713666225">"Preuzimaj nove pozadinske slike samo putem WiFi-ja"</string>
     <string name="start_rotation_dialog_continue" msgid="276678987852274872">"Nastavi"</string>
     <string name="start_rotation_progress_message" msgid="7872623873682262083">"Preuzimanje prve pozadinske slike…"</string>
     <string name="start_rotation_error_message" msgid="3053799836719618972">"Nije moguće preuzeti prvu pozadinsku sliku. Provjerite postavke mreže i pokušajte ponovo."</string>
diff --git a/res/values-eu/strings.xml b/res/values-eu/strings.xml
index d38396c..f325648 100644
--- a/res/values-eu/strings.xml
+++ b/res/values-eu/strings.xml
@@ -44,7 +44,7 @@
     <string name="daily_refresh_tile_title" msgid="3270456074558525091">"Eguneko horma-papera"</string>
     <string name="daily_refresh_tile_subtitle" msgid="3976682014885446443">"Sakatu aktibatzeko"</string>
     <string name="start_rotation_dialog_body_live_wallpaper_needed" msgid="5132580257563846082">"Horma-papera automatikoki aldatuko da egunero. Konfiguratzen amaitzeko, hurrengo pantailan, sakatu &lt;strong&gt;Ezarri horma-papera&lt;/strong&gt;."</string>
-    <string name="start_rotation_dialog_wifi_only_option_message" msgid="3126269859713666225">"Aurrerantzean, deskargatu Wi-Fi bidez soilik horma-paperak"</string>
+    <string name="start_rotation_dialog_wifi_only_option_message" msgid="3126269859713666225">"Aurrerantzean, deskargatu wifi bidez soilik horma-paperak"</string>
     <string name="start_rotation_dialog_continue" msgid="276678987852274872">"Egin aurrera"</string>
     <string name="start_rotation_progress_message" msgid="7872623873682262083">"Lehen horma-papera deskargatzen…"</string>
     <string name="start_rotation_error_message" msgid="3053799836719618972">"Ezin da deskargatu lehen horma-papera. Egiaztatu sarearen ezarpenak zuzenak direla eta saiatu berriro."</string>
diff --git a/res/values-fa/strings.xml b/res/values-fa/strings.xml
index e021916..04c934c 100644
--- a/res/values-fa/strings.xml
+++ b/res/values-fa/strings.xml
@@ -64,8 +64,8 @@
     <string name="explore_lock_screen" msgid="268938342103703665">"کاوش کاغذ‌دیواری صفحه در حالت قفل"</string>
     <string name="refresh_daily_wallpaper_home_content_description" msgid="2770445044556164259">"بازخوانی کاغذدیواری روزانه در صفحه اصلی"</string>
     <string name="refresh_daily_wallpaper_content_description" msgid="4362142658237147583">"بازخوانی کاغذدیواری روزانه"</string>
-    <string name="refreshing_daily_wallpaper_dialog_message" msgid="1975910873362855761">"درحال بازخوانی کاغذدیواری روزانه…"</string>
-    <string name="refresh_daily_wallpaper_failed_message" msgid="4749879993812557166">"کاغذدیواری روزانه بازخوانی نشد. لطفاً اتصال شبکه‌تان را بررسی و دوباره امتحان کنید."</string>
+    <string name="refreshing_daily_wallpaper_dialog_message" msgid="1975910873362855761">"درحال بازآوری کاغذدیواری روزانه…"</string>
+    <string name="refresh_daily_wallpaper_failed_message" msgid="4749879993812557166">"کاغذدیواری روزانه بازآوری نشد. لطفاً اتصال شبکه‌تان را بررسی و دوباره امتحان کنید."</string>
     <string name="on_device_wallpapers_category_title" msgid="805819102071369004">"کاغذدیواری‌های موجود در دستگاه"</string>
     <string name="on_device_wallpapers_category_title_desktop" msgid="316919420410065369">"در دستگاه"</string>
     <string name="on_device_wallpaper_title" msgid="5262564748034629524">"‏کاغذ‌دیواری Android"</string>
diff --git a/res/values-iw/strings.xml b/res/values-iw/strings.xml
index 4a90e8e..c2f9576 100644
--- a/res/values-iw/strings.xml
+++ b/res/values-iw/strings.xml
@@ -98,7 +98,7 @@
     <string name="hint_hide_ui_preview" msgid="4527603797714586070">"הממשק מוסתר בתצוגה. לוחצים פעמיים לביטול ההסתרה"</string>
     <string name="show_ui_preview_text" msgid="5993063062417070806">"עם תצוגה מקדימה בממשק המשתמש"</string>
     <string name="hint_show_ui_preview" msgid="2744155435325318349">"הממשק מוצג בתצוגה. לוחצים פעמיים לביטול ההסתרה"</string>
-    <string name="wallpaper_picker_entry_title" msgid="5185793991582084891">"שינוי הטפט"</string>
+    <string name="wallpaper_picker_entry_title" msgid="5185793991582084891">"החלפת הטפט"</string>
     <string name="lockscreen_wallpaper_preview_card_content_description" msgid="2244890820627302245">"תצוגה מקדימה של הטפט במסך הנעילה"</string>
     <string name="apply_btn" msgid="5764555565943538528">"אישור"</string>
     <string name="accessibility_customize_hidden" msgid="6320568529768181691">"חלונית ההתאמה אישית מוסתרת"</string>
diff --git a/src/com/android/wallpaper/asset/ExifInterfaceCompat.java b/src/com/android/wallpaper/asset/ExifInterfaceCompat.java
index 6b2938e..30e2a44 100644
--- a/src/com/android/wallpaper/asset/ExifInterfaceCompat.java
+++ b/src/com/android/wallpaper/asset/ExifInterfaceCompat.java
@@ -1,12 +1,12 @@
 package com.android.wallpaper.asset;
 
-import com.android.wallpaper.compat.BuildCompat;
+import android.os.Build;
+
+import androidx.exifinterface.media.ExifInterface;
 
 import java.io.IOException;
 import java.io.InputStream;
 
-import androidx.exifinterface.media.ExifInterface;
-
 /**
  * Provides access to basic ExifInterface APIs using {@link android.media.ExifInterface} in OMR1+
  * SDK or SupportLibrary's {@link ExifInterface} for earlier SDK versions.
@@ -29,7 +29,7 @@
     public ExifInterfaceCompat(InputStream inputStream) throws IOException {
         // O-MR1 added support for more formats (HEIF), which Support Library cannot implement,
         // so use the framework version for SDK 27+
-        if (BuildCompat.isAtLeastOMR1()) {
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1) {
             mFrameworkExifInterface = new android.media.ExifInterface(inputStream);
         } else {
             mSupportExifInterface = new ExifInterface(inputStream);
diff --git a/src/com/android/wallpaper/backup/MissingHashCodeGenerator.java b/src/com/android/wallpaper/backup/MissingHashCodeGenerator.java
index f934fe7..0c16572 100755
--- a/src/com/android/wallpaper/backup/MissingHashCodeGenerator.java
+++ b/src/com/android/wallpaper/backup/MissingHashCodeGenerator.java
@@ -20,8 +20,8 @@
 import android.content.BroadcastReceiver;
 import android.content.Context;
 import android.content.Intent;
+import android.os.Build;
 
-import com.android.wallpaper.compat.BuildCompat;
 import com.android.wallpaper.module.Injector;
 import com.android.wallpaper.module.InjectorProvider;
 import com.android.wallpaper.module.WallpaperPreferences;
@@ -42,7 +42,7 @@
         // This receiver is a no-op on pre-N Android and should only respond to a MY_PACKAGE_REPLACED
         // intent.
         if (!intent.getAction().equals(Intent.ACTION_MY_PACKAGE_REPLACED)
-                || !BuildCompat.isAtLeastN()) {
+                || Build.VERSION.SDK_INT < Build.VERSION_CODES.N) {
             return;
         }
 
diff --git a/src/com/android/wallpaper/compat/BuildCompat.java b/src/com/android/wallpaper/compat/BuildCompat.java
deleted file mode 100755
index fd1a1c5..0000000
--- a/src/com/android/wallpaper/compat/BuildCompat.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.wallpaper.compat;
-
-import android.os.Build;
-import android.os.Build.VERSION;
-import android.os.Build.VERSION_CODES;
-
-/**
- * Provides the SDK version in a manner that can be stubbed out in a test environment.
- */
-public class BuildCompat {
-    public static final int JB_MR2_SDK_VERSION = VERSION_CODES.JELLY_BEAN_MR2;
-    public static final int L_SDK_VERSION = VERSION_CODES.LOLLIPOP;
-    public static final int N_SDK_VERSION = Build.VERSION_CODES.N;
-    public static final int N_MR1_SDK_VERSION = Build.VERSION_CODES.N_MR1;
-
-    private static int sSdk = Build.VERSION.SDK_INT;
-
-    /**
-     * Returns whether the framework on the current Android device is JellyBean MR2 (API 18) or
-     * higher. Used to determine if it's safe to use APIs added in that API version such as
-     * HandlerThread#quitSafely.
-     */
-    public static boolean isAtLeastJBMR2() {
-        return sSdk >= JB_MR2_SDK_VERSION;
-    }
-
-    /**
-     * Returns whether the framework on the current Android device is L (API 21) or higher. Used to
-     * determine whether framework classes introduced in L such as JobScheduler can be used on this
-     * device.
-     */
-    public static boolean isAtLeastL() {
-        return sSdk >= L_SDK_VERSION;
-    }
-
-    /**
-     * Returns whether the framework on the current Android device is N or higher. Used to determine
-     * whether new N-specific wallpaper APIs are available.
-     */
-    public static boolean isAtLeastN() {
-        return sSdk >= N_SDK_VERSION;
-    }
-
-    /**
-     * Returns whether the framework on the current Android device is N-MR1 or higher. Used to
-     * determine whether new N-MR1-specific wallpaper APIs are available.
-     */
-    public static boolean isAtLeastNMR1() {
-        return sSdk >= N_MR1_SDK_VERSION;
-    }
-
-    /**
-     * Returns whether the framework on the current Android device is N-MR2 or higher. Used to
-     * determine if new N-MR2 specific API behavior is present on the device.
-     */
-    public static boolean isAtLeastNMR2() {
-        return sSdk > N_MR1_SDK_VERSION
-                || (sSdk == N_MR1_SDK_VERSION && VERSION.RELEASE.equals("7.1.2"));
-    }
-
-    /**
-     * Returns whether the framework on the current Android device is O or higher.
-     */
-    public static boolean isAtLeastO() {
-        return sSdk >= Build.VERSION_CODES.O;
-    }
-
-    /**
-     * Returns whether the framework on the current Android device is O-MR1 or higher.
-     */
-    public static boolean isAtLeastOMR1() {
-        return sSdk >= VERSION_CODES.O_MR1;
-    }
-
-    /**
-     * Sets the SDK version that BuildCompat will consider the current device to be on. Used for
-     * testing only.
-     */
-    public static void setSdkVersionForTesting(int sdk) {
-        sSdk = sdk;
-    }
-
-    public static boolean isAtLeastQ() {
-        return sSdk >= VERSION_CODES.Q;
-    }
-
-    /**
-     * Returns whether the framework on the current Android device is S or higher.
-     */
-    public static boolean isAtLeastS() {
-        return sSdk >= VERSION_CODES.S
-                || "S".equals(VERSION.CODENAME); // TODO: remove once build version for S is updated
-    }
-}
diff --git a/src/com/android/wallpaper/compat/WallpaperManagerCompat.java b/src/com/android/wallpaper/compat/WallpaperManagerCompat.java
index ef834a1..c0b6a9e 100755
--- a/src/com/android/wallpaper/compat/WallpaperManagerCompat.java
+++ b/src/com/android/wallpaper/compat/WallpaperManagerCompat.java
@@ -20,13 +20,14 @@
 import android.graphics.Bitmap;
 import android.graphics.Rect;
 import android.graphics.drawable.Drawable;
+import android.os.Build;
 import android.os.ParcelFileDescriptor;
 
+import androidx.annotation.IntDef;
+
 import java.io.IOException;
 import java.io.InputStream;
 
-import androidx.annotation.IntDef;
-
 /**
  * An abstraction over WallpaperManager to allow for the transitional state in which the N SDK
  * is not yet ready but we need to use new N API methods. Provides wrapper methods for the new
@@ -41,7 +42,7 @@
     public static WallpaperManagerCompat getInstance(Context context) {
         synchronized (sInstanceLock) {
             if (sInstance == null) {
-                if (BuildCompat.isAtLeastN()) {
+                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
                     sInstance = new WallpaperManagerCompatVN(context.getApplicationContext());
                 } else {
                     sInstance = new WallpaperManagerCompatV16(context.getApplicationContext());
diff --git a/src/com/android/wallpaper/model/LiveWallpaperInfo.java b/src/com/android/wallpaper/model/LiveWallpaperInfo.java
index dd9537c..7b215b5 100755
--- a/src/com/android/wallpaper/model/LiveWallpaperInfo.java
+++ b/src/com/android/wallpaper/model/LiveWallpaperInfo.java
@@ -24,6 +24,7 @@
 import android.content.pm.ResolveInfo;
 import android.content.res.Resources;
 import android.net.Uri;
+import android.os.Build;
 import android.os.Parcel;
 import android.service.wallpaper.WallpaperService;
 import android.text.TextUtils;
@@ -35,7 +36,6 @@
 import com.android.wallpaper.R;
 import com.android.wallpaper.asset.Asset;
 import com.android.wallpaper.asset.LiveWallpaperThumbAsset;
-import com.android.wallpaper.compat.BuildCompat;
 import com.android.wallpaper.module.InjectorProvider;
 import com.android.wallpaper.module.LiveWallpaperInfoFactory;
 import com.android.wallpaper.util.ActivityUtils;
@@ -369,7 +369,7 @@
 
     @Override
     public String getActionUrl(Context context) {
-        if (BuildCompat.isAtLeastNMR1()) {
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) {
             try {
                 Uri wallpaperContextUri = mInfo.loadContextUri(context.getPackageManager());
                 if (wallpaperContextUri != null) {
diff --git a/src/com/android/wallpaper/module/DefaultWallpaperPersister.java b/src/com/android/wallpaper/module/DefaultWallpaperPersister.java
index 6dd4bf6..43130c4 100755
--- a/src/com/android/wallpaper/module/DefaultWallpaperPersister.java
+++ b/src/com/android/wallpaper/module/DefaultWallpaperPersister.java
@@ -29,6 +29,7 @@
 import android.graphics.Rect;
 import android.graphics.drawable.BitmapDrawable;
 import android.os.AsyncTask;
+import android.os.Build;
 import android.os.ParcelFileDescriptor;
 import android.text.TextUtils;
 import android.util.Log;
@@ -43,7 +44,6 @@
 import com.android.wallpaper.asset.BitmapUtils;
 import com.android.wallpaper.asset.StreamableAsset;
 import com.android.wallpaper.asset.StreamableAsset.StreamReceiver;
-import com.android.wallpaper.compat.BuildCompat;
 import com.android.wallpaper.compat.WallpaperManagerCompat;
 import com.android.wallpaper.model.WallpaperInfo;
 import com.android.wallpaper.module.BitmapCropper.Callback;
@@ -701,7 +701,7 @@
                         && mWallpaperPreferences.getWallpaperPresentationMode()
                         == WallpaperPreferences.PRESENTATION_MODE_ROTATING
                         && !wasLockWallpaperSet
-                        && BuildCompat.isAtLeastN()) {
+                        && Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
                     copyRotatingWallpaperToLock();
                 }
                 setImageWallpaperMetadata(mDestination, wallpaperId);
@@ -791,7 +791,7 @@
         }
 
         private void setImageWallpaperHomeMetadata(int homeWallpaperId) {
-            if (BuildCompat.isAtLeastN()) {
+            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
                 mWallpaperPreferences.setHomeWallpaperManagerId(homeWallpaperId);
             }
 
diff --git a/src/com/android/wallpaper/module/DefaultWallpaperRefresher.java b/src/com/android/wallpaper/module/DefaultWallpaperRefresher.java
index 246b017..3363d8e 100755
--- a/src/com/android/wallpaper/module/DefaultWallpaperRefresher.java
+++ b/src/com/android/wallpaper/module/DefaultWallpaperRefresher.java
@@ -22,12 +22,12 @@
 import android.graphics.BitmapFactory;
 import android.graphics.drawable.BitmapDrawable;
 import android.os.AsyncTask;
+import android.os.Build;
 import android.os.ParcelFileDescriptor;
 import android.util.Log;
 
 import com.android.wallpaper.R;
 import com.android.wallpaper.asset.BitmapUtils;
-import com.android.wallpaper.compat.BuildCompat;
 import com.android.wallpaper.compat.WallpaperManagerCompat;
 import com.android.wallpaper.model.WallpaperMetadata;
 
@@ -103,7 +103,9 @@
             boolean isLockScreenWallpaperCurrentlySet = mWallpaperStatusChecker.isLockWallpaperSet(
                     mAppContext);
 
-            if (!BuildCompat.isAtLeastN() || !isLockScreenWallpaperCurrentlySet) {
+            if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N
+                    || !isLockScreenWallpaperCurrentlySet) {
+
                 // Return only home metadata if pre-N device or lock screen wallpaper is not explicitly set.
                 wallpaperMetadatas.add(new WallpaperMetadata(
                         mWallpaperPreferences.getHomeWallpaperAttributions(),
@@ -166,7 +168,7 @@
                         Arrays.asList(mAppContext.getResources().getString(R.string.fallback_wallpaper_title)));
 
                 // Set wallpaper ID if at least N or set a hash code if an earlier version of Android.
-                if (BuildCompat.isAtLeastN()) {
+                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
                     mWallpaperPreferences.setHomeWallpaperManagerId(mWallpaperManagerCompat.getWallpaperId(
                             WallpaperManagerCompat.FLAG_SYSTEM));
                 } else {
@@ -279,7 +281,7 @@
             // Use WallpaperManager IDs to check same-ness of image wallpaper on N+ versions of Android
             // only when there is no saved bitmap hash code (which could be leftover from a previous build
             // of the app that did not use wallpaper IDs).
-            if (BuildCompat.isAtLeastN() && savedBitmapHash == 0) {
+            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N && savedBitmapHash == 0) {
                 return mWallpaperPreferences.getHomeWallpaperManagerId()
                         == mWallpaperManagerCompat.getWallpaperId(WallpaperManagerCompat.FLAG_SYSTEM);
             }
diff --git a/src/com/android/wallpaper/module/RotationWallpaperUpdateReceiver.java b/src/com/android/wallpaper/module/RotationWallpaperUpdateReceiver.java
index 4fbc20d..c372d25 100644
--- a/src/com/android/wallpaper/module/RotationWallpaperUpdateReceiver.java
+++ b/src/com/android/wallpaper/module/RotationWallpaperUpdateReceiver.java
@@ -20,8 +20,8 @@
 import android.content.Intent;
 import android.graphics.Bitmap;
 import android.graphics.BitmapFactory;
+import android.os.Build;
 
-import com.android.wallpaper.compat.BuildCompat;
 import com.android.wallpaper.util.DiskBasedLogger;
 import com.android.wallpaper.util.FileMover;
 
@@ -46,7 +46,7 @@
         if (intent.getAction() == null
                 || !(intent.getAction().equals(Intent.ACTION_MY_PACKAGE_REPLACED)
                 || intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED))
-                || !BuildCompat.isAtLeastN()) {
+                || Build.VERSION.SDK_INT < Build.VERSION_CODES.N) {
             DiskBasedLogger.e(
                     TAG,
                     "Unexpected action or Android version!",
diff --git a/src/com/android/wallpaper/picker/LivePreviewFragment.java b/src/com/android/wallpaper/picker/LivePreviewFragment.java
index d32e3a2..8ff112d 100644
--- a/src/com/android/wallpaper/picker/LivePreviewFragment.java
+++ b/src/com/android/wallpaper/picker/LivePreviewFragment.java
@@ -39,6 +39,7 @@
 import android.content.pm.ServiceInfo;
 import android.graphics.Point;
 import android.net.Uri;
+import android.os.Build;
 import android.os.Bundle;
 import android.os.RemoteException;
 import android.service.wallpaper.IWallpaperConnection;
@@ -64,7 +65,6 @@
 import androidx.slice.widget.SliceView;
 
 import com.android.wallpaper.R;
-import com.android.wallpaper.compat.BuildCompat;
 import com.android.wallpaper.model.SetWallpaperViewModel;
 import com.android.wallpaper.util.FullScreenAnimation;
 import com.android.wallpaper.util.ResourceUtils;
@@ -448,7 +448,7 @@
 
     @SuppressLint("NewApi") //Already checking with isAtLeastQ
     protected Uri getSettingsSliceUri(android.app.WallpaperInfo info) {
-        if (BuildCompat.isAtLeastQ()) {
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
             return info.getSettingsSliceUri();
         }
         return null;
diff --git a/src/com/android/wallpaper/picker/TopLevelPickerActivity.java b/src/com/android/wallpaper/picker/TopLevelPickerActivity.java
index 390daf3..191a39f 100755
--- a/src/com/android/wallpaper/picker/TopLevelPickerActivity.java
+++ b/src/com/android/wallpaper/picker/TopLevelPickerActivity.java
@@ -48,7 +48,6 @@
 
 import com.android.wallpaper.R;
 import com.android.wallpaper.asset.Asset;
-import com.android.wallpaper.compat.BuildCompat;
 import com.android.wallpaper.compat.ButtonDrawableSetterCompat;
 import com.android.wallpaper.config.Flags;
 import com.android.wallpaper.model.Category;
@@ -275,7 +274,7 @@
                     view.getPaddingRight(), view.getPaddingBottom());
             // Consume only the top inset (status bar), to let other content in the Activity consume
             // the nav bar (ie, by using "fitSystemWindows")
-            if (BuildCompat.isAtLeastQ()) {
+            if (VERSION.SDK_INT >= VERSION_CODES.Q) {
                 WindowInsets.Builder builder = new WindowInsets.Builder(windowInsets);
                 builder.setSystemWindowInsets(Insets.of(windowInsets.getSystemWindowInsetLeft(),
                         0, windowInsets.getStableInsetRight(),
diff --git a/src/com/android/wallpaper/util/DiskBasedLogger.java b/src/com/android/wallpaper/util/DiskBasedLogger.java
index 5111376..350aaff 100755
--- a/src/com/android/wallpaper/util/DiskBasedLogger.java
+++ b/src/com/android/wallpaper/util/DiskBasedLogger.java
@@ -24,7 +24,8 @@
 import android.os.Process;
 import android.util.Log;
 
-import com.android.wallpaper.compat.BuildCompat;
+import androidx.annotation.Nullable;
+import androidx.annotation.VisibleForTesting;
 
 import java.io.BufferedReader;
 import java.io.Closeable;
@@ -41,9 +42,6 @@
 import java.util.Locale;
 import java.util.concurrent.TimeUnit;
 
-import androidx.annotation.Nullable;
-import androidx.annotation.VisibleForTesting;
-
 /**
  * Logs messages to logcat and for debuggable build types ("eng" or "userdebug") also mirrors logs
  * to a disk-based log buffer.
@@ -72,7 +70,8 @@
             if (sLoggerThread != null && sLoggerThread.isAlive()) {
 
                 // HandlerThread#quitSafely was added in JB-MR2, so prefer to use that instead of #quit.
-                boolean isQuitSuccessful = BuildCompat.isAtLeastJBMR2()
+                boolean isQuitSuccessful =
+                        Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2
                         ? sLoggerThread.quitSafely()
                         : sLoggerThread.quit();
 
diff --git a/tests/src/com/android/wallpaper/testing/TestCurrentWallpaperInfoFactory.java b/tests/src/com/android/wallpaper/testing/TestCurrentWallpaperInfoFactory.java
index 3e8c665..63cdf29 100644
--- a/tests/src/com/android/wallpaper/testing/TestCurrentWallpaperInfoFactory.java
+++ b/tests/src/com/android/wallpaper/testing/TestCurrentWallpaperInfoFactory.java
@@ -16,8 +16,8 @@
 package com.android.wallpaper.testing;
 
 import android.content.Context;
+import android.os.Build;
 
-import com.android.wallpaper.compat.BuildCompat;
 import com.android.wallpaper.model.WallpaperInfo;
 import com.android.wallpaper.module.CurrentWallpaperInfoFactory;
 import com.android.wallpaper.module.InjectorProvider;
@@ -48,7 +48,7 @@
                     homeWallpaperMetadata.getCollectionId());
 
             WallpaperInfo lockWallpaper = null;
-            if (lockWallpaperMetadata != null && BuildCompat.isAtLeastN()) {
+            if (lockWallpaperMetadata != null && Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
                 lockWallpaper = createTestWallpaperInfo(
                         lockWallpaperMetadata.getAttributions(),
                         lockWallpaperMetadata.getActionUrl(),
diff --git a/tests/src/com/android/wallpaper/testing/TestWallpaperRefresher.java b/tests/src/com/android/wallpaper/testing/TestWallpaperRefresher.java
index 97961fe..558c3cb 100644
--- a/tests/src/com/android/wallpaper/testing/TestWallpaperRefresher.java
+++ b/tests/src/com/android/wallpaper/testing/TestWallpaperRefresher.java
@@ -18,8 +18,8 @@
 
 import android.app.WallpaperManager;
 import android.content.Context;
+import android.os.Build;
 
-import com.android.wallpaper.compat.BuildCompat;
 import com.android.wallpaper.model.WallpaperMetadata;
 import com.android.wallpaper.module.InjectorProvider;
 import com.android.wallpaper.module.WallpaperPreferences;
@@ -45,7 +45,7 @@
 
         WallpaperPreferences prefs = InjectorProvider.getInjector().getPreferences(mAppContext);
 
-        if (BuildCompat.isAtLeastN() && prefs.getLockWallpaperId() > 0) {
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N && prefs.getLockWallpaperId() > 0) {
             listener.onRefreshed(
                     new WallpaperMetadata(
                             prefs.getHomeWallpaperAttributions(),