code: @Implementation(minSdk = P)
    protected static @NonNull SparseArray<String> nativeGetAssignedPackageIdentifiers(
        long ptr) {
      CppAssetManager2 assetmanager = AssetManagerFromLong(ptr);
  
      SparseArray<String> sparse_array =
          new SparseArray<>();
  
      if (sparse_array == null) {
        // An exception is pending.
        return null;
      }
  
      assetmanager.ForEachPackage((String package_name, byte package_id) -> {
        String jpackage_name = package_name; // env.NewStringUTF(package_name);
        if (jpackage_name == null) {
          // An exception is pending.
          return;
        }
  
        // env.CallVoidMethod(sparse_array, gSparseArrayOffsets.put, (int) (package_id),
        //     jpackage_name);
        sparse_array.put(package_id, jpackage_name);
      });
      return sparse_array;
    }
docs: static jobject NativeGetAssignedPackageIdentifiers(JNIEnv* env, jclass /*clazz*/, jlong ptr) {