diff options
4 files changed, 33 insertions, 4 deletions
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index 2fc6da80dea9..31229e97024f 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -2940,7 +2940,7 @@ <!-- System bluetooth stack package name --> <string name="config_systemBluetoothStack" translatable="false"> - com.android.bluetooth.services + com.android.bluetooth </string> <!-- Flag indicating that the media framework should not allow changes or mute on any diff --git a/libs/WindowManager/Jetpack/src/androidx/window/extensions/layout/WindowLayoutComponentImpl.java b/libs/WindowManager/Jetpack/src/androidx/window/extensions/layout/WindowLayoutComponentImpl.java index a6f638822d10..c1d1c8e8d4e0 100644 --- a/libs/WindowManager/Jetpack/src/androidx/window/extensions/layout/WindowLayoutComponentImpl.java +++ b/libs/WindowManager/Jetpack/src/androidx/window/extensions/layout/WindowLayoutComponentImpl.java @@ -25,7 +25,10 @@ import static androidx.window.util.ExtensionHelper.transformToWindowSpaceRect; import android.annotation.Nullable; import android.app.Activity; +import android.app.ActivityManager; +import android.app.ActivityManager.AppTask; import android.app.Application; +import android.app.WindowConfiguration; import android.content.Context; import android.graphics.Rect; import android.os.Bundle; @@ -183,7 +186,7 @@ public class WindowLayoutComponentImpl implements WindowLayoutComponent { return features; } - if (activity.isInMultiWindowMode()) { + if (isTaskInMultiWindowMode(activity)) { // It is recommended not to report any display features in multi-window mode, since it // won't be possible to synchronize the display feature positions with window movement. return features; @@ -210,6 +213,32 @@ public class WindowLayoutComponentImpl implements WindowLayoutComponent { } /** + * Checks whether the task associated with the activity is in multi-window. If task info is not + * available it defaults to {@code true}. + */ + private boolean isTaskInMultiWindowMode(@NonNull Activity activity) { + final ActivityManager am = activity.getSystemService(ActivityManager.class); + if (am == null) { + return true; + } + + final List<AppTask> appTasks = am.getAppTasks(); + final int taskId = activity.getTaskId(); + AppTask task = null; + for (AppTask t : appTasks) { + if (t.getTaskInfo().taskId == taskId) { + task = t; + break; + } + } + if (task == null) { + // The task might be removed on the server already. + return true; + } + return WindowConfiguration.inMultiWindowMode(task.getTaskInfo().getWindowingMode()); + } + + /** * Returns {@link true} if a {@link Rect} has zero width and zero height, * {@code false} otherwise. */ diff --git a/packages/SettingsLib/src/com/android/settingslib/media/MediaManager.java b/packages/SettingsLib/src/com/android/settingslib/media/MediaManager.java index e8cbab8197b2..a040e28169e8 100644 --- a/packages/SettingsLib/src/com/android/settingslib/media/MediaManager.java +++ b/packages/SettingsLib/src/com/android/settingslib/media/MediaManager.java @@ -32,7 +32,7 @@ public abstract class MediaManager { private static final String TAG = "MediaManager"; protected final Collection<MediaDeviceCallback> mCallbacks = new CopyOnWriteArrayList<>(); - protected final List<MediaDevice> mMediaDevices = new ArrayList<>(); + protected final List<MediaDevice> mMediaDevices = new CopyOnWriteArrayList<>(); protected Context mContext; protected Notification mNotification; diff --git a/packages/SystemUI/src/com/android/systemui/flags/Flags.java b/packages/SystemUI/src/com/android/systemui/flags/Flags.java index c43dd9041a50..afa7d5e0a9c4 100644 --- a/packages/SystemUI/src/com/android/systemui/flags/Flags.java +++ b/packages/SystemUI/src/com/android/systemui/flags/Flags.java @@ -150,7 +150,7 @@ public class Flags { /***************************************/ // 900 - media - public static final BooleanFlag MEDIA_TAP_TO_TRANSFER = new BooleanFlag(900, false); + public static final BooleanFlag MEDIA_TAP_TO_TRANSFER = new BooleanFlag(900, true); public static final BooleanFlag MEDIA_SESSION_ACTIONS = new BooleanFlag(901, false); public static final BooleanFlag MEDIA_NEARBY_DEVICES = new BooleanFlag(903, true); public static final BooleanFlag MEDIA_MUTE_AWAIT = new BooleanFlag(904, true); |