Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2bb000a3 authored by felkachang's avatar felkachang
Browse files

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
parent 12fe6c72
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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();
+2 −0
Original line number Diff line number Diff line
@@ -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();