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

Commit 4f782973 authored by Ryan Mitchell's avatar Ryan Mitchell
Browse files

RRO CTS Test APIs

Added TestAPIs for CTS tests of overlays.

Bug: 116512274
Test: OverlayableTest
Change-Id: I0dda4f09c06f384bbfe790cb4aaf4140c43533e9
parent c4f2beba
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -713,6 +713,11 @@ package android.content.pm {

package android.content.res {

  public final class AssetManager implements java.lang.AutoCloseable {
    method @NonNull public String[] getApkPaths();
    method @Nullable public java.util.Map<java.lang.String,java.lang.String> getOverlayableMap(String);
  }

  public final class Configuration implements java.lang.Comparable<android.content.res.Configuration> android.os.Parcelable {
    field public int assetsSeq;
    field public final android.app.WindowConfiguration windowConfiguration;
+18 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.StringRes;
import android.annotation.StyleRes;
import android.annotation.TestApi;
import android.annotation.UnsupportedAppUsage;
import android.content.pm.ActivityInfo;
import android.content.res.Configuration.NativeConfig;
@@ -357,6 +358,22 @@ public final class AssetManager implements AutoCloseable {
        return sEmptyApkAssets;
    }

    /** @hide */
    @TestApi
    public @NonNull String[] getApkPaths() {
        synchronized (this) {
            if (mOpen) {
                String[] paths = new String[mApkAssets.length];
                final int count = mApkAssets.length;
                for (int i = 0; i < count; i++) {
                    paths[i] = mApkAssets[i].getAssetPath();
                }
                return paths;
            }
        }
        return new String[0];
    }

    /**
     * Returns a cookie for use with the other APIs of AssetManager.
     * @return 0 if the path was not found, otherwise a positive integer cookie representing
@@ -1349,6 +1366,7 @@ public final class AssetManager implements AutoCloseable {
    /**
     * @hide
     */
    @TestApi
    @GuardedBy("this")
    public @Nullable Map<String, String> getOverlayableMap(String packageName) {
        synchronized (this) {