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

Commit 2e634400 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 12730349 from e6374d1e to 25Q1-release

Change-Id: I54816e9296bf8602883e9360ff948e4bf945759d
parents f13973c0 e6374d1e
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -100,12 +100,14 @@ aconfig_declarations_group {
        "com.android.media.flags.editing-aconfig-java",
        "com.android.media.flags.performance-aconfig-java",
        "com.android.media.flags.projection-aconfig-java",
        "com.android.net.http.flags-aconfig-exported-java",
        "com.android.net.thread.platform.flags-aconfig-java",
        "com.android.ranging.flags.ranging-aconfig-java-export",
        "com.android.server.contextualsearch.flags-java",
        "com.android.server.flags.services-aconfig-java",
        "com.android.text.flags-aconfig-java",
        "com.android.window.flags.window-aconfig-java",
        "conscrypt_exported_aconfig_flags_lib",
        "device_policy_aconfig_flags_lib",
        "display_flags_lib",
        "dropbox_flags_lib",
@@ -195,6 +197,14 @@ java_aconfig_library {
    defaults: ["framework-minus-apex-aconfig-java-defaults"],
}

// Conscrypt
java_aconfig_library {
    name: "conscrypt_exported_aconfig_flags_lib",
    aconfig_declarations: "conscrypt-aconfig-flags",
    mode: "exported",
    defaults: ["framework-minus-apex-aconfig-java-defaults"],
}

// Telecom
java_aconfig_library {
    name: "telecom_flags_core_java_lib",
+1 −0
Original line number Diff line number Diff line
@@ -29889,6 +29889,7 @@ package android.net.http {
  public class X509TrustManagerExtensions {
    ctor public X509TrustManagerExtensions(javax.net.ssl.X509TrustManager) throws java.lang.IllegalArgumentException;
    method public java.util.List<java.security.cert.X509Certificate> checkServerTrusted(java.security.cert.X509Certificate[], String, String) throws java.security.cert.CertificateException;
    method @FlaggedApi("android.net.platform.flags.x509_extensions_certificate_transparency") @NonNull public java.util.List<java.security.cert.X509Certificate> checkServerTrusted(@NonNull java.security.cert.X509Certificate[], @Nullable byte[], @Nullable byte[], @NonNull String, @NonNull String) throws java.security.cert.CertificateException;
    method public boolean isSameTrustConfiguration(String, String);
    method public boolean isUserAddedCertificate(java.security.cert.X509Certificate);
  }
+26 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import static android.view.Display.INVALID_DISPLAY;
import static com.android.server.display.feature.flags.Flags.FLAG_DISPLAY_LISTENER_PERFORMANCE_IMPROVEMENTS;

import android.Manifest;
import android.annotation.CallbackExecutor;
import android.annotation.FlaggedApi;
import android.annotation.FloatRange;
import android.annotation.IntDef;
@@ -70,6 +71,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.Executor;
import java.util.function.Consumer;
import java.util.function.Predicate;


@@ -1840,6 +1842,30 @@ public final class DisplayManager {
        mGlobal.setDisplayTopology(topology);
    }

    /**
     * Register a listener to receive display topology updates.
     * @param executor The executor specifying the thread on which the callbacks will be invoked
     * @param listener The listener
     *
     * @hide
     */
    @RequiresPermission(MANAGE_DISPLAYS)
    public void registerTopologyListener(@NonNull @CallbackExecutor Executor executor,
            @NonNull Consumer<DisplayTopology> listener) {
        mGlobal.registerTopologyListener(executor, listener, ActivityThread.currentPackageName());
    }

    /**
     * Unregister a display topology listener.
     * @param listener The listener to unregister
     *
     * @hide
     */
    @RequiresPermission(MANAGE_DISPLAYS)
    public void unregisterTopologyListener(@NonNull Consumer<DisplayTopology> listener) {
        mGlobal.unregisterTopologyListener(listener);
    }

    /**
     * Listens for changes in available display devices.
     */
+123 −2
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import static android.Manifest.permission.MANAGE_DISPLAYS;
import static android.view.Display.HdrCapabilities.HdrType;

import android.Manifest;
import android.annotation.CallbackExecutor;
import android.annotation.FlaggedApi;
import android.annotation.FloatRange;
import android.annotation.IntDef;
@@ -73,6 +74,7 @@ import java.util.Objects;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.Executor;
import java.util.concurrent.atomic.AtomicLong;
import java.util.function.Consumer;

/**
 * Manager communication with the display manager service on behalf of
@@ -126,7 +128,7 @@ public final class DisplayManagerGlobal {
    public static final int EVENT_DISPLAY_REFRESH_RATE_CHANGED = 8;
    public static final int EVENT_DISPLAY_STATE_CHANGED = 9;

    @LongDef(prefix = {"INTERNAL_EVENT_DISPLAY"}, flag = true, value = {
    @LongDef(prefix = {"INTERNAL_EVENT_FLAG_"}, flag = true, value = {
            INTERNAL_EVENT_FLAG_DISPLAY_ADDED,
            INTERNAL_EVENT_FLAG_DISPLAY_CHANGED,
            INTERNAL_EVENT_FLAG_DISPLAY_REMOVED,
@@ -134,7 +136,8 @@ public final class DisplayManagerGlobal {
            INTERNAL_EVENT_FLAG_DISPLAY_HDR_SDR_RATIO_CHANGED,
            INTERNAL_EVENT_FLAG_DISPLAY_CONNECTION_CHANGED,
            INTERNAL_EVENT_FLAG_DISPLAY_REFRESH_RATE,
            INTERNAL_EVENT_FLAG_DISPLAY_STATE
            INTERNAL_EVENT_FLAG_DISPLAY_STATE,
            INTERNAL_EVENT_FLAG_TOPOLOGY_UPDATED,
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface InternalEventFlag {}
@@ -147,6 +150,7 @@ public final class DisplayManagerGlobal {
    public static final long INTERNAL_EVENT_FLAG_DISPLAY_CONNECTION_CHANGED = 1L << 5;
    public static final long INTERNAL_EVENT_FLAG_DISPLAY_REFRESH_RATE = 1L << 6;
    public static final long INTERNAL_EVENT_FLAG_DISPLAY_STATE = 1L << 7;
    public static final long INTERNAL_EVENT_FLAG_TOPOLOGY_UPDATED = 1L << 8;

    @UnsupportedAppUsage
    private static DisplayManagerGlobal sInstance;
@@ -164,6 +168,9 @@ public final class DisplayManagerGlobal {
    private final CopyOnWriteArrayList<DisplayListenerDelegate> mDisplayListeners =
            new CopyOnWriteArrayList<>();

    private final CopyOnWriteArrayList<DisplayTopologyListenerDelegate> mTopologyListeners =
            new CopyOnWriteArrayList<>();

    private final SparseArray<DisplayInfo> mDisplayInfoCache = new SparseArray<>();
    private final ColorSpace mWideColorSpace;
    private final OverlayProperties mOverlayProperties;
@@ -457,6 +464,18 @@ public final class DisplayManagerGlobal {
        }
    }

    private void maybeLogAllTopologyListeners() {
        if (!extraLogging()) {
            return;
        }
        Slog.i(TAG, "Currently registered display topology listeners:");
        int i = 0;
        for (DisplayTopologyListenerDelegate d : mTopologyListeners) {
            Slog.i(TAG, i + ": " + d);
            i++;
        }
    }

    /**
     * Called when there is a display-related window configuration change. Reroutes the event from
     * WindowManager to make sure the {@link Display} fields are up-to-date in the last callback.
@@ -502,9 +521,22 @@ public final class DisplayManagerGlobal {
                    | INTERNAL_EVENT_FLAG_DISPLAY_CHANGED
                    | INTERNAL_EVENT_FLAG_DISPLAY_REMOVED;
        }
        if (!mTopologyListeners.isEmpty()) {
            mask |= INTERNAL_EVENT_FLAG_TOPOLOGY_UPDATED;
        }
        return mask;
    }

    private DisplayTopologyListenerDelegate findTopologyListenerLocked(
            @NonNull Consumer<DisplayTopology> listener) {
        for (DisplayTopologyListenerDelegate delegate : mTopologyListeners) {
            if (delegate.mListener == listener) {
                return delegate;
            }
        }
        return null;
    }

    private void registerCallbackIfNeededLocked() {
        if (mCallback == null) {
            mCallback = new DisplayManagerCallback();
@@ -1316,6 +1348,9 @@ public final class DisplayManagerGlobal {
     */
    @RequiresPermission(MANAGE_DISPLAYS)
    public void setDisplayTopology(DisplayTopology topology) {
        if (topology == null) {
            throw new IllegalArgumentException("Topology must not be null");
        }
        try {
            mDm.setDisplayTopology(topology);
        } catch (RemoteException ex) {
@@ -1323,6 +1358,57 @@ public final class DisplayManagerGlobal {
        }
    }

    /**
     * @see DisplayManager#registerTopologyListener
     */
    @RequiresPermission(MANAGE_DISPLAYS)
    public void registerTopologyListener(@NonNull @CallbackExecutor Executor executor,
            @NonNull Consumer<DisplayTopology> listener, String packageName) {
        if (!Flags.displayTopology()) {
            return;
        }
        if (listener == null) {
            throw new IllegalArgumentException("listener must not be null");
        }
        if (extraLogging()) {
            Slog.i(TAG, "Registering display topology listener: packageName=" + packageName);
        }
        synchronized (mLock) {
            DisplayTopologyListenerDelegate delegate = findTopologyListenerLocked(listener);
            if (delegate == null) {
                mTopologyListeners.add(new DisplayTopologyListenerDelegate(listener, executor,
                        packageName));
                registerCallbackIfNeededLocked();
                updateCallbackIfNeededLocked();
            }
            maybeLogAllTopologyListeners();
        }
    }

    /**
     * @see DisplayManager#unregisterTopologyListener
     */
    @RequiresPermission(MANAGE_DISPLAYS)
    public void unregisterTopologyListener(@NonNull Consumer<DisplayTopology> listener) {
        if (!Flags.displayTopology()) {
            return;
        }
        if (listener == null) {
            throw new IllegalArgumentException("listener must not be null");
        }
        if (extraLogging()) {
            Slog.i(TAG, "Unregistering display topology listener: " + listener);
        }
        synchronized (mLock) {
            DisplayTopologyListenerDelegate delegate = findTopologyListenerLocked(listener);
            if (delegate != null) {
                mTopologyListeners.remove(delegate);
                updateCallbackIfNeededLocked();
            }
        }
        maybeLogAllTopologyListeners();
    }

    private final class DisplayManagerCallback extends IDisplayManagerCallback.Stub {
        @Override
        public void onDisplayEvent(int displayId, @DisplayEvent int event) {
@@ -1332,6 +1418,16 @@ public final class DisplayManagerGlobal {
            }
            handleDisplayEvent(displayId, event, false /* forceUpdate */);
        }

        @Override
        public void onTopologyChanged(DisplayTopology topology) {
            if (DEBUG) {
                Log.d(TAG, "onTopologyChanged: " + topology);
            }
            for (DisplayTopologyListenerDelegate listener : mTopologyListeners) {
                listener.onTopologyChanged(topology);
            }
        }
    }

    private static final class DisplayListenerDelegate {
@@ -1509,6 +1605,31 @@ public final class DisplayManagerGlobal {
        }
    }

    private static final class DisplayTopologyListenerDelegate {
        private final Consumer<DisplayTopology> mListener;
        private final Executor mExecutor;
        private final String mPackageName;

        DisplayTopologyListenerDelegate(@NonNull Consumer<DisplayTopology> listener,
                @NonNull @CallbackExecutor Executor executor, String packageName) {
            mExecutor = executor;
            mListener = listener;
            mPackageName = packageName;
        }

        @Override
        public String toString() {
            return "DisplayTopologyListener {packageName=" + mPackageName + "}";
        }

        void onTopologyChanged(DisplayTopology topology) {
            if (extraLogging()) {
                Slog.i(TAG, "Sending topology update: " + topology);
            }
            mExecutor.execute(() -> mListener.accept(topology));
        }
    }

    /**
     * The API portion of the key that identifies the unique PropertyInvalidatedCache token which
     * changes every time we update the system's display configuration.
+178 −139

File changed.

Preview size limit exceeded, changes collapsed.

Loading