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

Commit dff32a90 authored by Liahav Eitan's avatar Liahav Eitan
Browse files

Ignore incorrect NewApi Lint warning for ENTERPRISE_CONTENT_URI

ag/20580387 is changing a SystemAPI method to public API, and the
linter cannot currently handle that. Adding a suppression until
b/193460475 is resolved.

Test: m out/soong/.intermediates/packages/modules/Bluetooth/android/app/Bluetooth/android_common/lint/lint-report.xml
Bug: 240954287
Tag: #refactor
Sponser: liahav@

Ignore-AOSP-First: need to merge this with the other changes. Will
merge into AOSP manually after (unless b/193460475 is resolved).

Change-Id: Ia72f4408cbf704bede00d738f4d98332a550b816
parent 51bc9c91
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.bluetooth.util;

import android.annotation.SuppressLint;
import android.app.admin.DevicePolicyManager;
import android.content.Context;
import android.net.Uri;
@@ -42,8 +43,13 @@ public final class DevicePolicyUtils {
        return true;
    }

    // Now we support getBluetoothContactSharingDisabled() for managed profile only
    /**
     * Returns a URI to query all phones on the device. If a managed profile exists
     * and the policy allows, it will be a URI that supports the managed profile.
     */
    // TODO: Make primary profile can also support getBluetoothContactSharingDisabled()
    // TODO(b/193460475): Android Lint handles change from SystemApi to public incorrectly
    @SuppressLint("NewApi")
    public static Uri getEnterprisePhoneUri(Context context) {
        return isBluetoothWorkContactSharingDisabled(context) ? Phone.CONTENT_URI
                : Phone.ENTERPRISE_CONTENT_URI;