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

Commit 014c8047 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes from topic "ea-pinner-global-quota" into main

* changes:
  Split some pinner deps to their own files
  Clean up skip_home_art_pins ablatin study flag
  Create safeguard pinner quota for system apps
parents 710f98e3 aeff37f3
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
@@ -3467,6 +3467,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" />

+8 −5
Original line number Diff line number Diff line
@@ -9,8 +9,11 @@ flag {
}

flag {
    name: "skip_home_art_pins"
  name: "pin_global_quota"
  namespace: "system_performance"
    description: "Ablation study flag that controls if home app odex/vdex files should be pinned in memory."
  description: "This flag controls whether pinner will use a global quota or not"
  bug: "340935152"
  metadata {
    purpose: PURPOSE_BUGFIX
  }
}
+27 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2024 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.server.pinner;

/* package */ abstract class PinRangeSource {
    /**
     * Retrieve a range to pin.
     *
     * @param outPinRange Receives the pin region
     * @return True if we filled in outPinRange or false if we're out of pin entries
     */
    abstract boolean read(PinnerService.PinRange outPinRange);
}
 No newline at end of file
+37 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2024 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.server.pinner;

/* package */ class PinRangeSourceStatic extends PinRangeSource {
    private final int mPinStart;
    private final int mPinLength;
    private boolean mDone = false;

    PinRangeSourceStatic(int pinStart, int pinLength) {
        mPinStart = pinStart;
        mPinLength = pinLength;
    }

    @Override
    boolean read(PinnerService.PinRange outPinRange) {
        outPinRange.start = mPinStart;
        outPinRange.length = mPinLength;
        boolean done = mDone;
        mDone = true;
        return !done;
    }
}
 No newline at end of file
Loading