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

Commit a45a199b authored by Xin Li's avatar Xin Li Committed by Android (Google) Code Review
Browse files

Merge "Merge 25Q1 (ab/BP1A.250305.020) to aosp-main-future" into aosp-main-future

parents 9393a2f5 89c9d2e1
Loading
Loading
Loading
Loading
+24 −16
Original line number Diff line number Diff line
@@ -14839,7 +14839,10 @@ public class Notification implements Parcelable
            if (isColorized) {
                if (rawColor == COLOR_DEFAULT) {
                    mBackgroundColor = ctx.getColor(R.color.materialColorSecondary);
                    int[] attrs = {R.attr.materialColorSecondary};
                    try (TypedArray ta = obtainDayNightAttributes(ctx, attrs)) {
                        mBackgroundColor = getColor(ta, 0, Color.WHITE);
                    }
                } else {
                    mBackgroundColor = rawColor;
                }
@@ -14871,25 +14874,30 @@ public class Notification implements Parcelable
                mRippleAlpha = 0x33;
            } else {
                int[] attrs = {
                        R.attr.materialColorSurfaceContainerHigh,
                        R.attr.materialColorOnSurface,
                        R.attr.materialColorOnSurfaceVariant,
                        R.attr.materialColorPrimary,
                        R.attr.materialColorSecondary,
                        R.attr.materialColorTertiary,
                        R.attr.materialColorOnTertiary,
                        R.attr.materialColorTertiaryFixedDim,
                        R.attr.materialColorOnTertiaryFixed,
                        R.attr.colorError,
                        R.attr.colorControlHighlight
                };
                mBackgroundColor = ctx.getColor(R.color.materialColorSurfaceContainerHigh);
                mPrimaryTextColor = ctx.getColor(R.color.materialColorOnSurface);
                mSecondaryTextColor = ctx.getColor(R.color.materialColorOnSurfaceVariant);
                mPrimaryAccentColor = ctx.getColor(R.color.materialColorPrimary);
                mSecondaryAccentColor = ctx.getColor(R.color.materialColorSecondary);
                mTertiaryAccentColor = ctx.getColor(R.color.materialColorTertiary);
                mOnTertiaryAccentTextColor = ctx.getColor(R.color.materialColorOnTertiary);
                mTertiaryFixedDimAccentColor = ctx.getColor(
                        R.color.materialColorTertiaryFixedDim);
                mOnTertiaryFixedAccentTextColor = ctx.getColor(
                        R.color.materialColorOnTertiaryFixed);
                try (TypedArray ta = obtainDayNightAttributes(ctx, attrs)) {
                    mErrorColor = getColor(ta, 0, COLOR_INVALID);
                    mRippleAlpha = Color.alpha(getColor(ta, 1, 0x33ffffff));
                    mBackgroundColor = getColor(ta, 0, nightMode ? Color.BLACK : Color.WHITE);
                    mPrimaryTextColor = getColor(ta, 1, COLOR_INVALID);
                    mSecondaryTextColor = getColor(ta, 2, COLOR_INVALID);
                    mPrimaryAccentColor = getColor(ta, 3, COLOR_INVALID);
                    mSecondaryAccentColor = getColor(ta, 4, COLOR_INVALID);
                    mTertiaryAccentColor = getColor(ta, 5, COLOR_INVALID);
                    mOnTertiaryAccentTextColor = getColor(ta, 6, COLOR_INVALID);
                    mTertiaryFixedDimAccentColor = getColor(ta, 7, COLOR_INVALID);
                    mOnTertiaryFixedAccentTextColor = getColor(ta, 8, COLOR_INVALID);
                    mErrorColor = getColor(ta, 9, COLOR_INVALID);
                    mRippleAlpha = Color.alpha(getColor(ta, 10, 0x33ffffff));
                }
                mContrastColor = calculateContrastColor(ctx, rawColor, mPrimaryAccentColor,
                        mBackgroundColor, nightMode);
+8 −0
Original line number Diff line number Diff line
@@ -114,3 +114,11 @@ flag {
    bug: "373535266"
    is_fixed_read_only: true
}

flag {
    name: "self_targeting_android_resource_frro"
    is_exported: true
    namespace: "customization_picker"
    description: "Fixes bug in Launcher preview by enabling overlays targeting 'android'"
    bug: "377545987"
}
 No newline at end of file
+5 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import android.content.om.OverlayManager;
import android.content.pm.ApplicationInfo;
import android.content.res.ApkAssets;
import android.content.res.AssetFileDescriptor;
import android.content.res.Flags;
import android.os.ParcelFileDescriptor;
import android.util.Log;

@@ -90,6 +91,10 @@ public class ResourcesProvider implements AutoCloseable, Closeable {
            throws IOException {
        Objects.requireNonNull(overlayInfo);
        Preconditions.checkArgument(overlayInfo.isFabricated(), "Not accepted overlay");
        if (!Flags.selfTargetingAndroidResourceFrro()) {
            Preconditions.checkStringNotEmpty(
                    overlayInfo.getTargetOverlayableName(), "Without overlayable name");
        }
        final String overlayName =
                OverlayManagerImpl.checkOverlayNameValid(overlayInfo.getOverlayName());
        final String path =
+11 −23
Original line number Diff line number Diff line
@@ -21,13 +21,11 @@ import android.os.CpuHeadroomParamsInternal;
import android.os.GpuHeadroomParamsInternal;
import android.os.IHintSession;
import android.os.SessionCreationConfig;

import android.hardware.power.ChannelConfig;
import android.hardware.power.CpuHeadroomResult;
import android.hardware.power.ChannelConfig;
import android.hardware.power.GpuHeadroomResult;
import android.hardware.power.SessionConfig;
import android.hardware.power.SessionTag;
import android.hardware.power.SupportInfo;

/** {@hide} */
interface IHintManager {
@@ -42,6 +40,11 @@ interface IHintManager {
    IHintSession createHintSessionWithConfig(in IBinder token, in SessionTag tag,
            in SessionCreationConfig creationConfig, out SessionConfig config);

    /**
     * Get preferred rate limit in nanoseconds.
     */
    long getHintSessionPreferredRate();

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

@@ -58,28 +61,13 @@ interface IHintManager {
    long getGpuHeadroomMinIntervalMillis();

    /**
     * Used by the JNI to pass an interface to the SessionManager;
     * for internal use only.
     */
    oneway void passSessionManagerBinder(in IBinder sessionManager);

    parcelable HintManagerClientData {
        int powerHalVersion;
        int maxGraphicsPipelineThreads;
        long preferredRateNanos;
        SupportInfo supportInfo;
    }

    interface IHintManagerClient {
        /**
        * Returns FMQ channel information for the caller, which it associates to the callback binder lifespan.
     * Get Maximum number of graphics pipeline threads allowed per-app.
     */
        oneway void receiveChannelConfig(in ChannelConfig config);
    }
    int getMaxGraphicsPipelineThreadsCount();

    /**
     * Set up an ADPF client, receiving a remote client binder interface and
     * passing back a bundle of support and configuration information.
     * Used by the JNI to pass an interface to the SessionManager;
     * for internal use only.
     */
    HintManagerClientData registerClient(in IHintManagerClient client);
    oneway void passSessionManagerBinder(in IBinder sessionManager);
}
+20 −21
Original line number Diff line number Diff line
@@ -938,27 +938,6 @@ public final class InputMethodManager {
            synchronized (mH) {
                if (mCurRootView == viewRootImpl) {
                    mCurRootViewWindowFocused = false;

                    if (Flags.refactorInsetsController() && mCurRootView != null) {
                        final int softInputMode = mCurRootView.mWindowAttributes.softInputMode;
                        final int state =
                                softInputMode & WindowManager.LayoutParams.SOFT_INPUT_MASK_STATE;
                        if (state == WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN) {
                            // when losing focus (e.g., by going to another window), we reset the
                            // requestedVisibleTypes of WindowInsetsController by hiding the IME
                            final var statsToken = ImeTracker.forLogging().onStart(
                                    ImeTracker.TYPE_HIDE, ImeTracker.ORIGIN_CLIENT,
                                    SoftInputShowHideReason.REASON_HIDE_WINDOW_LOST_FOCUS,
                                    false /* fromUser */);
                            if (DEBUG) {
                                Log.d(TAG, "onWindowLostFocus, hiding IME because "
                                        + "of STATE_ALWAYS_HIDDEN");
                            }
                            mCurRootView.getInsetsController().hide(WindowInsets.Type.ime(),
                                    false /* fromIme */, statsToken);
                        }
                    }

                    clearCurRootViewIfNeeded();
                }
            }
@@ -1012,6 +991,26 @@ public final class InputMethodManager {
        @GuardedBy("mH")
        private void setCurrentRootViewLocked(ViewRootImpl rootView) {
            final boolean wasEmpty = mCurRootView == null;
            if (Flags.refactorInsetsController() && !wasEmpty && mCurRootView != rootView) {
                final int softInputMode = mCurRootView.mWindowAttributes.softInputMode;
                final int state =
                        softInputMode & WindowManager.LayoutParams.SOFT_INPUT_MASK_STATE;
                if (state == WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN) {
                    // when losing input focus (e.g., by going to another window), we reset the
                    // requestedVisibleTypes of WindowInsetsController by hiding the IME
                    final var statsToken = ImeTracker.forLogging().onStart(
                            ImeTracker.TYPE_HIDE, ImeTracker.ORIGIN_CLIENT,
                            SoftInputShowHideReason.HIDE_WINDOW_LOST_FOCUS,
                            false /* fromUser */);
                    if (DEBUG) {
                        Log.d(TAG, "setCurrentRootViewLocked, hiding IME because "
                                + "of STATE_ALWAYS_HIDDEN");
                    }
                    mCurRootView.getInsetsController().hide(WindowInsets.Type.ime(),
                            false /* fromIme */, statsToken);
                }
            }

            mImeDispatcher.switchRootView(mCurRootView, rootView);
            mCurRootView = rootView;
            if (wasEmpty && mCurRootView != null) {
Loading