Merge changes from topic "ea-pinner-defaults" into main
* changes:
Make home app be pinned by default
Move system apps pinner default values to be config driven and ensure new devices inherit them
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 8a2d767..169cf59 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -4447,17 +4447,25 @@
<string-array translatable="false" name="config_defaultPinnerServiceFiles">
</string-array>
- <!-- True if camera app should be pinned via Pinner Service -->
+ <!-- Note: This config is deprecated, use config_pinnerCameraPinBytes instead.
+ True if camera app should be pinned via Pinner Service -->
<bool name="config_pinnerCameraApp">false</bool>
- <!-- Bytes that the PinnerService will pin for Home app -->
- <integer name="config_pinnerHomePinBytes">0</integer>
+ <!-- Default: 60 MB. Bytes that the PinnerService will pin for Home app -->
+ <integer name="config_pinnerHomePinBytes">62914560</integer>
- <!-- True if assistant app should be pinned via Pinner Service -->
+ <!-- Default: 80 MB. Bytes that the PinnerService will pin for Camera app -->
+ <integer name="config_pinnerCameraPinBytes">83886080</integer>
+
+ <!-- Note: This config is deprecated, use config_pinnerAssistantPinBytes instead.
+ True if assistant app should be pinned via Pinner Service -->
<bool name="config_pinnerAssistantApp">false</bool>
- <!-- Bytes that the PinnerService will pin for WebView -->
- <integer name="config_pinnerWebviewPinBytes">0</integer>
+ <!-- Default: 60 MB. Bytes that the PinnerService will pin for Assistant -->
+ <integer name="config_pinnerAssistantPinBytes">62914560</integer>
+
+ <!-- Default: 20 MB. Bytes that the PinnerService will pin for WebView -->
+ <integer name="config_pinnerWebviewPinBytes">20971520</integer>
<!-- Maximum memory that PinnerService will pin for apps expressed
as a percentage of total device memory [0,100].
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index 4f63fac..81cf8d2 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -3471,6 +3471,8 @@
<java-symbol type="array" name="config_defaultPinnerServiceFiles" />
<java-symbol type="bool" name="config_pinnerCameraApp" />
<java-symbol type="integer" name="config_pinnerHomePinBytes" />
+ <java-symbol type="integer" name="config_pinnerCameraPinBytes" />
+ <java-symbol type="integer" name="config_pinnerAssistantPinBytes" />
<java-symbol type="bool" name="config_pinnerAssistantApp" />
<java-symbol type="integer" name="config_pinnerWebviewPinBytes" />
<java-symbol type="integer" name="config_pinnerMaxPinnedMemoryPercentage" />
diff --git a/services/core/java/com/android/server/pinner/PinnerService.java b/services/core/java/com/android/server/pinner/PinnerService.java
index d7ac520..2c75926 100644
--- a/services/core/java/com/android/server/pinner/PinnerService.java
+++ b/services/core/java/com/android/server/pinner/PinnerService.java
@@ -121,9 +121,6 @@
private static boolean PROP_PIN_PINLIST =
SystemProperties.getBoolean("pinner.use_pinlist", true);
- private static final int MAX_CAMERA_PIN_SIZE = 80 * (1 << 20); // 80MB max for camera app.
- private static final int MAX_ASSISTANT_PIN_SIZE = 60 * (1 << 20); // 60MB max for assistant app.
-
public static final String ANON_REGION_STAT_NAME = "[anon]";
private static final String SYSTEM_GROUP_NAME = "system";
@@ -179,8 +176,10 @@
// Resource-configured pinner flags;
private final boolean mConfiguredToPinCamera;
+ private final int mConfiguredCameraPinBytes;
private final int mConfiguredHomePinBytes;
private final boolean mConfiguredToPinAssistant;
+ private final int mConfiguredAssistantPinBytes;
private final int mConfiguredWebviewPinBytes;
// This is the percentage of total device memory that will be used to set the global quota.
@@ -250,6 +249,10 @@
mDeviceConfigInterface = mInjector.getDeviceConfigInterface();
mConfiguredToPinCamera = context.getResources().getBoolean(
com.android.internal.R.bool.config_pinnerCameraApp);
+ mConfiguredCameraPinBytes = context.getResources().getInteger(
+ com.android.internal.R.integer.config_pinnerCameraPinBytes);
+ mConfiguredAssistantPinBytes = context.getResources().getInteger(
+ com.android.internal.R.integer.config_pinnerAssistantPinBytes);
mConfiguredHomePinBytes = context.getResources().getInteger(
com.android.internal.R.integer.config_pinnerHomePinBytes);
mConfiguredToPinAssistant = context.getResources().getBoolean(
@@ -812,11 +815,11 @@
private int getSizeLimitForKey(@AppKey int key) {
switch (key) {
case KEY_CAMERA:
- return MAX_CAMERA_PIN_SIZE;
+ return mConfiguredCameraPinBytes;
case KEY_HOME:
return mConfiguredHomePinBytes;
case KEY_ASSISTANT:
- return MAX_ASSISTANT_PIN_SIZE;
+ return mConfiguredAssistantPinBytes;
default:
return 0;
}
@@ -1303,6 +1306,10 @@
pw.format(" Maximum Pinner quota: %d bytes (%.2f MB)\n", mConfiguredMaxPinnedMemory,
mConfiguredMaxPinnedMemory / bytesPerMB);
pw.format(" Max Home App Pin Bytes (without deps): %d\n", mConfiguredHomePinBytes);
+ pw.format(" Max Assistant App Pin Bytes (without deps): %d\n",
+ mConfiguredAssistantPinBytes);
+ pw.format(
+ " Max Camera App Pin Bytes (without deps): %d\n", mConfiguredCameraPinBytes);
pw.format("\nPinned Files:\n");
synchronized (PinnerService.this) {
long totalSize = 0;