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

Commit 13a625ee authored by William Escande's avatar William Escande Committed by Android Build Coastguard Worker
Browse files

Move user file along to the new package name

Repro step:
* Flash old build
* Pair device
* Change it's metadata:
   * Change connection_policy
   * Change Volume
   * Change phone_access
* build and flash without wipe
* observe device metadata

Test: Repro step above
Bug: 234063703
Ignore-AOSP-First: will be picked later
Change-Id: I51f54f2fe8a91ee4ee28e1e58494e596510ebb55
(cherry picked from commit b94e4d79)
Merged-In: I51f54f2fe8a91ee4ee28e1e58494e596510ebb55
parent 68d0d2e0
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -67,6 +67,7 @@ cc_library_shared {
    static_libs: [
        "libbluetooth-types",
        "libbluetooth",
        "libc++fs",
    ],
    cflags: [
        "-Wall",
+10 −3
Original line number Diff line number Diff line
@@ -953,7 +953,8 @@ static void classInitNative(JNIEnv* env, jclass clazz) {

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

  android_bluetooth_UidTraffic.clazz =
@@ -980,10 +981,15 @@ static bool initNative(JNIEnv* env, jobject obj, jboolean isGuest,
    flags[i] = env->GetStringUTFChars(flagObjs[i], NULL);
  }

  const char* user_data_directory =
      env->GetStringUTFChars(userDataDirectory, NULL);

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

  env->ReleaseStringUTFChars(userDataDirectory, user_data_directory);

  for (int i = 0; i < flagCount; i++) {
    env->ReleaseStringUTFChars(flagObjs[i], flags[i]);
@@ -1774,7 +1780,8 @@ static jboolean allowLowLatencyAudioNative(JNIEnv* env, jobject obj,
static JNINativeMethod sMethods[] = {
    /* name, signature, funcPtr */
    {"classInitNative", "()V", (void*)classInitNative},
    {"initNative", "(ZZI[Ljava/lang/String;Z)Z", (void*)initNative},
    {"initNative", "(ZZI[Ljava/lang/String;ZLjava/lang/String;)Z",
     (void*)initNative},
    {"cleanupNative", "()V", (void*)cleanupNative},
    {"enableNative", "()Z", (void*)enableNative},
    {"disableNative", "()Z", (void*)disableNative},
+3 −2
Original line number Diff line number Diff line
@@ -496,7 +496,7 @@ public class AdapterService extends Service {
                PackageManager.FEATURE_LEANBACK_ONLY);
        mUserManager = getSystemService(UserManager.class);
        initNative(mUserManager.isGuestUser(), isCommonCriteriaMode(), configCompareResult,
                getInitFlags(), isAtvDevice);
                getInitFlags(), isAtvDevice, getApplicationInfo().dataDir);
        mNativeAvailable = true;
        mCallbacks = new RemoteCallbackList<IBluetoothCallback>();
        mAppOps = getSystemService(AppOpsManager.class);
@@ -5410,7 +5410,8 @@ public class AdapterService extends Service {
    static native void classInitNative();

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

    native void cleanupNative();

+1 −1
Original line number Diff line number Diff line
@@ -192,7 +192,7 @@ public class AdapterServiceTest {
        Assert.assertNotNull(Looper.myLooper());
        AdapterService adapterService = new AdapterService();
        adapterService.initNative(false /* is_restricted */, false /* is_common_criteria_mode */,
                0 /* config_compare_result */, new String[0], false);
                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
@@ -115,7 +115,7 @@ public class ProfileServiceTest {

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

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