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

Commit 6ae10103 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add a blacklist for preinstalled carrier apps."

parents 57de01e1 1a3158b8
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -4270,6 +4270,10 @@
    (default 2MB) -->
    <integer name="config_notificationStripRemoteViewSizeBytes">2000000</integer>

    <!-- Contains a blacklist of apps that should not get pre-installed carrier app permission
         grants, even if the UICC claims that the app should be privileged. See b/138150105 -->
    <string-array name="config_restrictedPreinstalledCarrierApps" translatable="false"/>

    <!-- Sharesheet: define a max number of targets per application for new shortcuts-based direct share introduced in Q -->
    <integer name="config_maxShortcutTargetsPerApp">3</integer>

+1 −0
Original line number Diff line number Diff line
@@ -3836,6 +3836,7 @@

  <java-symbol type="string" name="config_defaultSupervisionProfileOwnerComponent" />
  <java-symbol type="bool" name="config_inflateSignalStrength" />
  <java-symbol type="array" name="config_restrictedPreinstalledCarrierApps" />

  <java-symbol type="drawable" name="android_logotype" />
  <java-symbol type="layout" name="platlogo_layout" />
+9 −3
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import android.content.ContentResolver;
import android.content.pm.ApplicationInfo;
import android.content.pm.IPackageManager;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.os.RemoteException;
import android.permission.IPermissionManager;
import android.provider.Settings;
@@ -29,7 +30,9 @@ import android.util.ArrayMap;
import android.util.ArraySet;
import android.util.Slog;

import com.android.internal.R;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.util.ArrayUtils;
import com.android.server.SystemConfig;

import java.util.ArrayList;
@@ -143,9 +146,12 @@ public final class CarrierAppUtils {
        try {
            for (ApplicationInfo ai : candidates) {
                String packageName = ai.packageName;
                boolean hasPrivileges = telephonyManager != null &&
                        telephonyManager.checkCarrierPrivilegesForPackageAnyPhone(packageName) ==
                                TelephonyManager.CARRIER_PRIVILEGE_STATUS_HAS_ACCESS;
                String[] restrictedCarrierApps = Resources.getSystem().getStringArray(
                        R.array.config_restrictedPreinstalledCarrierApps);
                boolean hasPrivileges = telephonyManager != null
                        && telephonyManager.checkCarrierPrivilegesForPackageAnyPhone(packageName)
                                == TelephonyManager.CARRIER_PRIVILEGE_STATUS_HAS_ACCESS
                        && !ArrayUtils.contains(restrictedCarrierApps, packageName);

                // add hiddenUntilInstalled flag for carrier apps and associated apps
                packageManager.setSystemAppHiddenUntilInstalled(packageName, true);