diff options
11 files changed, 69 insertions, 9 deletions
diff --git a/core/java/android/app/ActivityManager.java b/core/java/android/app/ActivityManager.java index f9ec214390f9..b38f5da6b638 100644 --- a/core/java/android/app/ActivityManager.java +++ b/core/java/android/app/ActivityManager.java @@ -4975,6 +4975,25 @@ public class ActivityManager { } /** + * Fully stop the given app's processes without restoring service starts or + * bindings, but without the other durable effects of the full-scale + * "force stop" intervention. + * + * @param packageName The name of the package to be stopped. + * + * @hide This is not available to third party applications due to + * it allowing them to break other applications by stopping their + * services. + */ + public void stopPackageForUser(String packageName) { + try { + getService().stopAppForUser(packageName, mContext.getUserId()); + } catch (RemoteException e) { + throw e.rethrowFromSystemServer(); + } + } + + /** * Sets the current locales of the device. Calling app must have the permission * {@code android.permission.CHANGE_CONFIGURATION} and * {@code android.permission.WRITE_SETTINGS}. diff --git a/core/java/android/os/CombinedMessageQueue/MessageQueue.java b/core/java/android/os/CombinedMessageQueue/MessageQueue.java index 8f77699458a5..0964cde5a1f4 100644 --- a/core/java/android/os/CombinedMessageQueue/MessageQueue.java +++ b/core/java/android/os/CombinedMessageQueue/MessageQueue.java @@ -144,11 +144,6 @@ public final class MessageQueue { return; } - if (RavenwoodEnvironment.getInstance().isRunningOnRavenwood()) { - sIsProcessAllowedToUseConcurrent = false; - return; - } - if (Flags.forceConcurrentMessageQueue()) { sIsProcessAllowedToUseConcurrent = true; return; diff --git a/core/java/android/os/Process.java b/core/java/android/os/Process.java index 0c5d9e97a77d..b68b9a7af5e2 100644 --- a/core/java/android/os/Process.java +++ b/core/java/android/os/Process.java @@ -1347,6 +1347,7 @@ public class Process { * Return the name of this process. By default, the process name is the same as the app's * package name, but this can be changed using {@code android:process}. */ + @RavenwoodReplace @NonNull public static String myProcessName() { // Note this could be different from the actual process name if someone changes the @@ -1355,6 +1356,12 @@ public class Process { return sArgV0; } + /** @hide */ + @NonNull + public static String myProcessName$ravenwood() { + return "ravenwood"; + } + /** * Kill the process with the given PID. * Note that, though this API allows us to request to diff --git a/core/java/android/window/flags/lse_desktop_experience.aconfig b/core/java/android/window/flags/lse_desktop_experience.aconfig index 831a9dfc141b..b408d0b27563 100644 --- a/core/java/android/window/flags/lse_desktop_experience.aconfig +++ b/core/java/android/window/flags/lse_desktop_experience.aconfig @@ -875,3 +875,10 @@ flag { purpose: PURPOSE_BUGFIX } } + +flag { + name: "enable_size_compat_mode_improvements_for_connected_displays" + namespace: "lse_desktop_experience" + description: "Enable some improvements in size compat mode for connected displays." + bug: "399752440" +} diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml index e16ce9849ff2..36b65ba43162 100644 --- a/core/res/AndroidManifest.xml +++ b/core/res/AndroidManifest.xml @@ -9292,6 +9292,9 @@ <action android:name="android.intent.action.UPDATE_PINS" /> <data android:scheme="content" android:host="*" android:mimeType="*/*" /> </intent-filter> + <intent-filter> + <action android:name="android.intent.action.BOOT_COMPLETED" /> + </intent-filter> </receiver> <receiver android:name="com.android.server.updates.IntentFirewallInstallReceiver" diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java index 30e5c2ae0914..2a5315739396 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java @@ -1702,6 +1702,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin mExclusionRegionListener.onExclusionRegionDismissed(mTaskInfo.taskId); disposeResizeVeil(); disposeStatusBarInputLayer(); + mWindowDecorViewHolder.close(); mWindowDecorViewHolder = null; if (canEnterDesktopMode(mContext) && isEducationEnabled()) { notifyNoCaptionHandle(); diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/viewholder/AppHandleViewHolder.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/viewholder/AppHandleViewHolder.kt index 2948fdaf16af..d9df899f8b40 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/viewholder/AppHandleViewHolder.kt +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/viewholder/AppHandleViewHolder.kt @@ -274,4 +274,6 @@ internal class AppHandleViewHolder( } animator.start() } + + override fun close() {} } diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/viewholder/AppHeaderViewHolder.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/viewholder/AppHeaderViewHolder.kt index eb8b617df4ce..8b054335d11c 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/viewholder/AppHeaderViewHolder.kt +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/viewholder/AppHeaderViewHolder.kt @@ -725,6 +725,11 @@ class AppHeaderViewHolder( Configuration.UI_MODE_NIGHT_YES } + override fun close() { + // Should not fire long press events after closing the window decoration. + maximizeWindowButton.cancelLongPress() + } + companion object { private const val TAG = "DesktopModeAppControlsWindowDecorationViewHolder" diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/viewholder/WindowDecorationViewHolder.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/viewholder/WindowDecorationViewHolder.kt index 1fe743da966a..cd202bfbd29e 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/viewholder/WindowDecorationViewHolder.kt +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/viewholder/WindowDecorationViewHolder.kt @@ -24,7 +24,7 @@ import com.android.wm.shell.windowdecor.viewholder.WindowDecorationViewHolder.Da * Encapsulates the root [View] of a window decoration and its children to facilitate looking up * children (via findViewById) and updating to the latest data from [RunningTaskInfo]. */ -abstract class WindowDecorationViewHolder<T : Data>(rootView: View) { +abstract class WindowDecorationViewHolder<T : Data>(rootView: View) : AutoCloseable { val context: Context = rootView.context /** @@ -39,6 +39,9 @@ abstract class WindowDecorationViewHolder<T : Data>(rootView: View) { /** Callback when the handle menu is closed. */ abstract fun onHandleMenuClosed() + /** Callback when the window decoration is destroyed. */ + abstract override fun close() + /** Data clas that contains the information needed to update the view holder. */ abstract class Data } diff --git a/services/core/java/com/android/server/updates/CertPinInstallReceiver.java b/services/core/java/com/android/server/updates/CertPinInstallReceiver.java index 250e99b47b1a..c8e7a8dea5c3 100644 --- a/services/core/java/com/android/server/updates/CertPinInstallReceiver.java +++ b/services/core/java/com/android/server/updates/CertPinInstallReceiver.java @@ -19,7 +19,10 @@ package com.android.server.updates; import android.content.Context; import android.content.Intent; +import java.io.File; + public class CertPinInstallReceiver extends ConfigUpdateInstallReceiver { + private static final String KEYCHAIN_DIR = "/data/misc/keychain/"; public CertPinInstallReceiver() { super("/data/misc/keychain/", "pins", "metadata/", "version"); @@ -27,7 +30,22 @@ public class CertPinInstallReceiver extends ConfigUpdateInstallReceiver { @Override public void onReceive(final Context context, final Intent intent) { - if (!com.android.server.flags.Flags.certpininstallerRemoval()) { + if (Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction())) { + if (com.android.server.flags.Flags.certpininstallerRemoval()) { + File pins = new File(KEYCHAIN_DIR + "pins"); + if (pins.exists()) { + pins.delete(); + } + File version = new File(KEYCHAIN_DIR + "metadata/version"); + if (version.exists()) { + version.delete(); + } + File metadata = new File(KEYCHAIN_DIR + "metadata"); + if (metadata.exists()) { + metadata.delete(); + } + } + } else if (!com.android.server.flags.Flags.certpininstallerRemoval()) { super.onReceive(context, intent); } } diff --git a/services/tests/servicestests/src/com/android/server/locales/LocaleManagerBackupRestoreTest.java b/services/tests/servicestests/src/com/android/server/locales/LocaleManagerBackupRestoreTest.java index 50cfa753ebdb..57e9cf4bf48b 100644 --- a/services/tests/servicestests/src/com/android/server/locales/LocaleManagerBackupRestoreTest.java +++ b/services/tests/servicestests/src/com/android/server/locales/LocaleManagerBackupRestoreTest.java @@ -95,8 +95,8 @@ public class LocaleManagerBackupRestoreTest { private static final String TEST_LOCALES_XML_TAG = "locales"; private static final int DEFAULT_USER_ID = 0; private static final int WORK_PROFILE_USER_ID = 10; - private static final int DEFAULT_UID = Binder.getCallingUid() + 100; - private static final int WORK_PROFILE_UID = Binder.getCallingUid() + 1000100; + private static final int DEFAULT_UID = 100; + private static final int WORK_PROFILE_UID = 1000100; private static final long DEFAULT_CREATION_TIME_MILLIS = 1000; private static final Duration RETENTION_PERIOD = Duration.ofDays(3); private static final LocaleList DEFAULT_LOCALES = |