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

Commit 218960e6 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 12180713 from cd0e636d to 24Q4-release

Change-Id: I549cf40ce3a737fc5b2aeac38a85336aadb5f9f6
parents d9807abb cd0e636d
Loading
Loading
Loading
Loading
+23 −0
Original line number Diff line number Diff line
@@ -55,6 +55,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.Executor;
import java.util.function.BiFunction;

/**
@@ -1267,6 +1268,28 @@ public abstract class ActivityManagerInternal {
     */
    public abstract boolean shouldDelayHomeLaunch(int userId);

    /**
     * Used to track when a process is frozen or unfrozen.
     */
    public interface FrozenProcessListener {
        /**
         * Called when a process is frozen.
         */
        void onProcessFrozen(int pid);

        /**
         * Called when a process is unfrozen.
         */
        void onProcessUnfrozen(int pid);
    }

    /**
     * Register the frozen process event listener callback. The same listener may be reused for
     * multiple pids. Listeners are dropped when the process dies.
     */
    public abstract void addFrozenProcessListener(int pid, @NonNull Executor executor,
            @NonNull FrozenProcessListener listener);

    /**
     * Add a startup timestamp to the most recent start of the specified process.
     *
+3 −0
Original line number Diff line number Diff line
@@ -94,6 +94,9 @@ per-file IEphemeralResolver.aidl = file:/services/core/java/com/android/server/p
per-file IInstantAppResolver.aidl = file:/services/core/java/com/android/server/pm/OWNERS
per-file InstantAppResolveInfo.aidl = file:/services/core/java/com/android/server/pm/OWNERS

# Performance
per-file PropertyInvalidatedCache.java = file:/PERFORMANCE_OWNERS

# Pinner
per-file pinner-client.aconfig = file:/core/java/android/app/pinner/OWNERS

+11 −2
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ import android.text.TextUtils;
import android.util.Log;

import com.android.internal.annotations.GuardedBy;
import com.android.internal.os.BackgroundThread;
import com.android.internal.util.FastPrintWriter;

import java.lang.annotation.Retention;
@@ -1260,7 +1261,7 @@ public class PropertyInvalidatedCache<Query, Result> {
        }

        public void autoCork() {
            if (Looper.getMainLooper() == null) {
            if (getLooper() == null) {
                // We're not ready to auto-cork yet, so just invalidate the cache immediately.
                if (DEBUG) {
                    Log.w(TAG, "invalidating instead of autocorking early in init: "
@@ -1322,7 +1323,7 @@ public class PropertyInvalidatedCache<Query, Result> {
        @GuardedBy("mLock")
        private Handler getHandlerLocked() {
            if (mHandler == null) {
                mHandler = new Handler(Looper.getMainLooper()) {
                mHandler = new Handler(getLooper()) {
                        @Override
                        public void handleMessage(Message msg) {
                            AutoCorker.this.handleMessage(msg);
@@ -1331,6 +1332,14 @@ public class PropertyInvalidatedCache<Query, Result> {
            }
            return mHandler;
        }

        /**
         * Return a looper for auto-uncork messages.  Messages should be processed on the
         * background thread, not on the main thread.
         */
        private static Looper getLooper() {
            return BackgroundThread.getHandler().getLooper();
        }
    }

    /**
+19 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.TestApi;
import android.os.Handler;
import android.os.Looper;
import android.os.Trace;
import android.util.Log;
import android.util.Printer;
@@ -535,6 +536,7 @@ public final class MessageQueue {
    /* This is only read/written from the Looper thread */
    private int mNextPollTimeoutMillis;
    private static final AtomicLong mMessagesDelivered = new AtomicLong();
    private boolean mMessageDirectlyQueued;

    private Message nextMessage() {
        int i = 0;
@@ -729,6 +731,7 @@ public final class MessageQueue {
                Binder.flushPendingCommands();
            }

            mMessageDirectlyQueued = false;
            nativePollOnce(ptr, mNextPollTimeoutMillis);

            Message msg = nextMessage();
@@ -841,6 +844,22 @@ public final class MessageQueue {
                    + node.isAsync() + " now: " + SystemClock.uptimeMillis());
        }

        final Looper myLooper = Looper.myLooper();
        /* If we are running on the looper thread we can add directly to the priority queue */
        if (myLooper != null && myLooper.getQueue() == this) {
            node.removeFromStack();
            insertIntoPriorityQueue(node);
            /*
             * We still need to do this even though we are the current thread,
             * otherwise next() may sleep indefinitely.
             */
            if (!mMessageDirectlyQueued) {
                mMessageDirectlyQueued = true;
                nativeWake(mPtr);
            }
            return true;
        }

        while (true) {
            StackNode old = (StackNode) sState.getVolatile(this);
            boolean wakeNeeded;
+3 −0
Original line number Diff line number Diff line
@@ -106,6 +106,9 @@ per-file SystemConfigManager.java = file:/PACKAGE_MANAGER_OWNERS
# ProfilingService
per-file ProfilingServiceManager.java = file:/PERFORMANCE_OWNERS

# Performance
per-file IpcDataCache.java = file:/PERFORMANCE_OWNERS

# Memory
per-file OomKillRecord.java = file:/MEMORY_OWNERS

Loading