Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 89c9d2e

Browse files
committed
Merge 25Q1 (ab/BP1A.250305.020) to aosp-main-future
Bug: 385190204 Merged-In: I5d410f05b061a41e089fa652e5565224a3488baf Change-Id: Iacdecacfbd51c8e1dec35e4a259bca900a34a2ce
2 parents ff04f75 + 074fbb7 commit 89c9d2e

File tree

610 files changed

+14801
-6077
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

610 files changed

+14801
-6077
lines changed

core/java/android/app/Notification.java

+24-16
Original file line numberDiff line numberDiff line change
@@ -14839,7 +14839,10 @@ public void resolvePalette(Context ctx, int rawColor,
1483914839

1484014840
if (isColorized) {
1484114841
if (rawColor == COLOR_DEFAULT) {
14842-
mBackgroundColor = ctx.getColor(R.color.materialColorSecondary);
14842+
int[] attrs = {R.attr.materialColorSecondary};
14843+
try (TypedArray ta = obtainDayNightAttributes(ctx, attrs)) {
14844+
mBackgroundColor = getColor(ta, 0, Color.WHITE);
14845+
}
1484314846
} else {
1484414847
mBackgroundColor = rawColor;
1484514848
}
@@ -14871,25 +14874,30 @@ public void resolvePalette(Context ctx, int rawColor,
1487114874
mRippleAlpha = 0x33;
1487214875
} else {
1487314876
int[] attrs = {
14877+
R.attr.materialColorSurfaceContainerHigh,
14878+
R.attr.materialColorOnSurface,
14879+
R.attr.materialColorOnSurfaceVariant,
14880+
R.attr.materialColorPrimary,
14881+
R.attr.materialColorSecondary,
14882+
R.attr.materialColorTertiary,
14883+
R.attr.materialColorOnTertiary,
14884+
R.attr.materialColorTertiaryFixedDim,
14885+
R.attr.materialColorOnTertiaryFixed,
1487414886
R.attr.colorError,
1487514887
R.attr.colorControlHighlight
1487614888
};
14877-
14878-
mBackgroundColor = ctx.getColor(R.color.materialColorSurfaceContainerHigh);
14879-
mPrimaryTextColor = ctx.getColor(R.color.materialColorOnSurface);
14880-
mSecondaryTextColor = ctx.getColor(R.color.materialColorOnSurfaceVariant);
14881-
mPrimaryAccentColor = ctx.getColor(R.color.materialColorPrimary);
14882-
mSecondaryAccentColor = ctx.getColor(R.color.materialColorSecondary);
14883-
mTertiaryAccentColor = ctx.getColor(R.color.materialColorTertiary);
14884-
mOnTertiaryAccentTextColor = ctx.getColor(R.color.materialColorOnTertiary);
14885-
mTertiaryFixedDimAccentColor = ctx.getColor(
14886-
R.color.materialColorTertiaryFixedDim);
14887-
mOnTertiaryFixedAccentTextColor = ctx.getColor(
14888-
R.color.materialColorOnTertiaryFixed);
14889-
1489014889
try (TypedArray ta = obtainDayNightAttributes(ctx, attrs)) {
14891-
mErrorColor = getColor(ta, 0, COLOR_INVALID);
14892-
mRippleAlpha = Color.alpha(getColor(ta, 1, 0x33ffffff));
14890+
mBackgroundColor = getColor(ta, 0, nightMode ? Color.BLACK : Color.WHITE);
14891+
mPrimaryTextColor = getColor(ta, 1, COLOR_INVALID);
14892+
mSecondaryTextColor = getColor(ta, 2, COLOR_INVALID);
14893+
mPrimaryAccentColor = getColor(ta, 3, COLOR_INVALID);
14894+
mSecondaryAccentColor = getColor(ta, 4, COLOR_INVALID);
14895+
mTertiaryAccentColor = getColor(ta, 5, COLOR_INVALID);
14896+
mOnTertiaryAccentTextColor = getColor(ta, 6, COLOR_INVALID);
14897+
mTertiaryFixedDimAccentColor = getColor(ta, 7, COLOR_INVALID);
14898+
mOnTertiaryFixedAccentTextColor = getColor(ta, 8, COLOR_INVALID);
14899+
mErrorColor = getColor(ta, 9, COLOR_INVALID);
14900+
mRippleAlpha = Color.alpha(getColor(ta, 10, 0x33ffffff));
1489314901
}
1489414902
mContrastColor = calculateContrastColor(ctx, rawColor, mPrimaryAccentColor,
1489514903
mBackgroundColor, nightMode);

core/java/android/content/res/flags.aconfig

+8
Original file line numberDiff line numberDiff line change
@@ -114,3 +114,11 @@ flag {
114114
bug: "373535266"
115115
is_fixed_read_only: true
116116
}
117+
118+
flag {
119+
name: "self_targeting_android_resource_frro"
120+
is_exported: true
121+
namespace: "customization_picker"
122+
description: "Fixes bug in Launcher preview by enabling overlays targeting 'android'"
123+
bug: "377545987"
124+
}

core/java/android/content/res/loader/ResourcesProvider.java

+5
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import android.content.pm.ApplicationInfo;
2626
import android.content.res.ApkAssets;
2727
import android.content.res.AssetFileDescriptor;
28+
import android.content.res.Flags;
2829
import android.os.ParcelFileDescriptor;
2930
import android.util.Log;
3031

@@ -90,6 +91,10 @@ public static ResourcesProvider loadOverlay(@NonNull OverlayInfo overlayInfo)
9091
throws IOException {
9192
Objects.requireNonNull(overlayInfo);
9293
Preconditions.checkArgument(overlayInfo.isFabricated(), "Not accepted overlay");
94+
if (!Flags.selfTargetingAndroidResourceFrro()) {
95+
Preconditions.checkStringNotEmpty(
96+
overlayInfo.getTargetOverlayableName(), "Without overlayable name");
97+
}
9398
final String overlayName =
9499
OverlayManagerImpl.checkOverlayNameValid(overlayInfo.getOverlayName());
95100
final String path =

core/java/android/os/IHintManager.aidl

+11-23
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,11 @@ import android.os.CpuHeadroomParamsInternal;
2121
import android.os.GpuHeadroomParamsInternal;
2222
import android.os.IHintSession;
2323
import android.os.SessionCreationConfig;
24-
25-
import android.hardware.power.ChannelConfig;
2624
import android.hardware.power.CpuHeadroomResult;
25+
import android.hardware.power.ChannelConfig;
2726
import android.hardware.power.GpuHeadroomResult;
2827
import android.hardware.power.SessionConfig;
2928
import android.hardware.power.SessionTag;
30-
import android.hardware.power.SupportInfo;
3129

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

43+
/**
44+
* Get preferred rate limit in nanoseconds.
45+
*/
46+
long getHintSessionPreferredRate();
47+
4548
void setHintSessionThreads(in IHintSession hintSession, in int[] tids);
4649
int[] getHintSessionThreadIds(in IHintSession hintSession);
4750

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

6063
/**
61-
* Used by the JNI to pass an interface to the SessionManager;
62-
* for internal use only.
64+
* Get Maximum number of graphics pipeline threads allowed per-app.
6365
*/
64-
oneway void passSessionManagerBinder(in IBinder sessionManager);
65-
66-
parcelable HintManagerClientData {
67-
int powerHalVersion;
68-
int maxGraphicsPipelineThreads;
69-
long preferredRateNanos;
70-
SupportInfo supportInfo;
71-
}
72-
73-
interface IHintManagerClient {
74-
/**
75-
* Returns FMQ channel information for the caller, which it associates to the callback binder lifespan.
76-
*/
77-
oneway void receiveChannelConfig(in ChannelConfig config);
78-
}
66+
int getMaxGraphicsPipelineThreadsCount();
7967

8068
/**
81-
* Set up an ADPF client, receiving a remote client binder interface and
82-
* passing back a bundle of support and configuration information.
69+
* Used by the JNI to pass an interface to the SessionManager;
70+
* for internal use only.
8371
*/
84-
HintManagerClientData registerClient(in IHintManagerClient client);
72+
oneway void passSessionManagerBinder(in IBinder sessionManager);
8573
}

core/java/android/view/inputmethod/InputMethodManager.java

+20-21
Original file line numberDiff line numberDiff line change
@@ -938,27 +938,6 @@ public void onWindowLostFocus(@NonNull ViewRootImpl viewRootImpl) {
938938
synchronized (mH) {
939939
if (mCurRootView == viewRootImpl) {
940940
mCurRootViewWindowFocused = false;
941-
942-
if (Flags.refactorInsetsController() && mCurRootView != null) {
943-
final int softInputMode = mCurRootView.mWindowAttributes.softInputMode;
944-
final int state =
945-
softInputMode & WindowManager.LayoutParams.SOFT_INPUT_MASK_STATE;
946-
if (state == WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN) {
947-
// when losing focus (e.g., by going to another window), we reset the
948-
// requestedVisibleTypes of WindowInsetsController by hiding the IME
949-
final var statsToken = ImeTracker.forLogging().onStart(
950-
ImeTracker.TYPE_HIDE, ImeTracker.ORIGIN_CLIENT,
951-
SoftInputShowHideReason.REASON_HIDE_WINDOW_LOST_FOCUS,
952-
false /* fromUser */);
953-
if (DEBUG) {
954-
Log.d(TAG, "onWindowLostFocus, hiding IME because "
955-
+ "of STATE_ALWAYS_HIDDEN");
956-
}
957-
mCurRootView.getInsetsController().hide(WindowInsets.Type.ime(),
958-
false /* fromIme */, statsToken);
959-
}
960-
}
961-
962941
clearCurRootViewIfNeeded();
963942
}
964943
}
@@ -1012,6 +991,26 @@ public void onWindowDismissed(ViewRootImpl viewRootImpl) {
1012991
@GuardedBy("mH")
1013992
private void setCurrentRootViewLocked(ViewRootImpl rootView) {
1014993
final boolean wasEmpty = mCurRootView == null;
994+
if (Flags.refactorInsetsController() && !wasEmpty && mCurRootView != rootView) {
995+
final int softInputMode = mCurRootView.mWindowAttributes.softInputMode;
996+
final int state =
997+
softInputMode & WindowManager.LayoutParams.SOFT_INPUT_MASK_STATE;
998+
if (state == WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN) {
999+
// when losing input focus (e.g., by going to another window), we reset the
1000+
// requestedVisibleTypes of WindowInsetsController by hiding the IME
1001+
final var statsToken = ImeTracker.forLogging().onStart(
1002+
ImeTracker.TYPE_HIDE, ImeTracker.ORIGIN_CLIENT,
1003+
SoftInputShowHideReason.HIDE_WINDOW_LOST_FOCUS,
1004+
false /* fromUser */);
1005+
if (DEBUG) {
1006+
Log.d(TAG, "setCurrentRootViewLocked, hiding IME because "
1007+
+ "of STATE_ALWAYS_HIDDEN");
1008+
}
1009+
mCurRootView.getInsetsController().hide(WindowInsets.Type.ime(),
1010+
false /* fromIme */, statsToken);
1011+
}
1012+
}
1013+
10151014
mImeDispatcher.switchRootView(mCurRootView, rootView);
10161015
mCurRootView = rootView;
10171016
if (wasEmpty && mCurRootView != null) {

core/java/android/widget/RemoteViews.java

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import static android.appwidget.flags.Flags.FLAG_REMOTE_VIEWS_PROTO;
2121
import static android.appwidget.flags.Flags.drawDataParcel;
2222
import static android.appwidget.flags.Flags.remoteAdapterConversion;
23+
import static android.content.res.Flags.FLAG_SELF_TARGETING_ANDROID_RESOURCE_FRRO;
2324
import static android.util.TypedValue.TYPE_INT_COLOR_ARGB8;
2425
import static android.util.proto.ProtoInputStream.NO_MORE_FIELDS;
2526
import static android.view.inputmethod.Flags.FLAG_HOME_SCREEN_HANDWRITING_DELEGATOR;
@@ -8698,6 +8699,7 @@ public static ColorResources create(Context context, SparseIntArray colorMapping
86988699
*
86998700
* @hide
87008701
*/
8702+
@FlaggedApi(FLAG_SELF_TARGETING_ANDROID_RESOURCE_FRRO)
87018703
@Nullable
87028704
public static ColorResources createWithOverlay(Context context,
87038705
SparseIntArray colorMapping) {

core/java/android/window/WindowTokenClientController.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535

3636
import com.android.internal.annotations.GuardedBy;
3737
import com.android.internal.annotations.VisibleForTesting;
38+
import com.android.window.flags.Flags;
3839

3940
/**
4041
* Singleton controller to manage the attached {@link WindowTokenClient}s, and to dispatch
@@ -137,7 +138,9 @@ public boolean attachToDisplayContent(@NonNull WindowTokenClient client, int dis
137138
// is initialized later, the SystemUiContext will start reporting from
138139
// DisplayContent#registerSystemUiContext, and WindowTokenClientController can report
139140
// the Configuration to the correct client.
140-
recordWindowContextToken(client);
141+
if (Flags.trackSystemUiContextBeforeWms()) {
142+
recordWindowContextToken(client);
143+
}
141144
return false;
142145
}
143146
final WindowContextInfo info;

core/java/android/window/flags/windowing_sdk.aconfig

+11
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,14 @@ flag {
127127
purpose: PURPOSE_BUGFIX
128128
}
129129
}
130+
131+
flag {
132+
namespace: "windowing_sdk"
133+
name: "track_system_ui_context_before_wms"
134+
description: "Keep track of SystemUiContext before WMS is initialized"
135+
bug: "384428048"
136+
is_fixed_read_only: true
137+
metadata {
138+
purpose: PURPOSE_BUGFIX
139+
}
140+
}

core/java/com/android/internal/content/om/OverlayManagerImpl.java

+11-3
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import android.content.pm.PackageManager;
3737
import android.content.pm.parsing.FrameworkParsingPackageUtils;
3838
import android.content.res.AssetManager;
39+
import android.content.res.Flags;
3940
import android.os.FabricatedOverlayInfo;
4041
import android.os.FabricatedOverlayInternal;
4142
import android.os.FabricatedOverlayInternalEntry;
@@ -235,17 +236,24 @@ public void registerFabricatedOverlay(@NonNull FabricatedOverlayInternal overlay
235236
Preconditions.checkArgument(!entryList.isEmpty(), "overlay entries shouldn't be empty");
236237
final String overlayName = checkOverlayNameValid(overlayInternal.overlayName);
237238
checkPackageName(overlayInternal.packageName);
238-
Preconditions.checkStringNotEmpty(overlayInternal.targetPackageName);
239+
if (Flags.selfTargetingAndroidResourceFrro()) {
240+
Preconditions.checkStringNotEmpty(overlayInternal.targetPackageName);
241+
} else {
242+
checkPackageName(overlayInternal.targetPackageName);
243+
Preconditions.checkStringNotEmpty(
244+
overlayInternal.targetOverlayable,
245+
"Target overlayable should be neither null nor empty string.");
246+
}
239247

240248
final ApplicationInfo applicationInfo = mContext.getApplicationInfo();
241249
String targetPackage = null;
242-
if (TextUtils.equals(overlayInternal.targetPackageName, "android")) {
250+
if (Flags.selfTargetingAndroidResourceFrro() && TextUtils.equals(
251+
overlayInternal.targetPackageName, "android")) {
243252
targetPackage = AssetManager.FRAMEWORK_APK_PATH;
244253
} else {
245254
targetPackage = Preconditions.checkStringNotEmpty(
246255
applicationInfo.getBaseCodePath());
247256
}
248-
249257
final Path frroPath = mBasePath.resolve(overlayName + FRRO_EXTENSION);
250258
final Path idmapPath = mBasePath.resolve(overlayName + IDMAP_EXTENSION);
251259

core/java/com/android/internal/inputmethod/InputMethodDebug.java

+6
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,12 @@ public static String softInputDisplayReasonToString(@SoftInputShowHideReason int
299299
return "SHOW_SOFT_INPUT_IMM_DEPRECATION";
300300
case SoftInputShowHideReason.CONTROL_WINDOW_INSETS_ANIMATION:
301301
return "CONTROL_WINDOW_INSETS_ANIMATION";
302+
case SoftInputShowHideReason.SHOW_INPUT_TARGET_CHANGED:
303+
return "SHOW_INPUT_TARGET_CHANGED";
304+
case SoftInputShowHideReason.HIDE_INPUT_TARGET_CHANGED:
305+
return "HIDE_INPUT_TARGET_CHANGED";
306+
case SoftInputShowHideReason.HIDE_WINDOW_LOST_FOCUS:
307+
return "HIDE_WINDOW_LOST_FOCUS";
302308
default:
303309
return "Unknown=" + reason;
304310
}

core/java/com/android/internal/inputmethod/SoftInputShowHideReason.java

+14-14
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
SoftInputShowHideReason.CONTROL_WINDOW_INSETS_ANIMATION,
9292
SoftInputShowHideReason.SHOW_INPUT_TARGET_CHANGED,
9393
SoftInputShowHideReason.HIDE_INPUT_TARGET_CHANGED,
94-
SoftInputShowHideReason.REASON_HIDE_WINDOW_LOST_FOCUS,
94+
SoftInputShowHideReason.HIDE_WINDOW_LOST_FOCUS,
9595
})
9696
public @interface SoftInputShowHideReason {
9797
/** Default, undefined reason. */
@@ -339,18 +339,6 @@
339339
*/
340340
int HIDE_WINDOW_LEGACY_DIRECT = ImeProtoEnums.REASON_HIDE_WINDOW_LEGACY_DIRECT;
341341

342-
/**
343-
* Show soft input because the input target changed
344-
* {@link com.android.server.wm.ImeInsetsSourceProvider#onInputTargetChanged}.
345-
*/
346-
int SHOW_INPUT_TARGET_CHANGED = ImeProtoEnums.REASON_SHOW_INPUT_TARGET_CHANGED;
347-
348-
/**
349-
* Hide soft input because the input target changed by
350-
* {@link com.android.server.wm.ImeInsetsSourceProvider#onInputTargetChanged}.
351-
*/
352-
int HIDE_INPUT_TARGET_CHANGED = ImeProtoEnums.REASON_HIDE_INPUT_TARGET_CHANGED;
353-
354342
/**
355343
* Show / Hide soft input by
356344
* {@link android.inputmethodservice.InputMethodService#resetStateForNewConfiguration}.
@@ -420,6 +408,18 @@
420408
*/
421409
int CONTROL_WINDOW_INSETS_ANIMATION = ImeProtoEnums.REASON_CONTROL_WINDOW_INSETS_ANIMATION;
422410

411+
/**
412+
* Show soft input because the input target changed
413+
* {@link com.android.server.wm.ImeInsetsSourceProvider#onInputTargetChanged}.
414+
*/
415+
int SHOW_INPUT_TARGET_CHANGED = ImeProtoEnums.REASON_SHOW_INPUT_TARGET_CHANGED;
416+
417+
/**
418+
* Hide soft input because the input target changed by
419+
* {@link com.android.server.wm.ImeInsetsSourceProvider#onInputTargetChanged}.
420+
*/
421+
int HIDE_INPUT_TARGET_CHANGED = ImeProtoEnums.REASON_HIDE_INPUT_TARGET_CHANGED;
422+
423423
/** Hide soft input when the window lost focus. */
424-
int REASON_HIDE_WINDOW_LOST_FOCUS = ImeProtoEnums.REASON_HIDE_WINDOW_LOST_FOCUS;
424+
int HIDE_WINDOW_LOST_FOCUS = ImeProtoEnums.REASON_HIDE_WINDOW_LOST_FOCUS;
425425
}

core/res/res/color-watch-v36/btn_material_filled_background_color.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
<selector xmlns:android="http://schemas.android.com/apk/res/android">
1818
<item android:state_enabled="false"
1919
android:alpha="?attr/disabledAlpha"
20-
android:color="@color/materialColorOnSurface" />
21-
<item android:color="@color/materialColorPrimary" />
20+
android:color="?attr/materialColorOnSurface" />
21+
<item android:color="?attr/materialColorPrimary" />
2222
</selector>

core/res/res/color-watch-v36/btn_material_filled_content_color.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
<selector xmlns:android="http://schemas.android.com/apk/res/android">
1818
<item android:state_enabled="false"
1919
android:alpha="?attr/primaryContentAlpha"
20-
android:color="@color/materialColorOnSurface" />
21-
<item android:color="@color/materialColorOnPrimary" />
20+
android:color="?attr/materialColorOnSurface" />
21+
<item android:color="?attr/materialColorOnPrimary" />
2222
</selector>

core/res/res/color-watch-v36/btn_material_filled_tonal_background_color.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
<selector xmlns:android="http://schemas.android.com/apk/res/android">
1818
<item android:state_enabled="false"
1919
android:alpha="?attr/disabledAlpha"
20-
android:color="@color/materialColorOnSurface" />
21-
<item android:color="@color/materialColorSurfaceContainer" />
20+
android:color="?attr/materialColorOnSurface" />
21+
<item android:color="?attr/materialColorSurfaceContainer" />
2222
</selector>

core/res/res/color-watch-v36/btn_material_filled_tonal_content_color.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
<selector xmlns:android="http://schemas.android.com/apk/res/android">
1818
<item android:state_enabled="false"
1919
android:alpha="?attr/primaryContentAlpha"
20-
android:color="@color/materialColorOnSurface" />
21-
<item android:color="@color/materialColorOnSurface" />
20+
android:color="?attr/materialColorOnSurface" />
21+
<item android:color="?attr/materialColorOnSurface" />
2222
</selector>

0 commit comments

Comments
 (0)