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

Commit 9865fa21 authored by Ryan Mitchell's avatar Ryan Mitchell Committed by Automerger Merge Worker
Browse files

Partial revert "Add overlayable configurator resources" am: 2c206f86 am: 7739e07e

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11725030

Change-Id: I27a55de539ddc1a4eaafdb35a0b033ff2972081f
parents d08ee931 7739e07e
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -4456,11 +4456,4 @@
    <bool name="config_pdp_reject_enable_retry">false</bool>
    <!-- pdp data reject retry delay in ms -->
    <integer name="config_pdp_reject_retry_delay_ms">-1</integer>

    <!-- Package name that is recognized as an actor for the packages listed in
         @array/config_overlayableConfiguratorTargets. If an overlay targeting one of the listed
         targets is signed with the same signature as the configurator, the overlay will be granted
         the "actor" policy. -->
    <string name="config_overlayableConfigurator" translatable="false" />
    <string-array name="config_overlayableConfiguratorTargets" translatable="false" />
</resources>
+0 −3
Original line number Diff line number Diff line
@@ -4033,8 +4033,5 @@
  <java-symbol type="string" name="config_pdp_reject_service_not_subscribed" />
  <java-symbol type="string" name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" />

  <java-symbol type="string" name="config_overlayableConfigurator" />
  <java-symbol type="array" name="config_overlayableConfiguratorTargets" />

  <java-symbol type="array" name="config_notificationMsgPkgsAllowedAsConvos" />
</resources>
+3 −18
Original line number Diff line number Diff line
@@ -29,18 +29,15 @@ import android.os.OverlayablePolicy;
import android.os.SystemProperties;
import android.util.Slog;

import com.android.internal.util.ArrayUtils;

import java.io.IOException;

/**
 * Handle the creation and deletion of idmap files.
 *
 * The actual work is performed by the idmap binary, launched through idmap2d.
 *
 * Note: this class is subclassed in the OMS unit tests, and hence not marked as final.
 * The actual work is performed by idmap2d.
 * @see IdmapDaemon
 */
class IdmapManager {
final class IdmapManager {
    private static final boolean VENDOR_IS_Q_OR_LATER;
    static {
        final String value = SystemProperties.get("ro.vndk.version", "29");
@@ -57,14 +54,10 @@ class IdmapManager {

    private final IdmapDaemon mIdmapDaemon;
    private final OverlayableInfoCallback mOverlayableCallback;
    private final String mOverlayableConfigurator;
    private final String[] mOverlayableConfiguratorTargets;

    IdmapManager(final IdmapDaemon idmapDaemon, final OverlayableInfoCallback verifyCallback) {
        mOverlayableCallback = verifyCallback;
        mIdmapDaemon = idmapDaemon;
        mOverlayableConfigurator = verifyCallback.getOverlayableConfigurator();
        mOverlayableConfiguratorTargets = verifyCallback.getOverlayableConfiguratorTargets() ;
    }

    /**
@@ -190,14 +183,6 @@ class IdmapManager {
        String targetOverlayableName = overlayPackage.targetOverlayableName;
        if (targetOverlayableName != null) {
            try {
                if (!mOverlayableConfigurator.isEmpty()
                        && ArrayUtils.contains(mOverlayableConfiguratorTargets,
                                targetPackage.packageName)
                        && mOverlayableCallback.signaturesMatching(mOverlayableConfigurator,
                                overlayPackage.packageName, userId)) {
                    return true;
                }

                OverlayableInfo overlayableInfo = mOverlayableCallback.getOverlayableForTarget(
                        targetPackage.packageName, targetOverlayableName, userId);
                if (overlayableInfo != null && overlayableInfo.actor != null) {
+0 −13
Original line number Diff line number Diff line
@@ -45,7 +45,6 @@ import android.content.pm.PackageInfo;
import android.content.pm.PackageManagerInternal;
import android.content.pm.UserInfo;
import android.content.res.ApkAssets;
import android.content.res.Resources;
import android.net.Uri;
import android.os.Binder;
import android.os.Environment;
@@ -63,7 +62,6 @@ import android.util.AtomicFile;
import android.util.Slog;
import android.util.SparseArray;

import com.android.internal.R;
import com.android.internal.content.om.OverlayConfig;
import com.android.server.FgThread;
import com.android.server.IoThread;
@@ -1120,17 +1118,6 @@ public final class OverlayManagerService extends SystemService {
            return false;
        }

        @Override
        public String getOverlayableConfigurator() {
            return Resources.getSystem().getString(R.string.config_overlayableConfigurator);
        }

        @Override
        public String[] getOverlayableConfiguratorTargets() {
            return Resources.getSystem().getStringArray(
                    R.array.config_overlayableConfiguratorTargets);
        }

        @Override
        public List<PackageInfo> getOverlayPackages(final int userId) {
            final List<PackageInfo> overlays = mPackageManagerInternal.getOverlayPackages(userId);
+0 −20
Original line number Diff line number Diff line
@@ -80,24 +80,4 @@ public interface OverlayableInfoCallback {
     *     in the system returns {@link PackageManager#SIGNATURE_MATCH}
     */
    boolean signaturesMatching(@NonNull String pkgName1, @NonNull String pkgName2, int userId);

    /**
     * Retrieves the package name that is recognized as an actor for the packages specified by
     * {@link #getOverlayableConfiguratorTargets()}.
     */
    @NonNull
    default String getOverlayableConfigurator() {
        return "";
    }

    /**
     * Retrieves the target packages that recognize the {@link #getOverlayableConfigurator} as an
     * actor for its overlayable declarations. Overlays targeting one of the specified targets that
     * are signed with the same signature as the overlayable configurator will be granted the
     * "actor" policy.
     */
    @NonNull
    default String[] getOverlayableConfiguratorTargets() {
        return new String[0];
    }
}
Loading