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

Commit b718d7b5 authored by Ruchi Kandoi's avatar Ruchi Kandoi Committed by android-build-merger
Browse files

Merge "Hide apks not needed for a specific sku" into pi-dev am: 776b4e2d

am: dae7a5dd

Change-Id: I3100d4b3187d35fbfdd5edb4e730c1734b5b596c
parents d804ba8b dae7a5dd
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -3498,6 +3498,10 @@
    <!-- Whether or not swipe up gesture's opt-in setting is available on this device -->
    <bool name="config_swipe_up_gesture_setting_available">false</bool>

    <!-- Applications which are disabled unless matching a particular sku -->
    <string-array name="config_disableApksUnlessMatchedSku_apk_list" translatable="false" />
    <string-array name="config_disableApkUnlessMatchedSku_skus_list" translatable="false" />

    <!-- Whether or not we should show the option to show battery percentage -->
    <bool name="config_battery_percentage_setting_available">true</bool>

+3 −0
Original line number Diff line number Diff line
@@ -3436,4 +3436,7 @@

  <java-symbol type="integer" name="config_defaultHapticFeedbackIntensity" />
  <java-symbol type="integer" name="config_defaultNotificationVibrationIntensity" />

  <java-symbol type="array" name="config_disableApksUnlessMatchedSku_apk_list" />
  <java-symbol type="array" name="config_disableApkUnlessMatchedSku_skus_list" />
</resources>
+24 −0
Original line number Diff line number Diff line
@@ -21109,6 +21109,8 @@ public class PackageManagerService extends IPackageManager.Stub
        CarrierAppUtils.disableCarrierAppsUntilPrivileged(mContext.getOpPackageName(), this,
                mContext.getContentResolver(), UserHandle.USER_SYSTEM);
        disableSkuSpecificApps();
        // Read the compatibilty setting when the system is ready.
        boolean compatibilityModeEnabled = android.provider.Settings.Global.getInt(
                mContext.getContentResolver(),
@@ -21899,6 +21901,28 @@ public class PackageManagerService extends IPackageManager.Stub
        }
    }
    //TODO: b/111402650
    private void disableSkuSpecificApps() {
        if (!mIsUpgrade && !mFirstBoot) {
            return;
        }
        String apkList[] = mContext.getResources().getStringArray(
                R.array.config_disableApksUnlessMatchedSku_apk_list);
        String skuArray[] = mContext.getResources().getStringArray(
                R.array.config_disableApkUnlessMatchedSku_skus_list);
        if (ArrayUtils.isEmpty(apkList)) {
           return;
        }
        String sku = SystemProperties.get("ro.boot.hardware.sku");
        if (!TextUtils.isEmpty(sku) && ArrayUtils.contains(skuArray, sku)) {
            return;
        }
        for (String packageName : apkList) {
            setSystemAppHiddenUntilInstalled(packageName, true);
            setSystemAppInstallState(packageName, false, ActivityManager.getCurrentUser());
        }
    }
    private void dumpProto(FileDescriptor fd) {
        final ProtoOutputStream proto = new ProtoOutputStream(fd);