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

Commit e7bea4b9 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Merge ab/6749736 in stage." into stage-aosp-master

parents cfccb929 ff503181
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -682,7 +682,7 @@ static void classInitNative(JNIEnv* env, jclass clazz) {

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

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

  int ret = sBluetoothInterface->init(
      &sBluetoothCallbacks, isGuest == JNI_TRUE ? 1 : 0,
      isNiapMode == JNI_TRUE ? 1 : 0, configCompareResult, flags);
      isNiapMode == JNI_TRUE ? 1 : 0, configCompareResult, flags,
      isAtvDevice == JNI_TRUE ? 1 : 0);

  for (int i = 0; i < flagCount; i++) {
    env->ReleaseStringUTFChars(flagObjs[i], flags[i]);
@@ -1335,7 +1336,7 @@ static int getMetricIdNative(JNIEnv* env, jobject obj, jbyteArray address) {
static JNINativeMethod sMethods[] = {
    /* name, signature, funcPtr */
    {"classInitNative", "()V", (void*)classInitNative},
    {"initNative", "(ZZI[Ljava/lang/String;)Z", (void*)initNative},
    {"initNative", "(ZZI[Ljava/lang/String;Z)Z", (void*)initNative},
    {"cleanupNative", "()V", (void*)cleanupNative},
    {"enableNative", "()Z", (void*)enableNative},
    {"disableNative", "()Z", (void*)disableNative},
+6 −2
Original line number Diff line number Diff line
@@ -441,7 +441,11 @@ public class AdapterService extends Service {
        mBluetoothKeystoreService = new BluetoothKeystoreService(isNiapMode());
        mBluetoothKeystoreService.start();
        int configCompareResult = mBluetoothKeystoreService.getCompareResult();
        initNative(isGuest(), isNiapMode(), configCompareResult, getInitFlags());

        // 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, getInitFlags(), isAtvDevice);
        mNativeAvailable = true;
        mCallbacks = new RemoteCallbackList<IBluetoothCallback>();
        mAppOps = getSystemService(AppOpsManager.class);
@@ -3144,7 +3148,7 @@ public class AdapterService extends Service {
    static native void classInitNative();

    native boolean initNative(boolean startRestricted, boolean isNiapMode, int configCompareResult,
            String[] initFlags);
            String[] initFlags, boolean isAtvDevice);

    native void cleanupNative();

+1 −1
Original line number Diff line number Diff line
@@ -109,7 +109,7 @@ public class AdapterServiceTest {
        Assert.assertNotNull(Looper.myLooper());
        AdapterService adapterService = new AdapterService();
        adapterService.initNative(false /* is_restricted */, false /* is_niap_mode */,
                0 /* config_compare_result */, new String[0]);
                0 /* config_compare_result */, new String[0], false);
        adapterService.cleanupNative();
        HashMap<String, HashMap<String, String>> adapterConfig = TestUtils.readAdapterConfig();
        Assert.assertNotNull(adapterConfig);
+1 −1
Original line number Diff line number Diff line
@@ -99,7 +99,7 @@ public class ProfileServiceTest {
        mProfiles = Config.getSupportedProfiles();

        mMockAdapterService.initNative(false /* is_restricted */, false /* is_niap_mode */,
                0 /* config_compare_result */, new String[0]);
                0 /* config_compare_result */, new String[0], false);

        TestUtils.setAdapterService(mMockAdapterService);
        doReturn(mDatabaseManager).when(mMockAdapterService).getDatabase();