Loading core/java/android/app/ActivityThread.java +6 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ import static android.view.Display.INVALID_DISPLAY; import static android.window.ConfigurationHelper.freeTextLayoutCachesIfNeeded; import static android.window.ConfigurationHelper.isDifferentDisplay; import static android.window.ConfigurationHelper.shouldUpdateResources; import static android.window.ConfigurationHelper.shouldUpdateWindowMetricsBounds; import static com.android.internal.annotations.VisibleForTesting.Visibility.PACKAGE; Loading Loading @@ -5987,6 +5988,11 @@ public final class ActivityThread extends ClientTransactionHandler public static boolean shouldReportChange(@Nullable Configuration currentConfig, @NonNull Configuration newConfig, @Nullable SizeConfigurationBuckets sizeBuckets, int handledConfigChanges) { // Always report changes in window configuration bounds if (shouldUpdateWindowMetricsBounds(currentConfig, newConfig)) { return true; } final int publicDiff = currentConfig.diffPublicOnly(newConfig); // Don't report the change if there's no public diff between current and new config. if (publicDiff == 0) { Loading core/java/android/app/Notification.java +6 −0 Original line number Diff line number Diff line Loading @@ -2807,6 +2807,10 @@ public class Notification implements Parcelable * @hide */ public void visitUris(@NonNull Consumer<Uri> visitor) { if (publicVersion != null) { publicVersion.visitUris(visitor); } visitor.accept(sound); if (tickerView != null) tickerView.visitUris(visitor); Loading Loading @@ -2892,6 +2896,8 @@ public class Notification implements Parcelable } } } visitIconUri(visitor, extras.getParcelable(EXTRA_CONVERSATION_ICON)); } if (isStyle(CallStyle.class) & extras != null) { Loading core/java/android/app/admin/DevicePolicyManager.java +2 −1 Original line number Diff line number Diff line Loading @@ -12402,7 +12402,8 @@ public class DevicePolicyManager { /** * Called by a device admin to set the long support message. This will be displayed to the user * in the device administators settings screen. * in the device administrators settings screen. If the message is longer than 20000 characters * it may be truncated. * <p> * If the long support message needs to be localized, it is the responsibility of the * {@link DeviceAdminReceiver} to listen to the {@link Intent#ACTION_LOCALE_CHANGED} broadcast core/java/android/service/wallpaper/WallpaperService.java +57 −10 Original line number Diff line number Diff line Loading @@ -112,6 +112,7 @@ import java.util.Objects; import java.util.Set; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Supplier; /** Loading Loading @@ -433,6 +434,7 @@ public abstract class WallpaperService extends Service { Message msg = mCaller.obtainMessageIO(MSG_WINDOW_RESIZED, reportDraw ? 1 : 0, mergedConfiguration); mIWallpaperEngine.mPendingResizeCount.incrementAndGet(); mCaller.sendMessage(msg); } Loading Loading @@ -1021,6 +1023,10 @@ public abstract class WallpaperService extends Service { out.print(prefix); out.print("mZoom="); out.println(mZoom); out.print(prefix); out.print("mPreviewSurfacePosition="); out.println(mPreviewSurfacePosition); final int pendingCount = mIWallpaperEngine.mPendingResizeCount.get(); if (pendingCount != 0) { out.print(prefix); out.print("mPendingResizeCount="); out.println(pendingCount); } synchronized (mLock) { out.print(prefix); out.print("mPendingXOffset="); out.print(mPendingXOffset); out.print(" mPendingXOffset="); out.println(mPendingXOffset); Loading Loading @@ -1083,10 +1089,6 @@ public abstract class WallpaperService extends Service { } } private void updateConfiguration(MergedConfiguration mergedConfiguration) { mMergedConfiguration.setTo(mergedConfiguration); } void updateSurface(boolean forceRelayout, boolean forceReport, boolean redrawNeeded) { if (mDestroyed) { Log.w(TAG, "Ignoring updateSurface due to destroyed"); Loading Loading @@ -1135,7 +1137,7 @@ public abstract class WallpaperService extends Service { | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE; final Configuration config = mMergedConfiguration.getMergedConfiguration(); final Rect maxBounds = config.windowConfiguration.getMaxBounds(); final Rect maxBounds = new Rect(config.windowConfiguration.getMaxBounds()); if (myWidth == ViewGroup.LayoutParams.MATCH_PARENT && myHeight == ViewGroup.LayoutParams.MATCH_PARENT) { mLayout.width = myWidth; Loading Loading @@ -1195,6 +1197,17 @@ public abstract class WallpaperService extends Service { final int relayoutResult = mSession.relayout(mWindow, mLayout, mWidth, mHeight, View.VISIBLE, 0, 0, 0, mWinFrames, mMergedConfiguration, mSurfaceControl, mInsetsState, mTempControls, mSyncSeqIdBundle); final Rect outMaxBounds = mMergedConfiguration.getMergedConfiguration() .windowConfiguration.getMaxBounds(); if (!outMaxBounds.equals(maxBounds)) { Log.i(TAG, "Retry updateSurface because bounds changed from relayout: " + maxBounds + " -> " + outMaxBounds); mSurfaceHolder.mSurfaceLock.unlock(); mDrawingAllowed = false; mCaller.sendMessage(mCaller.obtainMessageI(MSG_WINDOW_RESIZED, redrawNeeded ? 1 : 0)); return; } final int transformHint = SurfaceControl.rotationToBufferTransform( (mDisplayInstallOrientation + mDisplay.getRotation()) % 4); Loading Loading @@ -1461,6 +1474,8 @@ public abstract class WallpaperService extends Service { mPreviousWallpaperDimAmount = mWallpaperDimAmount; mDisplayState = mDisplay.getCommittedState(); mDisplayInstallOrientation = mDisplay.getInstallOrientation(); mMergedConfiguration.setOverrideConfiguration( mDisplayContext.getResources().getConfiguration()); if (DEBUG) Log.v(TAG, "onCreate(): " + this); Trace.beginSection("WPMS.Engine.onCreate"); Loading Loading @@ -2262,6 +2277,8 @@ public abstract class WallpaperService extends Service { final IBinder mWindowToken; final int mWindowType; final boolean mIsPreview; final AtomicInteger mPendingResizeCount = new AtomicInteger(); boolean mReportDraw; boolean mShownReported; int mReqWidth; int mReqHeight; Loading Loading @@ -2513,11 +2530,7 @@ public abstract class WallpaperService extends Service { mEngine.doCommand(cmd); } break; case MSG_WINDOW_RESIZED: { final boolean reportDraw = message.arg1 != 0; mEngine.updateConfiguration(((MergedConfiguration) message.obj)); mEngine.updateSurface(true, false, reportDraw); mEngine.doOffsetsChanged(true); mEngine.scaleAndCropScreenshot(); handleResized((MergedConfiguration) message.obj, message.arg1 != 0); } break; case MSG_WINDOW_MOVED: { // Do nothing. What does it mean for a Wallpaper to move? Loading Loading @@ -2562,6 +2575,40 @@ public abstract class WallpaperService extends Service { Log.w(TAG, "Unknown message type " + message.what); } } /** * In general this performs relayout for IWindow#resized. If there are several pending * (in the message queue) MSG_WINDOW_RESIZED from server side, only the last one will be * handled (ignore intermediate states). Note that this procedure cannot be skipped if the * configuration is not changed because this is also used to dispatch insets changes. */ private void handleResized(MergedConfiguration config, boolean reportDraw) { // The config can be null when retrying for a changed config from relayout, otherwise // it is from IWindow#resized which always sends non-null config. final int pendingCount = config != null ? mPendingResizeCount.decrementAndGet() : -1; if (reportDraw) { mReportDraw = true; } if (pendingCount > 0) { if (DEBUG) { Log.d(TAG, "Skip outdated resize, bounds=" + config.getMergedConfiguration().windowConfiguration.getMaxBounds() + " pendingCount=" + pendingCount); } return; } if (config != null) { if (DEBUG) { Log.d(TAG, "Update config from resized, bounds=" + config.getMergedConfiguration().windowConfiguration.getMaxBounds()); } mEngine.mMergedConfiguration.setTo(config); } mEngine.updateSurface(true /* forceRelayout */, false /* forceReport */, mReportDraw); mReportDraw = false; mEngine.doOffsetsChanged(true); mEngine.scaleAndCropScreenshot(); } } /** Loading core/java/android/widget/RemoteViews.java +19 −1 Original line number Diff line number Diff line Loading @@ -726,6 +726,11 @@ public class RemoteViews implements Parcelable, Filter { mActions.get(i).visitUris(visitor); } } if (mSizedRemoteViews != null) { for (int i = 0; i < mSizedRemoteViews.size(); i++) { mSizedRemoteViews.get(i).visitUris(visitor); } } if (mLandscape != null) { mLandscape.visitUris(visitor); } Loading Loading @@ -1830,7 +1835,7 @@ public class RemoteViews implements Parcelable, Filter { } @Override public final void visitUris(@NonNull Consumer<Uri> visitor) { public void visitUris(@NonNull Consumer<Uri> visitor) { switch (this.type) { case URI: final Uri uri = (Uri) getParameterValue(null); Loading Loading @@ -2293,6 +2298,14 @@ public class RemoteViews implements Parcelable, Filter { public int getActionTag() { return NIGHT_MODE_REFLECTION_ACTION_TAG; } @Override public void visitUris(@NonNull Consumer<Uri> visitor) { if (this.type == ICON) { visitIconUri((Icon) mDarkValue, visitor); visitIconUri((Icon) mLightValue, visitor); } } } /** Loading Loading @@ -2583,6 +2596,11 @@ public class RemoteViews implements Parcelable, Filter { public int getActionTag() { return VIEW_GROUP_ACTION_ADD_TAG; } @Override public final void visitUris(@NonNull Consumer<Uri> visitor) { mNestedViews.visitUris(visitor); } } /** Loading Loading
core/java/android/app/ActivityThread.java +6 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ import static android.view.Display.INVALID_DISPLAY; import static android.window.ConfigurationHelper.freeTextLayoutCachesIfNeeded; import static android.window.ConfigurationHelper.isDifferentDisplay; import static android.window.ConfigurationHelper.shouldUpdateResources; import static android.window.ConfigurationHelper.shouldUpdateWindowMetricsBounds; import static com.android.internal.annotations.VisibleForTesting.Visibility.PACKAGE; Loading Loading @@ -5987,6 +5988,11 @@ public final class ActivityThread extends ClientTransactionHandler public static boolean shouldReportChange(@Nullable Configuration currentConfig, @NonNull Configuration newConfig, @Nullable SizeConfigurationBuckets sizeBuckets, int handledConfigChanges) { // Always report changes in window configuration bounds if (shouldUpdateWindowMetricsBounds(currentConfig, newConfig)) { return true; } final int publicDiff = currentConfig.diffPublicOnly(newConfig); // Don't report the change if there's no public diff between current and new config. if (publicDiff == 0) { Loading
core/java/android/app/Notification.java +6 −0 Original line number Diff line number Diff line Loading @@ -2807,6 +2807,10 @@ public class Notification implements Parcelable * @hide */ public void visitUris(@NonNull Consumer<Uri> visitor) { if (publicVersion != null) { publicVersion.visitUris(visitor); } visitor.accept(sound); if (tickerView != null) tickerView.visitUris(visitor); Loading Loading @@ -2892,6 +2896,8 @@ public class Notification implements Parcelable } } } visitIconUri(visitor, extras.getParcelable(EXTRA_CONVERSATION_ICON)); } if (isStyle(CallStyle.class) & extras != null) { Loading
core/java/android/app/admin/DevicePolicyManager.java +2 −1 Original line number Diff line number Diff line Loading @@ -12402,7 +12402,8 @@ public class DevicePolicyManager { /** * Called by a device admin to set the long support message. This will be displayed to the user * in the device administators settings screen. * in the device administrators settings screen. If the message is longer than 20000 characters * it may be truncated. * <p> * If the long support message needs to be localized, it is the responsibility of the * {@link DeviceAdminReceiver} to listen to the {@link Intent#ACTION_LOCALE_CHANGED} broadcast
core/java/android/service/wallpaper/WallpaperService.java +57 −10 Original line number Diff line number Diff line Loading @@ -112,6 +112,7 @@ import java.util.Objects; import java.util.Set; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Supplier; /** Loading Loading @@ -433,6 +434,7 @@ public abstract class WallpaperService extends Service { Message msg = mCaller.obtainMessageIO(MSG_WINDOW_RESIZED, reportDraw ? 1 : 0, mergedConfiguration); mIWallpaperEngine.mPendingResizeCount.incrementAndGet(); mCaller.sendMessage(msg); } Loading Loading @@ -1021,6 +1023,10 @@ public abstract class WallpaperService extends Service { out.print(prefix); out.print("mZoom="); out.println(mZoom); out.print(prefix); out.print("mPreviewSurfacePosition="); out.println(mPreviewSurfacePosition); final int pendingCount = mIWallpaperEngine.mPendingResizeCount.get(); if (pendingCount != 0) { out.print(prefix); out.print("mPendingResizeCount="); out.println(pendingCount); } synchronized (mLock) { out.print(prefix); out.print("mPendingXOffset="); out.print(mPendingXOffset); out.print(" mPendingXOffset="); out.println(mPendingXOffset); Loading Loading @@ -1083,10 +1089,6 @@ public abstract class WallpaperService extends Service { } } private void updateConfiguration(MergedConfiguration mergedConfiguration) { mMergedConfiguration.setTo(mergedConfiguration); } void updateSurface(boolean forceRelayout, boolean forceReport, boolean redrawNeeded) { if (mDestroyed) { Log.w(TAG, "Ignoring updateSurface due to destroyed"); Loading Loading @@ -1135,7 +1137,7 @@ public abstract class WallpaperService extends Service { | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE; final Configuration config = mMergedConfiguration.getMergedConfiguration(); final Rect maxBounds = config.windowConfiguration.getMaxBounds(); final Rect maxBounds = new Rect(config.windowConfiguration.getMaxBounds()); if (myWidth == ViewGroup.LayoutParams.MATCH_PARENT && myHeight == ViewGroup.LayoutParams.MATCH_PARENT) { mLayout.width = myWidth; Loading Loading @@ -1195,6 +1197,17 @@ public abstract class WallpaperService extends Service { final int relayoutResult = mSession.relayout(mWindow, mLayout, mWidth, mHeight, View.VISIBLE, 0, 0, 0, mWinFrames, mMergedConfiguration, mSurfaceControl, mInsetsState, mTempControls, mSyncSeqIdBundle); final Rect outMaxBounds = mMergedConfiguration.getMergedConfiguration() .windowConfiguration.getMaxBounds(); if (!outMaxBounds.equals(maxBounds)) { Log.i(TAG, "Retry updateSurface because bounds changed from relayout: " + maxBounds + " -> " + outMaxBounds); mSurfaceHolder.mSurfaceLock.unlock(); mDrawingAllowed = false; mCaller.sendMessage(mCaller.obtainMessageI(MSG_WINDOW_RESIZED, redrawNeeded ? 1 : 0)); return; } final int transformHint = SurfaceControl.rotationToBufferTransform( (mDisplayInstallOrientation + mDisplay.getRotation()) % 4); Loading Loading @@ -1461,6 +1474,8 @@ public abstract class WallpaperService extends Service { mPreviousWallpaperDimAmount = mWallpaperDimAmount; mDisplayState = mDisplay.getCommittedState(); mDisplayInstallOrientation = mDisplay.getInstallOrientation(); mMergedConfiguration.setOverrideConfiguration( mDisplayContext.getResources().getConfiguration()); if (DEBUG) Log.v(TAG, "onCreate(): " + this); Trace.beginSection("WPMS.Engine.onCreate"); Loading Loading @@ -2262,6 +2277,8 @@ public abstract class WallpaperService extends Service { final IBinder mWindowToken; final int mWindowType; final boolean mIsPreview; final AtomicInteger mPendingResizeCount = new AtomicInteger(); boolean mReportDraw; boolean mShownReported; int mReqWidth; int mReqHeight; Loading Loading @@ -2513,11 +2530,7 @@ public abstract class WallpaperService extends Service { mEngine.doCommand(cmd); } break; case MSG_WINDOW_RESIZED: { final boolean reportDraw = message.arg1 != 0; mEngine.updateConfiguration(((MergedConfiguration) message.obj)); mEngine.updateSurface(true, false, reportDraw); mEngine.doOffsetsChanged(true); mEngine.scaleAndCropScreenshot(); handleResized((MergedConfiguration) message.obj, message.arg1 != 0); } break; case MSG_WINDOW_MOVED: { // Do nothing. What does it mean for a Wallpaper to move? Loading Loading @@ -2562,6 +2575,40 @@ public abstract class WallpaperService extends Service { Log.w(TAG, "Unknown message type " + message.what); } } /** * In general this performs relayout for IWindow#resized. If there are several pending * (in the message queue) MSG_WINDOW_RESIZED from server side, only the last one will be * handled (ignore intermediate states). Note that this procedure cannot be skipped if the * configuration is not changed because this is also used to dispatch insets changes. */ private void handleResized(MergedConfiguration config, boolean reportDraw) { // The config can be null when retrying for a changed config from relayout, otherwise // it is from IWindow#resized which always sends non-null config. final int pendingCount = config != null ? mPendingResizeCount.decrementAndGet() : -1; if (reportDraw) { mReportDraw = true; } if (pendingCount > 0) { if (DEBUG) { Log.d(TAG, "Skip outdated resize, bounds=" + config.getMergedConfiguration().windowConfiguration.getMaxBounds() + " pendingCount=" + pendingCount); } return; } if (config != null) { if (DEBUG) { Log.d(TAG, "Update config from resized, bounds=" + config.getMergedConfiguration().windowConfiguration.getMaxBounds()); } mEngine.mMergedConfiguration.setTo(config); } mEngine.updateSurface(true /* forceRelayout */, false /* forceReport */, mReportDraw); mReportDraw = false; mEngine.doOffsetsChanged(true); mEngine.scaleAndCropScreenshot(); } } /** Loading
core/java/android/widget/RemoteViews.java +19 −1 Original line number Diff line number Diff line Loading @@ -726,6 +726,11 @@ public class RemoteViews implements Parcelable, Filter { mActions.get(i).visitUris(visitor); } } if (mSizedRemoteViews != null) { for (int i = 0; i < mSizedRemoteViews.size(); i++) { mSizedRemoteViews.get(i).visitUris(visitor); } } if (mLandscape != null) { mLandscape.visitUris(visitor); } Loading Loading @@ -1830,7 +1835,7 @@ public class RemoteViews implements Parcelable, Filter { } @Override public final void visitUris(@NonNull Consumer<Uri> visitor) { public void visitUris(@NonNull Consumer<Uri> visitor) { switch (this.type) { case URI: final Uri uri = (Uri) getParameterValue(null); Loading Loading @@ -2293,6 +2298,14 @@ public class RemoteViews implements Parcelable, Filter { public int getActionTag() { return NIGHT_MODE_REFLECTION_ACTION_TAG; } @Override public void visitUris(@NonNull Consumer<Uri> visitor) { if (this.type == ICON) { visitIconUri((Icon) mDarkValue, visitor); visitIconUri((Icon) mLightValue, visitor); } } } /** Loading Loading @@ -2583,6 +2596,11 @@ public class RemoteViews implements Parcelable, Filter { public int getActionTag() { return VIEW_GROUP_ACTION_ADD_TAG; } @Override public final void visitUris(@NonNull Consumer<Uri> visitor) { mNestedViews.visitUris(visitor); } } /** Loading