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

Commit 6c56cfd4 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6740034 from 72758527 to rvc-qpr1-release

Change-Id: Id9cc9a25cf6bc06c5e81108b78b6f78c859719b7
parents cbf19202 72758527
Loading
Loading
Loading
Loading
+5 −3
Original line number Original line Diff line number Diff line
@@ -680,7 +680,8 @@ static void classInitNative(JNIEnv* env, jclass clazz) {
}
}


static bool initNative(JNIEnv* env, jobject obj, jboolean isGuest,
static bool initNative(JNIEnv* env, jobject obj, jboolean isGuest,
                       jboolean isNiapMode, int configCompareResult) {
                       jboolean isNiapMode, int configCompareResult,
                       jboolean isAtvDevice) {
  ALOGV("%s", __func__);
  ALOGV("%s", __func__);


  android_bluetooth_UidTraffic.clazz =
  android_bluetooth_UidTraffic.clazz =
@@ -696,7 +697,8 @@ static bool initNative(JNIEnv* env, jobject obj, jboolean isGuest,


  int ret = sBluetoothInterface->init(
  int ret = sBluetoothInterface->init(
      &sBluetoothCallbacks, isGuest == JNI_TRUE ? 1 : 0,
      &sBluetoothCallbacks, isGuest == JNI_TRUE ? 1 : 0,
      isNiapMode == JNI_TRUE ? 1 : 0, configCompareResult);
      isNiapMode == JNI_TRUE ? 1 : 0, configCompareResult,
      isAtvDevice == JNI_TRUE ? 1 : 0);
  if (ret != BT_STATUS_SUCCESS) {
  if (ret != BT_STATUS_SUCCESS) {
    ALOGE("Error while setting the callbacks: %d\n", ret);
    ALOGE("Error while setting the callbacks: %d\n", ret);
    sBluetoothInterface = NULL;
    sBluetoothInterface = NULL;
@@ -1309,7 +1311,7 @@ static int getMetricIdNative(JNIEnv* env, jobject obj, jbyteArray address) {
static JNINativeMethod sMethods[] = {
static JNINativeMethod sMethods[] = {
    /* name, signature, funcPtr */
    /* name, signature, funcPtr */
    {"classInitNative", "()V", (void*)classInitNative},
    {"classInitNative", "()V", (void*)classInitNative},
    {"initNative", "(ZZI)Z", (void*)initNative},
    {"initNative", "(ZZIZ)Z", (void*)initNative},
    {"cleanupNative", "()V", (void*)cleanupNative},
    {"cleanupNative", "()V", (void*)cleanupNative},
    {"enableNative", "()Z", (void*)enableNative},
    {"enableNative", "()Z", (void*)enableNative},
    {"disableNative", "()Z", (void*)disableNative},
    {"disableNative", "()Z", (void*)disableNative},
+6 −2
Original line number Original line Diff line number Diff line
@@ -441,7 +441,11 @@ public class AdapterService extends Service {
        mBluetoothKeystoreService = new BluetoothKeystoreService(isNiapMode());
        mBluetoothKeystoreService = new BluetoothKeystoreService(isNiapMode());
        mBluetoothKeystoreService.start();
        mBluetoothKeystoreService.start();
        int configCompareResult = mBluetoothKeystoreService.getCompareResult();
        int configCompareResult = mBluetoothKeystoreService.getCompareResult();
        initNative(isGuest(), isNiapMode(), configCompareResult);

        // Android TV doesn't show consent dialogs for just works and encryption only le pairing
        boolean isAtvDevice = getApplicationContext().getPackageManager().hasSystemFeature(
                PackageManager.FEATURE_LEANBACK_ONLY);
        initNative(isGuest(), isNiapMode(), configCompareResult, isAtvDevice);
        mNativeAvailable = true;
        mNativeAvailable = true;
        mCallbacks = new RemoteCallbackList<IBluetoothCallback>();
        mCallbacks = new RemoteCallbackList<IBluetoothCallback>();
        mAppOps = getSystemService(AppOpsManager.class);
        mAppOps = getSystemService(AppOpsManager.class);
@@ -3080,7 +3084,7 @@ public class AdapterService extends Service {
    static native void classInitNative();
    static native void classInitNative();


    native boolean initNative(boolean startRestricted, boolean isNiapMode,
    native boolean initNative(boolean startRestricted, boolean isNiapMode,
            int configCompareResult);
            int configCompareResult, boolean isAtvDevice);


    native void cleanupNative();
    native void cleanupNative();


+1 −0
Original line number Original line Diff line number Diff line
@@ -226,6 +226,7 @@ public class SapServer extends Thread implements Callback {
                mContext.getString(R.string.bluetooth_sap_notif_title),
                mContext.getString(R.string.bluetooth_sap_notif_title),
                NotificationManager.IMPORTANCE_HIGH);
                NotificationManager.IMPORTANCE_HIGH);
        notificationManager.createNotificationChannel(notificationChannel);
        notificationManager.createNotificationChannel(notificationChannel);
        flags |= PendingIntent.FLAG_IMMUTABLE;
        if (VERBOSE) {
        if (VERBOSE) {
            Log.i(TAG, "setNotification type: " + type);
            Log.i(TAG, "setNotification type: " + type);
        }
        }
+1 −1
Original line number Original line Diff line number Diff line
@@ -108,7 +108,7 @@ public class AdapterServiceTest {
        Assert.assertNotNull(Looper.myLooper());
        Assert.assertNotNull(Looper.myLooper());
        AdapterService adapterService = new AdapterService();
        AdapterService adapterService = new AdapterService();
        adapterService.initNative(false /* is_restricted */, false /* is_niap_mode */,
        adapterService.initNative(false /* is_restricted */, false /* is_niap_mode */,
                0 /* config_compare_result */);
                0 /* config_compare_result */, false);
        adapterService.cleanupNative();
        adapterService.cleanupNative();
        HashMap<String, HashMap<String, String>> adapterConfig = TestUtils.readAdapterConfig();
        HashMap<String, HashMap<String, String>> adapterConfig = TestUtils.readAdapterConfig();
        Assert.assertNotNull(adapterConfig);
        Assert.assertNotNull(adapterConfig);
+1 −1
Original line number Original line Diff line number Diff line
@@ -97,7 +97,7 @@ public class ProfileServiceTest {
        mProfiles = Config.getSupportedProfiles();
        mProfiles = Config.getSupportedProfiles();


        mMockAdapterService.initNative(false /* is_restricted */, false /* is_niap_mode */,
        mMockAdapterService.initNative(false /* is_restricted */, false /* is_niap_mode */,
                0 /* config_compare_result */);
                0 /* config_compare_result */, false);


        TestUtils.setAdapterService(mMockAdapterService);
        TestUtils.setAdapterService(mMockAdapterService);