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

Commit e0c0c883 authored by Ryan Mitchell's avatar Ryan Mitchell Committed by Android (Google) Code Review
Browse files

Merge changes from topic "rro-cts"

* changes:
  RRO CTS Test APIs
  Relax restrictions on non-system overlays
parents 1388c333 4f782973
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -716,6 +716,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
@@ -1356,6 +1373,7 @@ public final class AssetManager implements AutoCloseable {
    /**
     * @hide
     */
    @TestApi
    @GuardedBy("this")
    public @Nullable Map<String, String> getOverlayableMap(String packageName) {
        synchronized (this) {
+0 −1
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@ LOCAL_MODULE_TAGS := tests
LOCAL_PACKAGE_NAME := OverlayDeviceTests_AppOverlayOne
LOCAL_SDK_VERSION := current
LOCAL_COMPATIBILITY_SUITE := device-tests
LOCAL_CERTIFICATE := platform
LOCAL_USE_AAPT2 := true
LOCAL_AAPT_FLAGS := --no-resource-removal
include $(BUILD_PACKAGE)
+1 −1
Original line number Diff line number Diff line
@@ -19,5 +19,5 @@
        android:versionCode="1"
        android:versionName="1.0">
        <application android:hasCode="false" />
        <overlay android:targetPackage="com.android.overlaytest" android:priority="1" />
        <overlay android:targetPackage="com.android.overlaytest" />
</manifest>
+0 −1
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@ LOCAL_MODULE_TAGS := tests
LOCAL_PACKAGE_NAME := OverlayDeviceTests_AppOverlayTwo
LOCAL_SDK_VERSION := current
LOCAL_COMPATIBILITY_SUITE := device-tests
LOCAL_CERTIFICATE := platform
LOCAL_USE_AAPT2 := true
LOCAL_AAPT_FLAGS := --no-resource-removal
include $(BUILD_PACKAGE)
Loading