summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author felkachang <felkachang@google.com> 2022-09-29 14:15:01 +0800
committer felkachang <felkachang@google.com> 2022-10-04 17:28:06 +0800
commit2bb000a3f77f2695bdc484ded540d1dae6d74117 (patch)
treef5df64b34705281ea8e1bea5b7bb57962b0bbdc8
parent12fe6c728553ec488a34daba67237c1493cd64ed (diff)
Fix minimum sdk using @hide API
DocumentsUI is a mainline module being required to have minimum sdk. To use @hide API and this API may be public, it will give -2 in presubmit process. Mark the functions have the usage of OverlayManager. Bug: 249664195 Reference: go/mainline-newapi#strict-updatability-linting Reference: go/mainline-newapi#suppressing-specific-calls Test: OUT_SOONG="out/soong/.intermediates" ; \ DOCSUI_PATH="vendor/unbundled_google/packages/DocumentsUIGoogle"; \ PIM="DocumentsUIGoogle/android_common/lint/"; \ m ${OUT_SOONG}/${DOCSUI_PATH}/${PIM}/lint-baseline.xml Test: presubmit Change-Id: Icbbde81e841392a5189d77aad62bd4d0f2f4b81f
-rw-r--r--src/com/android/documentsui/DocumentsApplication.java2
-rw-r--r--src/com/android/documentsui/PreBootReceiver.java2
2 files changed, 4 insertions, 0 deletions
diff --git a/src/com/android/documentsui/DocumentsApplication.java b/src/com/android/documentsui/DocumentsApplication.java
index c7e21a434..c576851b7 100644
--- a/src/com/android/documentsui/DocumentsApplication.java
+++ b/src/com/android/documentsui/DocumentsApplication.java
@@ -16,6 +16,7 @@
package com.android.documentsui;
+import android.annotation.SuppressLint;
import android.app.ActivityManager;
import android.app.Application;
import android.content.BroadcastReceiver;
@@ -115,6 +116,7 @@ public class DocumentsApplication extends Application {
Log.d(TAG, "OverlayManager.setEnabled() result: " + result);
}
+ @SuppressLint("NewApi") // OverlayManager.class is @hide
@Override
public void onCreate() {
super.onCreate();
diff --git a/src/com/android/documentsui/PreBootReceiver.java b/src/com/android/documentsui/PreBootReceiver.java
index f5ad9395a..2bdbee555 100644
--- a/src/com/android/documentsui/PreBootReceiver.java
+++ b/src/com/android/documentsui/PreBootReceiver.java
@@ -19,6 +19,7 @@ package com.android.documentsui;
import static com.android.documentsui.base.Shared.LAUNCHER_TARGET_CLASS;
import static com.android.documentsui.base.SharedMinimal.DEBUG;
+import android.annotation.SuppressLint;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
@@ -45,6 +46,7 @@ public class PreBootReceiver extends BroadcastReceiver {
private static final String DOWNLOADS_TARGET_CLASS =
"com.android.documentsui.ViewDownloadsActivity";
+ @SuppressLint("NewApi") // OverlayManager is @hdie
@Override
public void onReceive(Context context, Intent intent) {
final PackageManager pm = context.getPackageManager();