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

Commit 42316adc authored by Jeremy Meyer's avatar Jeremy Meyer Committed by Android (Google) Code Review
Browse files

Merge "Pass a copy of style_id_args to theme.rebase()"

parents ba8abb8e 4ed80d63
Loading
Loading
Loading
Loading
+9 −6
Original line number Diff line number Diff line
@@ -1296,6 +1296,10 @@ static void NativeThemeRebase(JNIEnv* env, jclass /*clazz*/, jlong ptr, jlong th
  } else {
    CHECK(style_count == 0) << "style_ids is null while style_count is non-zero";
  }
  auto style_id_args_copy = std::vector<uint32_t>{style_id_args, style_id_args + style_count};
  if (style_ids != nullptr) {
      env->ReleasePrimitiveArrayCritical(style_ids, style_id_args, JNI_ABORT);
  }

  jboolean* force_args = nullptr;
  if (force != nullptr) {
@@ -1308,15 +1312,14 @@ static void NativeThemeRebase(JNIEnv* env, jclass /*clazz*/, jlong ptr, jlong th
  } else {
    CHECK(style_count == 0) << "force is null while style_count is non-zero";
  }

  auto theme = reinterpret_cast<Theme*>(theme_ptr);
  theme->Rebase(&(*assetmanager), style_id_args, force_args, static_cast<size_t>(style_count));
  if (style_ids != nullptr) {
    env->ReleasePrimitiveArrayCritical(style_ids, style_id_args, JNI_ABORT);
  }
  auto force_args_copy = std::vector<jboolean>{force_args, force_args + style_count};
  if (force != nullptr) {
    env->ReleasePrimitiveArrayCritical(force, force_args, JNI_ABORT);
  }

  auto theme = reinterpret_cast<Theme*>(theme_ptr);
  theme->Rebase(&(*assetmanager), style_id_args_copy.data(), force_args_copy.data(),
                static_cast<size_t>(style_count));
}

static void NativeThemeCopy(JNIEnv* env, jclass /*clazz*/, jlong dst_asset_manager_ptr,