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

Commit 8cf31570 authored by Edgar Arriaga's avatar Edgar Arriaga
Browse files

Create safeguard pinner quota for system apps

Flag: com.android.server.flags.pin_global_quota
Bug: 340935152
Test: atest FrameworksServicesTests_pinner_service:com.android.server.PinnerServiceTest

Change-Id: I007084fe73239dd6cd7f4e14c55bf181882d5694
parent 00789c63
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -4457,6 +4457,11 @@
    <!-- Bytes that the PinnerService will pin for WebView -->
    <integer name="config_pinnerWebviewPinBytes">0</integer>

    <!-- Maximum memory that PinnerService will pin for apps expressed
         as a percentage of total device memory [0,100].
         Example: 10, means 10% of total memory will be the maximum pinned memory -->
    <integer name="config_pinnerMaxPinnedMemoryPercentage">10</integer>

    <!-- Number of days preloaded file cache should be preserved on a device before it can be
         deleted -->
    <integer name="config_keepPreloadsMinDays">7</integer>
+1 −0
Original line number Diff line number Diff line
@@ -3464,6 +3464,7 @@
  <java-symbol type="integer" name="config_pinnerHomePinBytes" />
  <java-symbol type="bool" name="config_pinnerAssistantApp" />
  <java-symbol type="integer" name="config_pinnerWebviewPinBytes" />
  <java-symbol type="integer" name="config_pinnerMaxPinnedMemoryPercentage" />

  <java-symbol type="string" name="config_doubleTouchGestureEnableFile" />

+176 −85

File changed.

Preview size limit exceeded, changes collapsed.

+10 −0
Original line number Diff line number Diff line
@@ -8,6 +8,16 @@ flag {
    bug: "307594624"
}

flag {
  name: "pin_global_quota"
  namespace: "system_performance"
  description: "This flag controls whether pinner will use a global quota or not"
  bug: "340935152"
  metadata {
    purpose: PURPOSE_BUGFIX
  }
}

flag {
    name: "skip_home_art_pins"
    namespace: "system_performance"
+3 −2
Original line number Diff line number Diff line
@@ -318,8 +318,9 @@ public class SystemImpl implements SystemInterface {
            if (webviewPinQuota <= 0) {
                break;
            }
            int bytesPinned = pinnerService.pinFile(apk, webviewPinQuota, appInfo, PIN_GROUP);
            webviewPinQuota -= bytesPinned;
            PinnerService.PinnedFile pf = pinnerService.pinFile(
                    apk, webviewPinQuota, appInfo, PIN_GROUP, /*pinOptimizedDeps=*/true);
            webviewPinQuota -= pf.bytesPinned;
        }
    }

Loading