replace CURRENT_OR_SELF with non hidden API

This API is called by a mainline module (Bluetooth), and needs
to be change to an available API.

Bug: 200200870
Tag: #refactor
Test: Build + start bt + switch user and restart bt
Change-Id: I37bb0d16e61d666d0aa51d5efe48fa9b39f9c1c3
This commit is contained in:
William Escande
2021-11-24 20:13:18 +01:00
parent f7a480d824
commit d23ab35c01
2 changed files with 2 additions and 3 deletions

View File

@@ -23,7 +23,6 @@ import android.annotation.SdkConstant;
import android.annotation.SuppressLint;
import android.annotation.SystemApi;
import android.bluetooth.annotations.RequiresBluetoothConnectPermission;
import android.bluetooth.annotations.RequiresLegacyBluetoothPermission;
import android.compat.annotation.UnsupportedAppUsage;
import android.content.Attributable;
import android.content.AttributionSource;
@@ -170,7 +169,7 @@ public class BluetoothPbap implements BluetoothProfile {
mContext.getPackageManager(), 0);
intent.setComponent(comp);
if (comp == null || !mContext.bindServiceAsUser(intent, mConnection, 0,
UserHandle.CURRENT_OR_SELF)) {
UserHandle.CURRENT)) {
Log.e(TAG, "Could not bind to Bluetooth Pbap Service with " + intent);
return false;
}

View File

@@ -103,7 +103,7 @@ public abstract class BluetoothProfileConnector<T> {
mContext.getPackageManager(), 0);
intent.setComponent(comp);
if (comp == null || !mContext.bindServiceAsUser(intent, mConnection, 0,
UserHandle.CURRENT_OR_SELF)) {
UserHandle.CURRENT)) {
logError("Could not bind to Bluetooth Service with " + intent);
return false;
}