Merge "Hide apks not needed for a specific sku" into pi-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
776b4e2dfa
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user