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

Commit 3e879d65 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 12844825 from a51dcf16 to 25Q2-release

Change-Id: I936c49124c92beba1176d0231dd1941817a9388a
parents 7e65621d a51dcf16
Loading
Loading
Loading
Loading
+31 −0
Original line number Diff line number Diff line
@@ -6453,6 +6453,13 @@ public class Notification implements Parcelable
            big.setColorStateList(R.id.snooze_button, "setImageTintList", actionColor);
            big.setColorStateList(R.id.bubble_button, "setImageTintList", actionColor);
            if (Flags.notificationsRedesignTemplates()) {
                int margin = getContentMarginTop(mContext,
                        R.dimen.notification_2025_content_margin_top);
                big.setViewLayoutMargin(R.id.notification_main_column, RemoteViews.MARGIN_TOP,
                        margin, TypedValue.COMPLEX_UNIT_PX);
            }
            boolean validRemoteInput = false;
            // In the UI, contextual actions appear separately from the standard actions, so we
@@ -6549,6 +6556,30 @@ public class Notification implements Parcelable
            return big;
        }
        /**
         * Calculate the top margin for the content in px, to allow enough space for the top line
         * above, using the given resource ID for the desired spacing.
         *
         * @hide
         */
        public static int getContentMarginTop(Context context, @DimenRes int spacingRes) {
            final Resources resources = context.getResources();
            // The margin above the text, at the top of the notification (originally in dp)
            int notifMargin = resources.getDimensionPixelSize(R.dimen.notification_2025_margin);
            // Spacing between the text lines, scaling with the font size (originally in sp)
            int spacing = resources.getDimensionPixelSize(spacingRes);
            // Size of the text in the notification top line (originally in sp)
            int[] textSizeAttr = new int[] { android.R.attr.textSize };
            TypedArray typedArray = context.obtainStyledAttributes(
                    R.style.TextAppearance_DeviceDefault_Notification_Info, textSizeAttr);
            int textSize = typedArray.getDimensionPixelSize(0 /* index */, -1 /* default */);
            typedArray.recycle();
            // Adding up all the values as pixels
            return notifMargin + spacing + textSize;
        }
        private boolean hasValidRemoteInput(Action action) {
            if (TextUtils.isEmpty(action.title) || action.actionIntent == null) {
                // Weird actions
+15 −3
Original line number Diff line number Diff line
@@ -768,6 +768,10 @@ public class NotificationManager {
        INotificationManager service = service();
        String sender = mContext.getPackageName();

        if (discardNotify(mContext.getUser(), targetPackage, tag, id, notification)) {
            return;
        }

        try {
            if (localLOGV) Log.v(TAG, sender + ": notify(" + id + ", " + notification + ")");
            service.enqueueNotificationWithTag(targetPackage, sender, tag, id,
@@ -918,6 +922,10 @@ public class NotificationManager {
     * @param id An identifier for this notification.
     */
    public void cancelAsPackage(@NonNull String targetPackage, @Nullable String tag, int id) {
        if (discardCancel(mContext.getUser(), targetPackage, tag, id)) {
            return;
        }

        INotificationManager service = service();
        try {
            service.cancelNotificationWithTag(targetPackage, mContext.getOpPackageName(),
@@ -981,16 +989,20 @@ public class NotificationManager {
     */
    public void cancelAll()
    {
        String pkg = mContext.getPackageName();
        UserHandle user = mContext.getUser();

        if (Flags.nmBinderPerfThrottleNotify()) {
            synchronized (mThrottleLock) {
                for (NotificationKey key : mKnownNotifications.snapshot().keySet()) {
                    if (key.pkg.equals(pkg) && key.user.equals(user)) {
                        mKnownNotifications.put(key, KNOWN_STATUS_CANCELLED);
                    }
                }
            }
        }

        INotificationManager service = service();
        String pkg = mContext.getPackageName();
        if (localLOGV) Log.v(TAG, pkg + ": cancelAll()");
        try {
            service.cancelAllNotifications(pkg, mContext.getUserId());
@@ -1014,7 +1026,7 @@ public class NotificationManager {
    public void setNotificationDelegate(@Nullable String delegate) {
        INotificationManager service = service();
        String pkg = mContext.getPackageName();
        if (localLOGV) Log.v(TAG, pkg + ": cancelAll()");
        if (localLOGV) Log.v(TAG, pkg + ": setNotificationDelegate()");
        try {
            service.setNotificationDelegate(pkg, delegate);
        } catch (RemoteException e) {
+8 −3
Original line number Diff line number Diff line
@@ -17430,12 +17430,17 @@ public class DevicePolicyManager {
    }
    /**
     * Removes a manged profile from the device only when called from a managed profile's context
     * Removes a managed profile from the device.
     *
     * <p>
     * Removes the managed profile which is specified by the context user
     * ({@code Context.createContextAsUser()}).
     * <p>
     *
     * @param user UserHandle of the profile to be removed
     * @return {@code true} when removal of managed profile was successful, {@code false} when
     * removal was unsuccessful or throws IllegalArgumentException when provided user was not a
     * removal was unsuccessful or throws IllegalArgumentException when specified user was not a
     * managed profile
     *
     * @hide
     */
    @SystemApi
+13 −13
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@ package android.app.appfunctions;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.os.RemoteException;
import android.os.SystemClock;
import android.util.Log;

import java.util.Objects;
@@ -40,8 +39,7 @@ public class SafeOneTimeExecuteAppFunctionCallback {

    @NonNull private final IExecuteAppFunctionCallback mCallback;

    @Nullable
    private final CompletionCallback mCompletionCallback;
    @Nullable private final CompletionCallback mCompletionCallback;

    private final AtomicLong mExecutionStartTimeAfterBindMillis = new AtomicLong();

@@ -49,7 +47,8 @@ public class SafeOneTimeExecuteAppFunctionCallback {
        this(callback, /* completionCallback= */ null);
    }

    public SafeOneTimeExecuteAppFunctionCallback(@NonNull IExecuteAppFunctionCallback callback,
    public SafeOneTimeExecuteAppFunctionCallback(
            @NonNull IExecuteAppFunctionCallback callback,
            @Nullable CompletionCallback completionCallback) {
        mCallback = Objects.requireNonNull(callback);
        mCompletionCallback = completionCallback;
@@ -64,8 +63,8 @@ public class SafeOneTimeExecuteAppFunctionCallback {
        try {
            mCallback.onSuccess(result);
            if (mCompletionCallback != null) {
                mCompletionCallback.finalizeOnSuccess(result,
                        mExecutionStartTimeAfterBindMillis.get());
                mCompletionCallback.finalizeOnSuccess(
                        result, mExecutionStartTimeAfterBindMillis.get());
            }
        } catch (RemoteException ex) {
            // Failed to notify the other end. Ignore.
@@ -82,8 +81,8 @@ public class SafeOneTimeExecuteAppFunctionCallback {
        try {
            mCallback.onError(error);
            if (mCompletionCallback != null) {
                mCompletionCallback.finalizeOnError(error,
                        mExecutionStartTimeAfterBindMillis.get());
                mCompletionCallback.finalizeOnError(
                        error, mExecutionStartTimeAfterBindMillis.get());
            }
        } catch (RemoteException ex) {
            // Failed to notify the other end. Ignore.
@@ -103,9 +102,10 @@ public class SafeOneTimeExecuteAppFunctionCallback {
     * Sets the execution start time of the request. Used to calculate the overhead latency of
     * requests.
     */
    public void setExecutionStartTimeMillis() {
        if (!mExecutionStartTimeAfterBindMillis.compareAndSet(0, SystemClock.elapsedRealtime())) {
            Log.w(TAG, "Ignore subsequent calls to setExecutionStartTimeMillis()");
    public void setExecutionStartTimeAfterBindMillis(long executionStartTimeAfterBindMillis) {
        if (!mExecutionStartTimeAfterBindMillis.compareAndSet(
                0, executionStartTimeAfterBindMillis)) {
            Log.w(TAG, "Ignore subsequent calls to setExecutionStartTimeAfterBindMillis()");
        }
    }

@@ -115,8 +115,8 @@ public class SafeOneTimeExecuteAppFunctionCallback {
     */
    public interface CompletionCallback {
        /** Called after {@link IExecuteAppFunctionCallback#onSuccess}. */
        void finalizeOnSuccess(@NonNull ExecuteAppFunctionResponse result,
                long executionStartTimeMillis);
        void finalizeOnSuccess(
                @NonNull ExecuteAppFunctionResponse result, long executionStartTimeMillis);

        /** Called after {@link IExecuteAppFunctionCallback#onError}. */
        void finalizeOnError(@NonNull AppFunctionException error, long executionStartTimeMillis);
+7 −1
Original line number Diff line number Diff line
@@ -39,12 +39,18 @@ interface IHintManager {
     * Throws UnsupportedOperationException if ADPF is not supported, and IllegalStateException
     * if creation is supported but fails.
     */
    IHintSession createHintSessionWithConfig(in IBinder token, in SessionTag tag,
    SessionCreationReturn createHintSessionWithConfig(in IBinder token, in SessionTag tag,
            in SessionCreationConfig creationConfig, out SessionConfig config);

    void setHintSessionThreads(in IHintSession hintSession, in int[] tids);
    int[] getHintSessionThreadIds(in IHintSession hintSession);

    parcelable SessionCreationReturn {
        IHintSession session;
        // True if the graphics pipeline thread limit is being exceeded
        boolean pipelineThreadLimitExceeded = false;
    }

    /**
     * Returns FMQ channel information for the caller, which it associates to a binder token.
     *
Loading