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

Commit 08c2d40a authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 13382171 from 9831f53b to 25Q3-release

Change-Id: I90296a026b2f3a17330f2ddbc2ecdfc718248ed1
parents 252ed50b 9831f53b
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -16,6 +16,10 @@

package android.debug;

/*
 * Must be in sync with framewroks/native/libs/adbd_auth/include/adbd_auth.h
 */

/** @hide */
@Backing(type="byte")
enum AdbTransportType {
+11 −43
Original line number Diff line number Diff line
@@ -1176,7 +1176,7 @@ public final class MessageQueue {
            msg.arg1 = token;
            incAndTraceMessageCount(msg, when);

            if (Flags.messageQueueTailTracking() && mLast != null && mLast.when <= when) {
            if (mLast != null && mLast.when <= when) {
                /* Message goes to tail of list */
                mLast.next = msg;
                mLast = msg;
@@ -1359,7 +1359,6 @@ public final class MessageQueue {
                // For readability, we split this portion of the function into two blocks based on
                // whether tail tracking is enabled. This has a minor implication for the case
                // where tail tracking is disabled. See the comment below.
                if (Flags.messageQueueTailTracking()) {
                if (when >= mLast.when) {
                    needWake = needWake && mAsyncMessageCount == 0;
                    msg.next = null;
@@ -1385,37 +1384,6 @@ public final class MessageQueue {
                    msg.next = p; // invariant: p == prev.next
                    prev.next = msg;
                }
                } else {
                    Message prev;
                    for (;;) {
                        prev = p;
                        p = p.next;
                        if (p == null || when < p.when) {
                            break;
                        }
                        if (needWake && p.isAsynchronous()) {
                            needWake = false;
                        }
                    }
                    msg.next = p; // invariant: p == prev.next
                    prev.next = msg;

                    /*
                     * If this block is executing then we have a build without tail tracking -
                     * specifically: Flags.messageQueueTailTracking() == false. This is determined
                     * at build time so the flag won't change on us during runtime.
                     *
                     * Since we don't want to pepper the code with extra checks, we only check
                     * for tail tracking when we might use mLast. Otherwise, we continue to update
                     * mLast as the tail of the list.
                     *
                     * In this case however we are not maintaining mLast correctly. Since we never
                     * use it, this is fine. However, we run the risk of leaking a reference.
                     * So set mLast to null in this case to avoid any Message leaks. The other
                     * sites will never use the value so we are safe against null pointer derefs.
                     */
                    mLast = null;
                }
            }

            if (msg.isAsynchronous()) {
+11 −46
Original line number Diff line number Diff line
@@ -560,7 +560,7 @@ public final class MessageQueue {
            msg.when = when;
            msg.arg1 = token;

            if (Flags.messageQueueTailTracking() && mLast != null && mLast.when <= when) {
            if (mLast != null && mLast.when <= when) {
                /* Message goes to tail of list */
                mLast.next = msg;
                mLast = msg;
@@ -679,10 +679,6 @@ public final class MessageQueue {
                // the message is the earliest asynchronous message in the queue.
                needWake = mBlocked && p.target == null && msg.isAsynchronous();

                // For readability, we split this portion of the function into two blocks based on
                // whether tail tracking is enabled. This has a minor implication for the case
                // where tail tracking is disabled. See the comment below.
                if (Flags.messageQueueTailTracking()) {
                if (when >= mLast.when) {
                    needWake = needWake && mAsyncMessageCount == 0;
                    msg.next = null;
@@ -708,37 +704,6 @@ public final class MessageQueue {
                    msg.next = p; // invariant: p == prev.next
                    prev.next = msg;
                }
                } else {
                    Message prev;
                    for (;;) {
                        prev = p;
                        p = p.next;
                        if (p == null || when < p.when) {
                            break;
                        }
                        if (needWake && p.isAsynchronous()) {
                            needWake = false;
                        }
                    }
                    msg.next = p; // invariant: p == prev.next
                    prev.next = msg;

                    /*
                     * If this block is executing then we have a build without tail tracking -
                     * specifically: Flags.messageQueueTailTracking() == false. This is determined
                     * at build time so the flag won't change on us during runtime.
                     *
                     * Since we don't want to pepper the code with extra checks, we only check
                     * for tail tracking when we might use mLast. Otherwise, we continue to update
                     * mLast as the tail of the list.
                     *
                     * In this case however we are not maintaining mLast correctly. Since we never
                     * use it, this is fine. However, we run the risk of leaking a reference.
                     * So set mLast to null in this case to avoid any Message leaks. The other
                     * sites will never use the value so we are safe against null pointer derefs.
                     */
                    mLast = null;
                }
            }

            if (msg.isAsynchronous()) {
+0 −8
Original line number Diff line number Diff line
@@ -310,14 +310,6 @@ flag {
    is_exported: true
}

flag {
    name: "message_queue_tail_tracking"
    namespace: "system_performance"
    description: "track tail of message queue."
    bug: "305311707"
    is_fixed_read_only: true
}

flag {
     name: "message_queue_testability"
     namespace: "system_performance"
+5 −3
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package android.window;
import android.os.Bundle;
import android.os.IBinder;
import android.content.Intent;
import android.window.IMultitaskingControllerCallback;
import android.window.IMultitaskingDelegate;

/**
@@ -36,14 +37,15 @@ import android.window.IMultitaskingDelegate;
 */
interface IMultitaskingController {
    /**
     * Method used by WMShell to register itself as a delegate that can respond to the app requests.
     * Method used by WMShell to set itself as the delegate that can respond to the app requests.
     * @return a callback used to notify the client about the changes in the managed windows.
     */
    @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.MANAGE_ACTIVITY_TASKS)")
    oneway void registerMultitaskingDelegate(in IMultitaskingDelegate delegate);
    IMultitaskingControllerCallback setMultitaskingDelegate(in IMultitaskingDelegate delegate);

    /**
     * Returns an instance of an interface for use by applications to make requests to the system.
     */
    @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.REQUEST_SYSTEM_MULTITASKING_CONTROLS)")
    @nullable IMultitaskingDelegate getClientInterface();
    @nullable IMultitaskingDelegate getClientInterface(in IMultitaskingControllerCallback callback);
}
Loading