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

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

Merge "Hide apks not needed for a specific sku" into pi-dev

parents cf0b1271 e350e739
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -3488,6 +3488,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>
</resources>
+3 −0
Original line number Diff line number Diff line
@@ -3404,4 +3404,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
@@ -21161,6 +21161,8 @@ Slog.v(TAG, ":: stepped forward, applying functor at tag " + parser.getName());
        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(),
@@ -21948,6 +21950,28 @@ Slog.v(TAG, ":: stepped forward, applying functor at tag " + parser.getName());
        }
    }
    //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);