summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/api/current.txt11
-rw-r--r--core/api/system-current.txt9
-rw-r--r--core/java/android/graphics/fonts/FontFamilyUpdateRequest.java73
-rw-r--r--core/java/android/window/SplashScreen.java37
-rw-r--r--core/java/android/window/SplashScreenView.java65
-rw-r--r--core/java/android/window/StartingWindowInfo.java14
-rw-r--r--core/jni/com_android_internal_os_Zygote.cpp21
-rw-r--r--core/jni/com_android_internal_os_Zygote.h14
-rw-r--r--core/jni/com_android_internal_os_ZygoteCommandBuffer.cpp1
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/SplashscreenContentDrawer.java2
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/SplashscreenIconDrawableFactory.java9
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/StartingSurfaceDrawer.java33
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/StartingWindowController.java42
-rw-r--r--libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/startingsurface/StartingSurfaceDrawerTests.java4
-rw-r--r--packages/SystemUI/Android.bp1
-rw-r--r--packages/SystemUI/AndroidManifest.xml3
-rw-r--r--packages/SystemUI/res/values/ids.xml2
-rw-r--r--packages/SystemUI/res/values/strings.xml4
-rw-r--r--packages/SystemUI/src/com/android/systemui/accessibility/floatingmenu/AccessibilityFloatingMenuView.java24
-rw-r--r--packages/SystemUI/src/com/android/systemui/biometrics/AuthContainerView.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/classifier/BrightLineFalsingManager.java4
-rw-r--r--packages/SystemUI/src/com/android/systemui/media/MediaCarouselController.kt14
-rw-r--r--packages/SystemUI/src/com/android/systemui/media/MediaDataCombineLatest.kt9
-rw-r--r--packages/SystemUI/src/com/android/systemui/media/MediaDataFilter.kt9
-rw-r--r--packages/SystemUI/src/com/android/systemui/media/MediaDataManager.kt120
-rw-r--r--packages/SystemUI/src/com/android/systemui/media/MediaHost.kt9
-rw-r--r--packages/SystemUI/src/com/android/systemui/media/MediaSessionBasedFilter.kt25
-rw-r--r--packages/SystemUI/src/com/android/systemui/media/SmartspaceMediaDataProvider.kt39
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileImpl.java8
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/NotificationMediaManager.java17
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/accessibility/floatingmenu/AccessibilityFloatingMenuViewTest.java44
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/classifier/BrightLineClassifierTest.java11
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/media/MediaDataManagerTest.kt30
-rw-r--r--services/core/java/com/android/server/biometrics/PreAuthInfo.java25
-rw-r--r--services/core/java/com/android/server/wm/ActivityRecord.java11
-rw-r--r--services/core/java/com/android/server/wm/ActivityStarter.java10
-rw-r--r--services/core/java/com/android/server/wm/StartingSurfaceController.java7
-rw-r--r--services/core/java/com/android/server/wm/Task.java5
-rw-r--r--services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java32
-rw-r--r--services/tests/wmtests/src/com/android/server/wm/WindowTestsBase.java2
40 files changed, 368 insertions, 434 deletions
diff --git a/core/api/current.txt b/core/api/current.txt
index e77cad8cf1c3..bdd0f1758cf5 100644
--- a/core/api/current.txt
+++ b/core/api/current.txt
@@ -56741,18 +56741,19 @@ package android.widget.inline {
package android.window {
public interface SplashScreen {
- method public void setOnExitAnimationListener(@Nullable android.window.SplashScreen.OnExitAnimationListener);
+ method public void clearOnExitAnimationListener();
+ method public void setOnExitAnimationListener(@NonNull android.window.SplashScreen.OnExitAnimationListener);
}
public static interface SplashScreen.OnExitAnimationListener {
- method public void onSplashScreenExit(@NonNull android.window.SplashScreenView);
+ method @UiThread public void onSplashScreenExit(@NonNull android.window.SplashScreenView);
}
public final class SplashScreenView extends android.widget.FrameLayout {
- method public long getIconAnimationDurationMillis();
- method public long getIconAnimationStartMillis();
+ method @Nullable public java.time.Duration getIconAnimationDuration();
+ method @Nullable public java.time.Instant getIconAnimationStart();
method @Nullable public android.view.View getIconView();
- method public void remove();
+ method @UiThread public void remove();
}
}
diff --git a/core/api/system-current.txt b/core/api/system-current.txt
index 930c2986a329..bdb63388bf9e 100644
--- a/core/api/system-current.txt
+++ b/core/api/system-current.txt
@@ -3005,12 +3005,19 @@ package android.graphics.fonts {
}
public static final class FontFamilyUpdateRequest.Font {
- ctor public FontFamilyUpdateRequest.Font(@NonNull String, @NonNull android.graphics.fonts.FontStyle, @NonNull java.util.List<android.graphics.fonts.FontVariationAxis>);
method @NonNull public java.util.List<android.graphics.fonts.FontVariationAxis> getAxes();
+ method @IntRange(from=0) public int getIndex();
method @NonNull public String getPostScriptName();
method @NonNull public android.graphics.fonts.FontStyle getStyle();
}
+ public static final class FontFamilyUpdateRequest.Font.Builder {
+ ctor public FontFamilyUpdateRequest.Font.Builder(@NonNull String, @NonNull android.graphics.fonts.FontStyle);
+ method @NonNull public android.graphics.fonts.FontFamilyUpdateRequest.Font build();
+ method @NonNull public android.graphics.fonts.FontFamilyUpdateRequest.Font.Builder setAxes(@NonNull java.util.List<android.graphics.fonts.FontVariationAxis>);
+ method @NonNull public android.graphics.fonts.FontFamilyUpdateRequest.Font.Builder setIndex(@IntRange(from=0) int);
+ }
+
public static final class FontFamilyUpdateRequest.FontFamily {
method @NonNull public java.util.List<android.graphics.fonts.FontFamilyUpdateRequest.Font> getFonts();
method @NonNull public String getName();
diff --git a/core/java/android/graphics/fonts/FontFamilyUpdateRequest.java b/core/java/android/graphics/fonts/FontFamilyUpdateRequest.java
index fbc951e2f6e6..92904971aa15 100644
--- a/core/java/android/graphics/fonts/FontFamilyUpdateRequest.java
+++ b/core/java/android/graphics/fonts/FontFamilyUpdateRequest.java
@@ -23,6 +23,7 @@ import android.annotation.SystemApi;
import com.android.internal.util.Preconditions;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import java.util.Objects;
@@ -157,6 +158,61 @@ public final class FontFamilyUpdateRequest {
*/
public static final class Font {
+ /**
+ * Builds a {@link Font}.
+ */
+ public static final class Builder {
+ private final@NonNull String mPostScriptName;
+ private final @NonNull FontStyle mStyle;
+ private @NonNull List<FontVariationAxis> mAxes = Collections.emptyList();
+ private @IntRange(from = 0) int mIndex = 0;
+
+ /**
+ * Construct a {@link Font.Builder}
+ *
+ * @param postScriptName The PostScript name of the font file to use. PostScript name is
+ * in Name ID 6 field in 'name' table, as specified by OpenType
+ * specification.
+ * @param style The style for this font.
+ */
+ public Builder(@NonNull String postScriptName, @NonNull FontStyle style) {
+ Objects.requireNonNull(postScriptName);
+ Preconditions.checkStringNotEmpty(postScriptName);
+ Objects.requireNonNull(style);
+ mPostScriptName = postScriptName;
+ mStyle = style;
+ }
+
+ /**
+ * A list of {@link FontVariationAxis} to specify axis tags and values for variable
+ * fonts.
+ */
+ public @NonNull Builder setAxes(@NonNull List<FontVariationAxis> axes) {
+ Objects.requireNonNull(axes);
+ Preconditions.checkCollectionElementsNotNull(axes, "axes");
+ mAxes = axes;
+ return this;
+ }
+
+ /**
+ * Sets font collection index for the Font.
+ *
+ * @see {@link android.R.attr#ttcIndex}.
+ */
+ public @NonNull Builder setIndex(@IntRange(from = 0) int index) {
+ Preconditions.checkArgumentNonnegative(index);
+ mIndex = index;
+ return this;
+ }
+
+ /**
+ * Build a {@link Font} instance.
+ */
+ public @NonNull Font build() {
+ return new Font(mPostScriptName, mStyle, mIndex, mAxes);
+ }
+ }
+
@NonNull
private final String mPostScriptName;
@NonNull
@@ -164,6 +220,8 @@ public final class FontFamilyUpdateRequest {
@NonNull
private final List<FontVariationAxis> mAxes;
+ private final @IntRange(from = 0) int mIndex;
+
/**
* Constructs a FontStyleVariation.
*
@@ -176,18 +234,15 @@ public final class FontFamilyUpdateRequest {
* Name ID 6 field in 'name' table, as specified by OpenType
* specification.
* @param style The style for this font.
+ * @param index The index of the font in the collection.
* @param axes A list of {@link FontVariationAxis} to specify axis tags and values
* for variable fonts.
*/
- public Font(@NonNull String postScriptName, @NonNull FontStyle style,
- @NonNull List<FontVariationAxis> axes) {
- Objects.requireNonNull(postScriptName);
- Preconditions.checkStringNotEmpty(postScriptName);
- Objects.requireNonNull(style);
- Objects.requireNonNull(axes);
- Preconditions.checkCollectionElementsNotNull(axes, "axes");
+ private Font(@NonNull String postScriptName, @NonNull FontStyle style,
+ @IntRange(from = 0) int index, @NonNull List<FontVariationAxis> axes) {
mPostScriptName = postScriptName;
mStyle = style;
+ mIndex = index;
mAxes = axes;
}
@@ -207,6 +262,7 @@ public final class FontFamilyUpdateRequest {
return mStyle;
}
+
/**
* Returns the list of {@link FontVariationAxis}.
*/
@@ -217,9 +273,6 @@ public final class FontFamilyUpdateRequest {
/**
* Returns the index of collection
- *
- * TODO(183752879): Make font index configurable and make this SystemApi.
- * @hide
*/
public @IntRange(from = 0) int getIndex() {
return 0;
diff --git a/core/java/android/window/SplashScreen.java b/core/java/android/window/SplashScreen.java
index 4b88a9bc39de..18f29ae8eeca 100644
--- a/core/java/android/window/SplashScreen.java
+++ b/core/java/android/window/SplashScreen.java
@@ -17,8 +17,8 @@
package android.window;
import android.annotation.NonNull;
-import android.annotation.Nullable;
import android.annotation.SuppressLint;
+import android.annotation.UiThread;
import android.app.Activity;
import android.app.ActivityThread;
import android.content.Context;
@@ -52,7 +52,13 @@ public interface SplashScreen {
* @see OnExitAnimationListener#onSplashScreenExit(SplashScreenView)
*/
@SuppressLint("ExecutorRegistration")
- void setOnExitAnimationListener(@Nullable SplashScreen.OnExitAnimationListener listener);
+ void setOnExitAnimationListener(@NonNull SplashScreen.OnExitAnimationListener listener);
+
+ /**
+ * Clear exist listener
+ * @see #setOnExitAnimationListener
+ */
+ void clearOnExitAnimationListener();
/**
* Listens for the splash screen exit event.
@@ -63,15 +69,14 @@ public interface SplashScreen {
* of the activity. The {@link SplashScreenView} represents the splash screen view
* object, developer can make an exit animation based on this view.</p>
*
- * <p>If {@link SplashScreenView#remove} is not called after 5000ms, the method will be
- * automatically called and the splash screen removed.</p>
- *
- * <p>This method is never invoked if your activity sets
- * {@link #setOnExitAnimationListener} to <code>null</code>..
+ * <p>This method is never invoked if your activity clear the listener by
+ * {@link #clearOnExitAnimationListener}.
*
* @param view The view object which on top of this Activity.
* @see #setOnExitAnimationListener
+ * @see #clearOnExitAnimationListener
*/
+ @UiThread
void onSplashScreenExit(@NonNull SplashScreenView view);
}
@@ -90,20 +95,30 @@ public interface SplashScreen {
@Override
public void setOnExitAnimationListener(
- @Nullable SplashScreen.OnExitAnimationListener listener) {
+ @NonNull SplashScreen.OnExitAnimationListener listener) {
if (mActivityToken == null) {
// This is not an activity.
return;
}
synchronized (mGlobal.mGlobalLock) {
- mExitAnimationListener = listener;
if (listener != null) {
+ mExitAnimationListener = listener;
mGlobal.addImpl(this);
- } else {
- mGlobal.removeImpl(this);
}
}
}
+
+ @Override
+ public void clearOnExitAnimationListener() {
+ if (mActivityToken == null) {
+ // This is not an activity.
+ return;
+ }
+ synchronized (mGlobal.mGlobalLock) {
+ mExitAnimationListener = null;
+ mGlobal.removeImpl(this);
+ }
+ }
}
/**
diff --git a/core/java/android/window/SplashScreenView.java b/core/java/android/window/SplashScreenView.java
index 9789d70c09c4..933760c8bf18 100644
--- a/core/java/android/window/SplashScreenView.java
+++ b/core/java/android/window/SplashScreenView.java
@@ -22,6 +22,7 @@ import android.annotation.ColorInt;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.TestApi;
+import android.annotation.UiThread;
import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
@@ -32,7 +33,6 @@ import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.os.Parcel;
import android.os.Parcelable;
-import android.os.SystemClock;
import android.os.Trace;
import android.util.AttributeSet;
import android.util.Log;
@@ -46,7 +46,8 @@ import android.widget.FrameLayout;
import com.android.internal.R;
import com.android.internal.policy.DecorView;
-import java.util.function.Consumer;
+import java.time.Duration;
+import java.time.Instant;
/**
* <p>The view which allows an activity to customize its splash screen exit animation.</p>
@@ -75,8 +76,8 @@ public final class SplashScreenView extends FrameLayout {
private Bitmap mParceledIconBitmap;
private View mBrandingImageView;
private Bitmap mParceledBrandingBitmap;
- private long mIconAnimationDuration;
- private long mIconAnimationStart;
+ private Duration mIconAnimationDuration;
+ private Instant mIconAnimationStart;
// The host activity when transfer view to it.
private Activity mHostActivity;
@@ -85,6 +86,7 @@ public final class SplashScreenView extends FrameLayout {
private boolean mDrawBarBackground;
private int mStatusBarColor;
private int mNavigationBarColor;
+ private boolean mHasRemoved;
/**
* Internal builder to create a SplashScreenView object.
@@ -101,8 +103,8 @@ public final class SplashScreenView extends FrameLayout {
private int mBrandingImageHeight;
private Drawable mBrandingDrawable;
private Bitmap mParceledBrandingBitmap;
- private long mIconAnimationStart;
- private long mIconAnimationDuration;
+ private Instant mIconAnimationStart;
+ private Duration mIconAnimationDuration;
public Builder(@NonNull Context context) {
mContext = context;
@@ -126,8 +128,8 @@ public final class SplashScreenView extends FrameLayout {
parcelable.mBrandingHeight);
mParceledBrandingBitmap = parcelable.mBrandingBitmap;
}
- mIconAnimationStart = parcelable.mIconAnimationStart;
- mIconAnimationDuration = parcelable.mIconAnimationDuration;
+ mIconAnimationStart = Instant.ofEpochMilli(parcelable.mIconAnimationStartMillis);
+ mIconAnimationDuration = Duration.ofMillis(parcelable.mIconAnimationDurationMillis);
return this;
}
@@ -166,8 +168,8 @@ public final class SplashScreenView extends FrameLayout {
/**
* Set the animation duration if icon is animatable.
*/
- public Builder setAnimationDuration(int duration) {
- mIconAnimationDuration = duration;
+ public Builder setAnimationDurationMillis(int duration) {
+ mIconAnimationDuration = Duration.ofMillis(duration);
return this;
}
@@ -203,7 +205,8 @@ public final class SplashScreenView extends FrameLayout {
}
if (mIconDrawable != null) {
view.mIconView.setBackground(mIconDrawable);
- view.initIconAnimation(mIconDrawable, mIconAnimationDuration);
+ view.initIconAnimation(mIconDrawable,
+ mIconAnimationDuration != null ? mIconAnimationDuration.toMillis() : 0);
}
view.mIconAnimationStart = mIconAnimationStart;
view.mIconAnimationDuration = mIconAnimationDuration;
@@ -266,15 +269,16 @@ public final class SplashScreenView extends FrameLayout {
* @see android.R.attr#windowSplashScreenAnimatedIcon
* @see android.R.attr#windowSplashScreenAnimationDuration
*/
- public long getIconAnimationDurationMillis() {
+ @Nullable
+ public Duration getIconAnimationDuration() {
return mIconAnimationDuration;
}
/**
- * If the replaced icon is animatable, return the animation start time in millisecond based on
- * system. The start time is set using {@link SystemClock#uptimeMillis()}.
+ * If the replaced icon is animatable, return the animation start time based on system clock.
*/
- public long getIconAnimationStartMillis() {
+ @Nullable
+ public Instant getIconAnimationStart() {
return mIconAnimationStart;
}
@@ -286,8 +290,8 @@ public final class SplashScreenView extends FrameLayout {
aniDrawable.prepareAnimate(duration, this::animationStartCallback);
}
- private void animationStartCallback(long startAt) {
- mIconAnimationStart = startAt;
+ private void animationStartCallback() {
+ mIconAnimationStart = Instant.now();
}
/**
@@ -295,7 +299,11 @@ public final class SplashScreenView extends FrameLayout {
* <p><strong>Do not</strong> invoke this method from a drawing method
* ({@link #onDraw(android.graphics.Canvas)} for instance).</p>
*/
+ @UiThread
public void remove() {
+ if (mHasRemoved) {
+ return;
+ }
setVisibility(GONE);
if (mParceledIconBitmap != null) {
mIconView.setBackground(null);
@@ -321,6 +329,7 @@ public final class SplashScreenView extends FrameLayout {
if (mHostActivity != null) {
mHostActivity.detachSplashScreenView();
}
+ mHasRemoved = true;
}
/**
@@ -414,7 +423,7 @@ public final class SplashScreenView extends FrameLayout {
* @param startListener The callback listener used to receive the start of the animation.
* @return true if this drawable object can also be animated and it can be played now.
*/
- protected boolean prepareAnimate(long duration, Consumer<Long> startListener) {
+ protected boolean prepareAnimate(long duration, Runnable startListener) {
return false;
}
}
@@ -433,8 +442,8 @@ public final class SplashScreenView extends FrameLayout {
private int mBrandingHeight;
private Bitmap mBrandingBitmap;
- private long mIconAnimationStart;
- private long mIconAnimationDuration;
+ private long mIconAnimationStartMillis;
+ private long mIconAnimationDurationMillis;
public SplashScreenViewParcelable(SplashScreenView view) {
ViewGroup.LayoutParams params = view.getIconView().getLayoutParams();
@@ -447,8 +456,12 @@ public final class SplashScreenView extends FrameLayout {
mBrandingWidth = params.width;
mBrandingHeight = params.height;
- mIconAnimationStart = view.getIconAnimationStartMillis();
- mIconAnimationDuration = view.getIconAnimationDurationMillis();
+ if (view.getIconAnimationStart() != null) {
+ mIconAnimationStartMillis = view.getIconAnimationStart().toEpochMilli();
+ }
+ if (view.getIconAnimationDuration() != null) {
+ mIconAnimationDurationMillis = view.getIconAnimationDuration().toMillis();
+ }
}
private Bitmap copyDrawable(Drawable drawable) {
@@ -479,8 +492,8 @@ public final class SplashScreenView extends FrameLayout {
mBrandingWidth = source.readInt();
mBrandingHeight = source.readInt();
mBrandingBitmap = source.readTypedObject(Bitmap.CREATOR);
- mIconAnimationStart = source.readLong();
- mIconAnimationDuration = source.readLong();
+ mIconAnimationStartMillis = source.readLong();
+ mIconAnimationDurationMillis = source.readLong();
mIconBackground = source.readInt();
}
@@ -497,8 +510,8 @@ public final class SplashScreenView extends FrameLayout {
dest.writeInt(mBrandingWidth);
dest.writeInt(mBrandingHeight);
dest.writeTypedObject(mBrandingBitmap, flags);
- dest.writeLong(mIconAnimationStart);
- dest.writeLong(mIconAnimationDuration);
+ dest.writeLong(mIconAnimationStartMillis);
+ dest.writeLong(mIconAnimationDurationMillis);
dest.writeInt(mIconBackground);
}
diff --git a/core/java/android/window/StartingWindowInfo.java b/core/java/android/window/StartingWindowInfo.java
index c7672dc9fe7d..08bb1a957e05 100644
--- a/core/java/android/window/StartingWindowInfo.java
+++ b/core/java/android/window/StartingWindowInfo.java
@@ -50,12 +50,19 @@ public final class StartingWindowInfo implements Parcelable {
*/
public static final int STARTING_WINDOW_TYPE_SNAPSHOT = 2;
/**
+ * Prefer empty splash screen starting window.
+ * @hide
+ */
+ public static final int STARTING_WINDOW_TYPE_EMPTY_SPLASH_SCREEN = 3;
+
+ /**
* @hide
*/
@IntDef(flag = true, prefix = "STARTING_WINDOW_TYPE_", value = {
STARTING_WINDOW_TYPE_NONE,
STARTING_WINDOW_TYPE_SPLASH_SCREEN,
- STARTING_WINDOW_TYPE_SNAPSHOT
+ STARTING_WINDOW_TYPE_SNAPSHOT,
+ STARTING_WINDOW_TYPE_EMPTY_SPLASH_SCREEN
})
public @interface StartingWindowType {}
@@ -95,7 +102,8 @@ public final class StartingWindowInfo implements Parcelable {
TYPE_PARAMETER_TASK_SWITCH,
TYPE_PARAMETER_PROCESS_RUNNING,
TYPE_PARAMETER_ALLOW_TASK_SNAPSHOT,
- TYPE_PARAMETER_ACTIVITY_CREATED
+ TYPE_PARAMETER_ACTIVITY_CREATED,
+ TYPE_PARAMETER_SAME_PACKAGE
})
public @interface StartingTypeParams {}
@@ -112,6 +120,8 @@ public final class StartingWindowInfo implements Parcelable {
public static final int TYPE_PARAMETER_ALLOW_TASK_SNAPSHOT = 0x00000008;
/** @hide */
public static final int TYPE_PARAMETER_ACTIVITY_CREATED = 0x00000010;
+ /** @hide */
+ public static final int TYPE_PARAMETER_SAME_PACKAGE = 0x00000020;
/**
* The parameters which effect the starting window type.
diff --git a/core/jni/com_android_internal_os_Zygote.cpp b/core/jni/com_android_internal_os_Zygote.cpp
index 0bed29b7ba28..8b7096646cff 100644
--- a/core/jni/com_android_internal_os_Zygote.cpp
+++ b/core/jni/com_android_internal_os_Zygote.cpp
@@ -1026,21 +1026,6 @@ static void ClearUsapTable() {
gUsapPoolCount = 0;
}
-NO_PAC_FUNC
-static void PAuthKeyChange(JNIEnv* env) {
-#ifdef __aarch64__
- unsigned long int hwcaps = getauxval(AT_HWCAP);
- if (hwcaps & HWCAP_PACA) {
- const unsigned long key_mask = PR_PAC_APIAKEY | PR_PAC_APIBKEY |
- PR_PAC_APDAKEY | PR_PAC_APDBKEY | PR_PAC_APGAKEY;
- if (prctl(PR_PAC_RESET_KEYS, key_mask, 0, 0, 0) != 0) {
- ALOGE("Failed to change the PAC keys: %s", strerror(errno));
- RuntimeAbort(env, __LINE__, "PAC key change failed.");
- }
- }
-#endif
-}
-
// Create an app data directory over tmpfs overlayed CE / DE storage, and bind mount it
// from the actual app data directory in data mirror.
static bool createAndMountAppData(std::string_view package_name,
@@ -2020,7 +2005,6 @@ void zygote::ZygoteFailure(JNIEnv* env,
}
// Utility routine to fork a process from the zygote.
-NO_PAC_FUNC
pid_t zygote::ForkCommon(JNIEnv* env, bool is_system_server,
const std::vector<int>& fds_to_close,
const std::vector<int>& fds_to_ignore,
@@ -2075,7 +2059,6 @@ pid_t zygote::ForkCommon(JNIEnv* env, bool is_system_server,
}
// The child process.
- PAuthKeyChange(env);
PreApplicationInit();
// Clean up any descriptors which must be closed immediately
@@ -2107,7 +2090,6 @@ static void com_android_internal_os_Zygote_nativePreApplicationInit(JNIEnv*, jcl
PreApplicationInit();
}
-NO_PAC_FUNC
static jint com_android_internal_os_Zygote_nativeForkAndSpecialize(
JNIEnv* env, jclass, jint uid, jint gid, jintArray gids, jint runtime_flags,
jobjectArray rlimits, jint mount_external, jstring se_info, jstring nice_name,
@@ -2157,7 +2139,6 @@ static jint com_android_internal_os_Zygote_nativeForkAndSpecialize(
return pid;
}
-NO_PAC_FUNC
static jint com_android_internal_os_Zygote_nativeForkSystemServer(
JNIEnv* env, jclass, uid_t uid, gid_t gid, jintArray gids,
jint runtime_flags, jobjectArray rlimits, jlong permitted_capabilities,
@@ -2229,7 +2210,6 @@ static jint com_android_internal_os_Zygote_nativeForkSystemServer(
* @param is_priority_fork Controls the nice level assigned to the newly created process
* @return child pid in the parent, 0 in the child
*/
-NO_PAC_FUNC
static jint com_android_internal_os_Zygote_nativeForkApp(JNIEnv* env,
jclass,
jint read_pipe_fd,
@@ -2244,7 +2224,6 @@ static jint com_android_internal_os_Zygote_nativeForkApp(JNIEnv* env,
args_known == JNI_TRUE, is_priority_fork == JNI_TRUE, true);
}
-NO_PAC_FUNC
int zygote::forkApp(JNIEnv* env,
int read_pipe_fd,
int write_pipe_fd,
diff --git a/core/jni/com_android_internal_os_Zygote.h b/core/jni/com_android_internal_os_Zygote.h
index d2da91476bc7..b87396cbd5f5 100644
--- a/core/jni/com_android_internal_os_Zygote.h
+++ b/core/jni/com_android_internal_os_Zygote.h
@@ -20,18 +20,6 @@
#define LOG_TAG "Zygote"
#define ATRACE_TAG ATRACE_TAG_DALVIK
-/* Functions in the callchain during the fork shall not be protected with
- Armv8.3-A Pointer Authentication, otherwise child will not be able to return. */
-#ifdef __ARM_FEATURE_PAC_DEFAULT
-#ifdef __ARM_FEATURE_BTI_DEFAULT
-#define NO_PAC_FUNC __attribute__((target("branch-protection=bti")))
-#else
-#define NO_PAC_FUNC __attribute__((target("branch-protection=none")))
-#endif /* __ARM_FEATURE_BTI_DEFAULT */
-#else /* !__ARM_FEATURE_PAC_DEFAULT */
-#define NO_PAC_FUNC
-#endif /* __ARM_FEATURE_PAC_DEFAULT */
-
#include <jni.h>
#include <vector>
#include <android-base/stringprintf.h>
@@ -42,7 +30,6 @@
namespace android {
namespace zygote {
-NO_PAC_FUNC
pid_t ForkCommon(JNIEnv* env,bool is_system_server,
const std::vector<int>& fds_to_close,
const std::vector<int>& fds_to_ignore,
@@ -57,7 +44,6 @@ pid_t ForkCommon(JNIEnv* env,bool is_system_server,
* communication is required. Is_priority_fork should be true if this is on the app startup
* critical path. Purge specifies that unused pages should be purged before the fork.
*/
-NO_PAC_FUNC
int forkApp(JNIEnv* env,
int read_pipe_fd,
int write_pipe_fd,
diff --git a/core/jni/com_android_internal_os_ZygoteCommandBuffer.cpp b/core/jni/com_android_internal_os_ZygoteCommandBuffer.cpp
index 011e8f8f1b8c..24fef4881e4c 100644
--- a/core/jni/com_android_internal_os_ZygoteCommandBuffer.cpp
+++ b/core/jni/com_android_internal_os_ZygoteCommandBuffer.cpp
@@ -365,7 +365,6 @@ void com_android_internal_os_ZygoteCommandBuffer_nativeReadFullyAndReset(JNIEnv*
// We only process fork commands if the peer uid matches expected_uid.
// For every fork command after the first, we check that the requested uid is at
// least minUid.
-NO_PAC_FUNC
jboolean com_android_internal_os_ZygoteCommandBuffer_nativeForkRepeatedly(
JNIEnv* env,
jclass,
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/SplashscreenContentDrawer.java b/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/SplashscreenContentDrawer.java
index 855faaa8e83e..516dfd0758ee 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/SplashscreenContentDrawer.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/SplashscreenContentDrawer.java
@@ -357,7 +357,7 @@ public class SplashscreenContentDrawer {
if (iconDrawable != null) {
builder.setCenterViewDrawable(iconDrawable);
}
- builder.setAnimationDuration(mIconAnimationDuration);
+ builder.setAnimationDurationMillis(mIconAnimationDuration);
if (mBrandingDrawable != null) {
builder.setBrandingDrawable(mBrandingDrawable, mBrandingImageWidth,
mBrandingImageHeight);
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/SplashscreenIconDrawableFactory.java b/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/SplashscreenIconDrawableFactory.java
index a4a83eb87b94..4196d68f5800 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/SplashscreenIconDrawableFactory.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/SplashscreenIconDrawableFactory.java
@@ -37,15 +37,12 @@ import android.graphics.drawable.AdaptiveIconDrawable;
import android.graphics.drawable.Animatable;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
-import android.os.SystemClock;
import android.os.Trace;
import android.util.PathParser;
import android.window.SplashScreenView;
import com.android.internal.R;
-import java.util.function.Consumer;
-
/**
* Creating a lightweight Drawable object used for splash screen.
* @hide
@@ -133,7 +130,6 @@ public class SplashscreenIconDrawableFactory {
private Animatable mAnimatableIcon;
private Animator mIconAnimator;
private boolean mAnimationTriggered;
- private long mIconAnimationStart;
AnimatableIconDrawable(@ColorInt int backgroundColor, Drawable foregroundDrawable) {
mForegroundDrawable = foregroundDrawable;
@@ -150,16 +146,15 @@ public class SplashscreenIconDrawableFactory {
}
@Override
- protected boolean prepareAnimate(long duration, Consumer<Long> startListener) {
+ protected boolean prepareAnimate(long duration, Runnable startListener) {
mAnimatableIcon = (Animatable) mForegroundDrawable;
mIconAnimator = ValueAnimator.ofInt(0, 1);
mIconAnimator.setDuration(duration);
mIconAnimator.addListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
- mIconAnimationStart = SystemClock.uptimeMillis();
if (startListener != null) {
- startListener.accept(mIconAnimationStart);
+ startListener.run();
}
mAnimatableIcon.start();
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/StartingSurfaceDrawer.java b/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/StartingSurfaceDrawer.java
index 29a144fe9808..e95135a1a59f 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/StartingSurfaceDrawer.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/StartingSurfaceDrawer.java
@@ -105,8 +105,10 @@ public class StartingSurfaceDrawer {
/**
* Called when a task need a splash screen starting window.
+ * @param emptyView Whether drawing an empty frame without anything on it.
*/
- public void addSplashScreenStartingWindow(StartingWindowInfo windowInfo, IBinder appToken) {
+ void addSplashScreenStartingWindow(StartingWindowInfo windowInfo, IBinder appToken,
+ boolean emptyView) {
final RunningTaskInfo taskInfo = windowInfo.taskInfo;
final ActivityInfo activityInfo = taskInfo.topActivityInfo;
if (activityInfo == null) {
@@ -203,7 +205,6 @@ public class StartingSurfaceDrawer {
}
final PhoneWindow win = new PhoneWindow(context);
- win.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
win.setIsStartingWindow(true);
CharSequence label = context.getResources().getText(labelRes, null);
@@ -270,17 +271,20 @@ public class StartingSurfaceDrawer {
try {
final View view = win.getDecorView();
final WindowManager wm = mContext.getSystemService(WindowManager.class);
- // splash screen content will be deprecated after S.
- sView = SplashscreenContentDrawer.makeSplashscreenContent(
- context, splashscreenContentResId[0]);
- final boolean splashscreenContentCompatible = sView != null;
- if (splashscreenContentCompatible) {
- win.setContentView(sView);
- } else {
- sView = mSplashscreenContentDrawer
- .makeSplashScreenContentView(context, activityInfo);
- win.setContentView(sView);
- sView.cacheRootWindow(win);
+ if (!emptyView) {
+ // splash screen content will be deprecated after S.
+ sView = SplashscreenContentDrawer.makeSplashscreenContent(
+ context, splashscreenContentResId[0]);
+ final boolean splashscreenContentCompatible = sView != null;
+ if (splashscreenContentCompatible) {
+ win.setContentView(sView);
+ } else {
+ sView = mSplashscreenContentDrawer
+ .makeSplashScreenContentView(context, activityInfo);
+ win.setContentView(sView);
+ win.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
+ sView.cacheRootWindow(win);
+ }
}
postAddWindow(taskId, appToken, view, wm, params);
} catch (RuntimeException e) {
@@ -393,6 +397,9 @@ public class StartingSurfaceDrawer {
// animation
removeWindowInner(record.mDecorView, false);
}
+ } else {
+ // no animation will be applied
+ removeWindowInner(record.mDecorView, false);
}
}
if (record.mTaskSnapshotWindow != null) {
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/StartingWindowController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/StartingWindowController.java
index a06068d6c497..8a629bcf4f3b 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/StartingWindowController.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/StartingWindowController.java
@@ -16,6 +16,7 @@
package com.android.wm.shell.startingsurface;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
+import static android.window.StartingWindowInfo.STARTING_WINDOW_TYPE_EMPTY_SPLASH_SCREEN;
import static android.window.StartingWindowInfo.STARTING_WINDOW_TYPE_NONE;
import static android.window.StartingWindowInfo.STARTING_WINDOW_TYPE_SNAPSHOT;
import static android.window.StartingWindowInfo.STARTING_WINDOW_TYPE_SPLASH_SCREEN;
@@ -23,6 +24,7 @@ import static android.window.StartingWindowInfo.TYPE_PARAMETER_ACTIVITY_CREATED;
import static android.window.StartingWindowInfo.TYPE_PARAMETER_ALLOW_TASK_SNAPSHOT;
import static android.window.StartingWindowInfo.TYPE_PARAMETER_NEW_TASK;
import static android.window.StartingWindowInfo.TYPE_PARAMETER_PROCESS_RUNNING;
+import static android.window.StartingWindowInfo.TYPE_PARAMETER_SAME_PACKAGE;
import static android.window.StartingWindowInfo.TYPE_PARAMETER_TASK_SWITCH;
import static com.android.wm.shell.common.ExecutorUtils.executeRemoteCallWithTaskPermission;
@@ -65,7 +67,8 @@ import java.util.function.BiConsumer;
*/
public class StartingWindowController implements RemoteCallable<StartingWindowController> {
private static final String TAG = StartingWindowController.class.getSimpleName();
- static final boolean DEBUG_SPLASH_SCREEN = false;
+ // TODO b/183150443 Keep this flag open for a while, several things might need to adjust.
+ static final boolean DEBUG_SPLASH_SCREEN = true;
static final boolean DEBUG_TASK_SNAPSHOT = false;
private final StartingSurfaceDrawer mStartingSurfaceDrawer;
@@ -123,24 +126,37 @@ public class StartingWindowController implements RemoteCallable<StartingWindowCo
final boolean processRunning = (parameter & TYPE_PARAMETER_PROCESS_RUNNING) != 0;
final boolean allowTaskSnapshot = (parameter & TYPE_PARAMETER_ALLOW_TASK_SNAPSHOT) != 0;
final boolean activityCreated = (parameter & TYPE_PARAMETER_ACTIVITY_CREATED) != 0;
+ final boolean samePackage = (parameter & TYPE_PARAMETER_SAME_PACKAGE) != 0;
return estimateStartingWindowType(windowInfo, newTask, taskSwitch,
- processRunning, allowTaskSnapshot, activityCreated);
+ processRunning, allowTaskSnapshot, activityCreated, samePackage);
}
// reference from ActivityRecord#getStartingWindowType
private int estimateStartingWindowType(StartingWindowInfo windowInfo,
boolean newTask, boolean taskSwitch, boolean processRunning,
- boolean allowTaskSnapshot, boolean activityCreated) {
+ boolean allowTaskSnapshot, boolean activityCreated, boolean samePackage) {
if (DEBUG_SPLASH_SCREEN || DEBUG_TASK_SNAPSHOT) {
Slog.d(TAG, "preferredStartingWindowType newTask " + newTask
+ " taskSwitch " + taskSwitch
+ " processRunning " + processRunning
+ " allowTaskSnapshot " + allowTaskSnapshot
- + " activityCreated " + activityCreated);
+ + " activityCreated " + activityCreated
+ + " samePackage " + samePackage);
}
- if ((newTask || !processRunning || (taskSwitch && !activityCreated))
- && windowInfo.taskInfo.topActivityType != ACTIVITY_TYPE_HOME) {
- return STARTING_WINDOW_TYPE_SPLASH_SCREEN;
+ if (windowInfo.taskInfo.topActivityType != ACTIVITY_TYPE_HOME) {
+ if (!processRunning) {
+ return STARTING_WINDOW_TYPE_SPLASH_SCREEN;
+ }
+ if (newTask) {
+ if (samePackage) {
+ return STARTING_WINDOW_TYPE_EMPTY_SPLASH_SCREEN;
+ } else {
+ return STARTING_WINDOW_TYPE_SPLASH_SCREEN;
+ }
+ }
+ if (taskSwitch && !activityCreated) {
+ return STARTING_WINDOW_TYPE_SPLASH_SCREEN;
+ }
}
if (taskSwitch && allowTaskSnapshot) {
final TaskSnapshot snapshot = getTaskSnapshot(windowInfo.taskInfo.taskId);
@@ -207,6 +223,10 @@ public class StartingWindowController implements RemoteCallable<StartingWindowCo
mTaskLaunchingCallback = listener;
}
+ private boolean shouldSendToListener(int suggestionType) {
+ return suggestionType != STARTING_WINDOW_TYPE_EMPTY_SPLASH_SCREEN;
+ }
+
/**
* Called when a task need a starting window.
*/
@@ -214,11 +234,15 @@ public class StartingWindowController implements RemoteCallable<StartingWindowCo
mSplashScreenExecutor.execute(() -> {
final int suggestionType = mStartingTypeChecker.estimateStartingWindowType(windowInfo);
final RunningTaskInfo runningTaskInfo = windowInfo.taskInfo;
- if (mTaskLaunchingCallback != null) {
+ if (mTaskLaunchingCallback != null && shouldSendToListener(suggestionType)) {
mTaskLaunchingCallback.accept(runningTaskInfo.taskId, suggestionType);
}
if (suggestionType == STARTING_WINDOW_TYPE_SPLASH_SCREEN) {
- mStartingSurfaceDrawer.addSplashScreenStartingWindow(windowInfo, appToken);
+ mStartingSurfaceDrawer.addSplashScreenStartingWindow(windowInfo, appToken,
+ false /* emptyView */);
+ } else if (suggestionType == STARTING_WINDOW_TYPE_EMPTY_SPLASH_SCREEN) {
+ mStartingSurfaceDrawer.addSplashScreenStartingWindow(windowInfo, appToken,
+ true /* emptyView */);
} else if (suggestionType == STARTING_WINDOW_TYPE_SNAPSHOT) {
final TaskSnapshot snapshot = mStartingTypeChecker.mSnapshot;
mStartingSurfaceDrawer.makeTaskSnapshotWindow(windowInfo, appToken, snapshot);
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/startingsurface/StartingSurfaceDrawerTests.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/startingsurface/StartingSurfaceDrawerTests.java
index 78b3d4e3ca8a..d1d13131dd44 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/startingsurface/StartingSurfaceDrawerTests.java
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/startingsurface/StartingSurfaceDrawerTests.java
@@ -131,7 +131,7 @@ public class StartingSurfaceDrawerTests {
final Handler mainLoop = new Handler(Looper.getMainLooper());
final StartingWindowInfo windowInfo =
createWindowInfo(taskId, android.R.style.Theme);
- mStartingSurfaceDrawer.addSplashScreenStartingWindow(windowInfo, mBinder);
+ mStartingSurfaceDrawer.addSplashScreenStartingWindow(windowInfo, mBinder, false);
waitHandlerIdle(mainLoop);
verify(mStartingSurfaceDrawer).postAddWindow(eq(taskId), eq(mBinder), any(), any(), any());
assertEquals(mStartingSurfaceDrawer.mAddWindowForTask, taskId);
@@ -148,7 +148,7 @@ public class StartingSurfaceDrawerTests {
final Handler mainLoop = new Handler(Looper.getMainLooper());
final StartingWindowInfo windowInfo =
createWindowInfo(taskId, 0);
- mStartingSurfaceDrawer.addSplashScreenStartingWindow(windowInfo, mBinder);
+ mStartingSurfaceDrawer.addSplashScreenStartingWindow(windowInfo, mBinder, false);
waitHandlerIdle(mainLoop);
verify(mStartingSurfaceDrawer).postAddWindow(eq(taskId), eq(mBinder), any(), any(), any());
assertNotEquals(mStartingSurfaceDrawer.mViewThemeResId, 0);
diff --git a/packages/SystemUI/Android.bp b/packages/SystemUI/Android.bp
index a2359350243a..657435326d15 100644
--- a/packages/SystemUI/Android.bp
+++ b/packages/SystemUI/Android.bp
@@ -70,7 +70,6 @@ android_library {
"res",
],
static_libs: [
- "bcsmartspace",
"WindowManager-Shell",
"SystemUIPluginLib",
"SystemUISharedLib",
diff --git a/packages/SystemUI/AndroidManifest.xml b/packages/SystemUI/AndroidManifest.xml
index e97d27942f20..85ecb1c7345d 100644
--- a/packages/SystemUI/AndroidManifest.xml
+++ b/packages/SystemUI/AndroidManifest.xml
@@ -275,9 +275,6 @@
<!-- Permission to make accessibility service access Bubbles -->
<uses-permission android:name="android.permission.ADD_TRUSTED_DISPLAY" />
- <!-- Permission for Smartspace. -->
- <uses-permission android:name="android.permission.MANAGE_SMARTSPACE"/>
-
<protected-broadcast android:name="com.android.settingslib.action.REGISTER_SLICE_RECEIVER" />
<protected-broadcast android:name="com.android.settingslib.action.UNREGISTER_SLICE_RECEIVER" />
diff --git a/packages/SystemUI/res/values/ids.xml b/packages/SystemUI/res/values/ids.xml
index 9665c89cffba..bb9d33152043 100644
--- a/packages/SystemUI/res/values/ids.xml
+++ b/packages/SystemUI/res/values/ids.xml
@@ -173,5 +173,7 @@
<item type="id" name="action_move_top_right"/>
<item type="id" name="action_move_bottom_left"/>
<item type="id" name="action_move_bottom_right"/>
+ <item type="id" name="action_move_to_edge_and_hide"/>
+ <item type="id" name="action_move_out_edge_and_show"/>
</resources>
diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml
index fba62691c951..4a29578cb766 100644
--- a/packages/SystemUI/res/values/strings.xml
+++ b/packages/SystemUI/res/values/strings.xml
@@ -2705,6 +2705,10 @@
<string name="accessibility_floating_button_action_move_bottom_left">Move bottom left</string>
<!-- Action in accessibility menu to move the accessibility floating button to the bottom right of the screen. [CHAR LIMIT=30]-->
<string name="accessibility_floating_button_action_move_bottom_right">Move bottom right</string>
+ <!-- Action in accessibility menu to move the accessibility floating button to the edge and hide it to half. [CHAR LIMIT=30]-->
+ <string name="accessibility_floating_button_action_move_to_edge_and_hide_to_half">Move to edge and hide</string>
+ <!-- Action in accessibility menu to move the accessibility floating button out the edge and show. [CHAR LIMIT=30]-->
+ <string name="accessibility_floating_button_action_move_out_edge_and_show">Move out edge and show</string>
<!-- Device Controls strings -->
<!-- Device Controls empty state, title [CHAR LIMIT=30] -->
diff --git a/packages/SystemUI/src/com/android/systemui/accessibility/floatingmenu/AccessibilityFloatingMenuView.java b/packages/SystemUI/src/com/android/systemui/accessibility/floatingmenu/AccessibilityFloatingMenuView.java
index 57be4e8477b2..d89dff5027a7 100644
--- a/packages/SystemUI/src/com/android/systemui/accessibility/floatingmenu/AccessibilityFloatingMenuView.java
+++ b/packages/SystemUI/src/com/android/systemui/accessibility/floatingmenu/AccessibilityFloatingMenuView.java
@@ -303,25 +303,39 @@ public class AccessibilityFloatingMenuView extends FrameLayout
final Rect bounds = getAvailableBounds();
if (action == R.id.action_move_top_left) {
+ setShapeType(ShapeType.OVAL);
snapToLocation(bounds.left, bounds.top);
return true;
}
if (action == R.id.action_move_top_right) {
+ setShapeType(ShapeType.OVAL);
snapToLocation(bounds.right, bounds.top);
return true;
}
if (action == R.id.action_move_bottom_left) {
+ setShapeType(ShapeType.OVAL);
snapToLocation(bounds.left, bounds.bottom);
return true;
}
if (action == R.id.action_move_bottom_right) {
+ setShapeType(ShapeType.OVAL);
snapToLocation(bounds.right, bounds.bottom);
return true;
}
+ if (action == R.id.action_move_to_edge_and_hide) {
+ setShapeType(ShapeType.HALF_OVAL);
+ return true;
+ }
+
+ if (action == R.id.action_move_out_edge_and_show) {
+ setShapeType(ShapeType.OVAL);
+ return true;
+ }
+
return false;
}
@@ -446,6 +460,16 @@ public class AccessibilityFloatingMenuView extends FrameLayout
res.getString(
R.string.accessibility_floating_button_action_move_bottom_right));
info.addAction(moveBottomRight);
+
+ final int moveEdgeId = mShapeType == ShapeType.OVAL
+ ? R.id.action_move_to_edge_and_hide
+ : R.id.action_move_out_edge_and_show;
+ final int moveEdgeTextResId = mShapeType == ShapeType.OVAL
+ ? R.string.accessibility_floating_button_action_move_to_edge_and_hide_to_half
+ : R.string.accessibility_floating_button_action_move_out_edge_and_show;
+ final AccessibilityAction moveToOrOutEdge =
+ new AccessibilityAction(moveEdgeId, res.getString(moveEdgeTextResId));
+ info.addAction(moveToOrOutEdge);
}
private boolean onTouched(MotionEvent event) {
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/AuthContainerView.java b/packages/SystemUI/src/com/android/systemui/biometrics/AuthContainerView.java
index 4e93f58dd51f..1c0aa06ad8d1 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/AuthContainerView.java
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/AuthContainerView.java
@@ -589,7 +589,7 @@ public class AuthContainerView extends LinearLayout
@Override
public void dismissFromSystemServer() {
- removeWindowIfAttached();
+ animateAway(false /* sendReason */, 0 /* reason */);
}
@Override
diff --git a/packages/SystemUI/src/com/android/systemui/classifier/BrightLineFalsingManager.java b/packages/SystemUI/src/com/android/systemui/classifier/BrightLineFalsingManager.java
index 6812f77eb159..5bdc7a4b1936 100644
--- a/packages/SystemUI/src/com/android/systemui/classifier/BrightLineFalsingManager.java
+++ b/packages/SystemUI/src/com/android/systemui/classifier/BrightLineFalsingManager.java
@@ -224,7 +224,9 @@ public class BrightLineFalsingManager implements FalsingManager {
}
FalsingClassifier.Result singleTapResult =
- mSingleTapClassifier.isTap(mDataProvider.getRecentMotionEvents());
+ mSingleTapClassifier.isTap(mDataProvider.getRecentMotionEvents().isEmpty()
+ ? mDataProvider.getPriorMotionEvents()
+ : mDataProvider.getRecentMotionEvents());
mPriorResults = Collections.singleton(singleTapResult);
if (!singleTapResult.isFalse() && robustCheck) {
diff --git a/packages/SystemUI/src/com/android/systemui/media/MediaCarouselController.kt b/packages/SystemUI/src/com/android/systemui/media/MediaCarouselController.kt
index 33681c8d03e5..a3ff3753cbf9 100644
--- a/packages/SystemUI/src/com/android/systemui/media/MediaCarouselController.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/MediaCarouselController.kt
@@ -1,7 +1,6 @@
package com.android.systemui.media
import android.animation.ArgbEvaluator
-import android.app.smartspace.SmartspaceTarget
import android.content.Context
import android.content.Intent
import android.content.res.ColorStateList
@@ -202,18 +201,9 @@ class MediaCarouselController @Inject constructor(
}
}
- override fun onSmartspaceMediaDataLoaded(key: String, data: SmartspaceTarget) {
- Log.d(TAG, "My Smartspace media update is here")
- addOrUpdateSmartspaceMediaRecommendations(key, data)
- }
-
override fun onMediaDataRemoved(key: String) {
removePlayer(key)
}
-
- override fun onSmartspaceMediaDataRemoved(key: String) {
- Log.d(TAG, "My Smartspace media removal request is received")
- }
})
mediaFrame.addOnLayoutChangeListener { _, _, _, _, _, _, _, _, _ ->
// The pageIndicator is not laid out yet when we get the current state update,
@@ -301,10 +291,6 @@ class MediaCarouselController @Inject constructor(
}
}
- private fun addOrUpdateSmartspaceMediaRecommendations(key: String, data: SmartspaceTarget) {
- // TODO(b/182813345): Add Smartspace media recommendation view.
- }
-
private fun removePlayer(key: String, dismissMediaData: Boolean = true) {
val removed = MediaPlayerData.removeMediaPlayer(key)
removed?.apply {
diff --git a/packages/SystemUI/src/com/android/systemui/media/MediaDataCombineLatest.kt b/packages/SystemUI/src/com/android/systemui/media/MediaDataCombineLatest.kt
index 2c094b885032..aa3699e9a22b 100644
--- a/packages/SystemUI/src/com/android/systemui/media/MediaDataCombineLatest.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/MediaDataCombineLatest.kt
@@ -16,7 +16,6 @@
package com.android.systemui.media
-import android.app.smartspace.SmartspaceTarget
import javax.inject.Inject
/**
@@ -38,18 +37,10 @@ class MediaDataCombineLatest @Inject constructor() : MediaDataManager.Listener,
}
}
- override fun onSmartspaceMediaDataLoaded(key: String, data: SmartspaceTarget) {
- listeners.toSet().forEach { it.onSmartspaceMediaDataLoaded(key, data) }
- }
-
override fun onMediaDataRemoved(key: String) {
remove(key)
}
- override fun onSmartspaceMediaDataRemoved(key: String) {
- listeners.toSet().forEach { it.onSmartspaceMediaDataRemoved(key) }
- }
-
override fun onMediaDeviceChanged(
key: String,
oldKey: String?,
diff --git a/packages/SystemUI/src/com/android/systemui/media/MediaDataFilter.kt b/packages/SystemUI/src/com/android/systemui/media/MediaDataFilter.kt
index aab27473d3e8..1f580a953d09 100644
--- a/packages/SystemUI/src/com/android/systemui/media/MediaDataFilter.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/MediaDataFilter.kt
@@ -16,7 +16,6 @@
package com.android.systemui.media
-import android.app.smartspace.SmartspaceTarget
import android.util.Log
import com.android.internal.annotations.VisibleForTesting
import com.android.systemui.broadcast.BroadcastDispatcher
@@ -83,10 +82,6 @@ class MediaDataFilter @Inject constructor(
}
}
- override fun onSmartspaceMediaDataLoaded(key: String, data: SmartspaceTarget) {
- listeners.forEach { it.onSmartspaceMediaDataLoaded(key, data) }
- }
-
override fun onMediaDataRemoved(key: String) {
allEntries.remove(key)
userEntries.remove(key)?.let {
@@ -97,10 +92,6 @@ class MediaDataFilter @Inject constructor(
}
}
- override fun onSmartspaceMediaDataRemoved(key: String) {
- listeners.forEach { it.onSmartspaceMediaDataRemoved(key) }
- }
-
@VisibleForTesting
internal fun handleUserSwitched(id: Int) {
// If the user changes, remove all current MediaData objects and inform listeners
diff --git a/packages/SystemUI/src/com/android/systemui/media/MediaDataManager.kt b/packages/SystemUI/src/com/android/systemui/media/MediaDataManager.kt
index dfd588d0406e..41c9daedf2d4 100644
--- a/packages/SystemUI/src/com/android/systemui/media/MediaDataManager.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/MediaDataManager.kt
@@ -18,10 +18,6 @@ package com.android.systemui.media
import android.app.Notification
import android.app.PendingIntent
-import android.app.smartspace.SmartspaceConfig
-import android.app.smartspace.SmartspaceManager
-import android.app.smartspace.SmartspaceSession
-import android.app.smartspace.SmartspaceTarget
import android.content.BroadcastReceiver
import android.content.ContentResolver
import android.content.Context
@@ -37,7 +33,6 @@ import android.media.MediaMetadata
import android.media.session.MediaController
import android.media.session.MediaSession
import android.net.Uri
-import android.os.Parcelable
import android.os.UserHandle
import android.service.notification.StatusBarNotification
import android.text.TextUtils
@@ -50,7 +45,6 @@ import com.android.systemui.dagger.qualifiers.Background
import com.android.systemui.dagger.qualifiers.Main
import com.android.systemui.dump.DumpManager
import com.android.systemui.plugins.ActivityStarter
-import com.android.systemui.plugins.BcSmartspaceDataPlugin
import com.android.systemui.statusbar.NotificationMediaManager.isPlayingState
import com.android.systemui.statusbar.notification.row.HybridGroupManager
import com.android.systemui.util.Assert
@@ -60,7 +54,6 @@ import java.io.FileDescriptor
import java.io.IOException
import java.io.PrintWriter
import java.util.concurrent.Executor
-import java.util.concurrent.Executors
import javax.inject.Inject
// URI fields to try loading album art from
@@ -106,16 +99,9 @@ class MediaDataManager(
mediaDataCombineLatest: MediaDataCombineLatest,
private val mediaDataFilter: MediaDataFilter,
private val activityStarter: ActivityStarter,
- private val smartspaceMediaDataProvider: SmartspaceMediaDataProvider,
private var useMediaResumption: Boolean,
private val useQsMediaPlayer: Boolean
-) : Dumpable, BcSmartspaceDataPlugin.SmartspaceTargetListener {
-
- companion object {
- // UI surface label for subscribing Smartspace updates.
- @JvmField
- val SMARTSPACE_UI_SURFACE_LABEL = "media_data_manager"
- }
+) : Dumpable {
private val themeText = com.android.settingslib.Utils.getColorAttr(context,
com.android.internal.R.attr.textColorPrimary).defaultColor
@@ -131,8 +117,6 @@ class MediaDataManager(
// TODO(b/159539991#comment5): Move internal listeners to separate package.
private val internalListeners: MutableSet<Listener> = mutableSetOf()
private val mediaEntries: LinkedHashMap<String, MediaData> = LinkedHashMap()
- // There should ONLY be at most one Smartspace media recommendation.
- private var smartspaceMediaTarget: SmartspaceTarget? = null
internal var appsBlockedFromResume: MutableSet<String> = Utils.getBlockedMediaApps(context)
set(value) {
// Update list
@@ -144,7 +128,6 @@ class MediaDataManager(
removeAllForPackage(it)
}
}
- private var smartspaceSession: SmartspaceSession? = null
@Inject
constructor(
@@ -160,13 +143,11 @@ class MediaDataManager(
mediaDeviceManager: MediaDeviceManager,
mediaDataCombineLatest: MediaDataCombineLatest,
mediaDataFilter: MediaDataFilter,
- activityStarter: ActivityStarter,
- smartspaceMediaDataProvider: SmartspaceMediaDataProvider
+ activityStarter: ActivityStarter
) : this(context, backgroundExecutor, foregroundExecutor, mediaControllerFactory,
broadcastDispatcher, dumpManager, mediaTimeoutListener, mediaResumeListener,
mediaSessionBasedFilter, mediaDeviceManager, mediaDataCombineLatest, mediaDataFilter,
- activityStarter, smartspaceMediaDataProvider, Utils.useMediaResumption(context),
- Utils.useQsMediaPlayer(context))
+ activityStarter, Utils.useMediaResumption(context), Utils.useQsMediaPlayer(context))
private val appChangeReceiver = object : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) {
@@ -219,31 +200,9 @@ class MediaDataManager(
}
// BroadcastDispatcher does not allow filters with data schemes
context.registerReceiver(appChangeReceiver, uninstallFilter)
-
- // Register for Smartspace data updates.
- smartspaceMediaDataProvider.registerListener(this)
- val smartspaceManager: SmartspaceManager =
- context.getSystemService(SmartspaceManager::class.java)
- smartspaceSession = smartspaceManager.createSmartspaceSession(
- SmartspaceConfig.Builder(context, SMARTSPACE_UI_SURFACE_LABEL).build())
- smartspaceSession?.let {
- it.registerSmartspaceUpdates(
- // Use a new thread listening to Smartspace updates instead of using the existing
- // backgroundExecutor. SmartspaceSession has scheduled routine updates which can be
- // unpredictable on test simulators, using the backgroundExecutor makes it's hard to
- // test the threads numbers.
- // Switch to use backgroundExecutor when SmartspaceSession has a good way to be
- // mocked.
- Executors.newCachedThreadPool(),
- SmartspaceSession.Callback { targets ->
- smartspaceMediaDataProvider.onTargetsAvailable(targets)
- })
- }
- smartspaceSession?.let { it.requestSmartspaceUpdate() }
}
fun destroy() {
- smartspaceMediaDataProvider.unregisterListener(this)
context.unregisterReceiver(appChangeReceiver)
}
@@ -350,7 +309,7 @@ class MediaDataManager(
private fun addInternalListener(listener: Listener) = internalListeners.add(listener)
/**
- * Notify internal listeners of media loaded event.
+ * Notify internal listeners of loaded event.
*
* External listeners registered with [addListener] will be notified after the event propagates
* through the internal listener pipeline.
@@ -360,17 +319,7 @@ class MediaDataManager(
}
/**
- * Notify internal listeners of Smartspace media loaded event.
- *
- * External listeners registered with [addListener] will be notified after the event propagates
- * through the internal listener pipeline.
- */
- private fun notifySmartspaceMediaDataLoaded(key: String, info: SmartspaceTarget) {
- internalListeners.forEach { it.onSmartspaceMediaDataLoaded(key, info) }
- }
-
- /**
- * Notify internal listeners of media removed event.
+ * Notify internal listeners of removed event.
*
* External listeners registered with [addListener] will be notified after the event propagates
* through the internal listener pipeline.
@@ -380,16 +329,6 @@ class MediaDataManager(
}
/**
- * Notify internal listeners of Smartspace media removed event.
- *
- * External listeners registered with [addListener] will be notified after the event propagates
- * through the internal listener pipeline.
- */
- private fun notifySmartspaceMediaDataRemoved(key: String) {
- internalListeners.forEach { it.onSmartspaceMediaDataRemoved(key) }
- }
-
- /**
* Called whenever the player has been paused or stopped for a while, or swiped from QQS.
* This will make the player not active anymore, hiding it from QQS and Keyguard.
* @see MediaData.active
@@ -662,49 +601,6 @@ class MediaDataManager(
}
}
- override fun onSmartspaceTargetsUpdated(targets: List<Parcelable>) {
- Log.d(TAG, "My Smartspace media updates are here")
- val mediaTargets = targets.filterIsInstance<SmartspaceTarget>()
- when (mediaTargets.size) {
- 0 -> {
- Log.d(TAG, "Empty Smartspace media target")
- smartspaceMediaTarget?.let {
- notifySmartspaceMediaDataRemoved(it.smartspaceTargetId)
- }
- smartspaceMediaTarget = null
- }
- 1 -> {
- // TODO(b/182811956): Reactivate the resumable media sessions whose last active
- // time is within 3 hours.
- // TODO(b/182813365): Wire this up with MediaTimeoutListener so the session can be
- // expired after 30 seconds.
- val newMediaTarget = mediaTargets.get(0)
- if (smartspaceMediaTarget != null &&
- smartspaceMediaTarget!!.smartspaceTargetId ==
- newMediaTarget.smartspaceTargetId) {
- // The same Smartspace updates can be received. Only send the first one.
- Log.d(TAG, "Same Smartspace media update exists. Skip loading data.")
- } else {
- smartspaceMediaTarget?.let {
- notifySmartspaceMediaDataRemoved(it.smartspaceTargetId)
- }
- notifySmartspaceMediaDataLoaded(
- newMediaTarget.smartspaceTargetId, newMediaTarget)
- smartspaceMediaTarget = newMediaTarget
- }
- }
- else -> {
- // There should NOT be more than 1 Smartspace media update. When it happens, it
- // indicates a bad state or an error. Reset the status accordingly.
- Log.wtf(TAG, "More than 1 Smartspace Media Update. Resetting the status...")
- smartspaceMediaTarget?.let {
- notifySmartspaceMediaDataRemoved(it.smartspaceTargetId)
- }
- smartspaceMediaTarget = null
- }
- }
- }
-
fun onNotificationRemoved(key: String) {
Assert.isMainThread()
val removed = mediaEntries.remove(key)
@@ -789,16 +685,10 @@ class MediaDataManager(
*/
fun onMediaDataLoaded(key: String, oldKey: String?, data: MediaData) {}
- /** Called whenever there's new Smartspace media data loaded. */
- fun onSmartspaceMediaDataLoaded(key: String, data: SmartspaceTarget) {}
-
/**
* Called whenever a previously existing Media notification was removed
*/
fun onMediaDataRemoved(key: String) {}
-
- /** Called whenever a previously existing Smartspace media data was removed. */
- fun onSmartspaceMediaDataRemoved(key: String) {}
}
override fun dump(fd: FileDescriptor, pw: PrintWriter, args: Array<out String>) {
diff --git a/packages/SystemUI/src/com/android/systemui/media/MediaHost.kt b/packages/SystemUI/src/com/android/systemui/media/MediaHost.kt
index 8c12a305992e..b74ca283f16a 100644
--- a/packages/SystemUI/src/com/android/systemui/media/MediaHost.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/MediaHost.kt
@@ -1,6 +1,5 @@
package com.android.systemui.media
-import android.app.smartspace.SmartspaceTarget
import android.graphics.Rect
import android.util.ArraySet
import android.view.View
@@ -54,17 +53,9 @@ class MediaHost constructor(
updateViewVisibility()
}
- override fun onSmartspaceMediaDataLoaded(key: String, data: SmartspaceTarget) {
- updateViewVisibility()
- }
-
override fun onMediaDataRemoved(key: String) {
updateViewVisibility()
}
-
- override fun onSmartspaceMediaDataRemoved(key: String) {
- updateViewVisibility()
- }
}
fun addVisibilityChangeListener(listener: (Boolean) -> Unit) {
diff --git a/packages/SystemUI/src/com/android/systemui/media/MediaSessionBasedFilter.kt b/packages/SystemUI/src/com/android/systemui/media/MediaSessionBasedFilter.kt
index d973478625de..f695622b943a 100644
--- a/packages/SystemUI/src/com/android/systemui/media/MediaSessionBasedFilter.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/MediaSessionBasedFilter.kt
@@ -16,7 +16,6 @@
package com.android.systemui.media
-import android.app.smartspace.SmartspaceTarget
import android.content.ComponentName
import android.content.Context
import android.media.session.MediaController
@@ -135,12 +134,6 @@ class MediaSessionBasedFilter @Inject constructor(
}
}
- override fun onSmartspaceMediaDataLoaded(key: String, data: SmartspaceTarget) {
- backgroundExecutor.execute {
- dispatchSmartspaceMediaDataLoaded(key, data)
- }
- }
-
override fun onMediaDataRemoved(key: String) {
// Queue on background thread to ensure ordering of loaded and removed events is maintained.
backgroundExecutor.execute {
@@ -149,12 +142,6 @@ class MediaSessionBasedFilter @Inject constructor(
}
}
- override fun onSmartspaceMediaDataRemoved(key: String) {
- backgroundExecutor.execute {
- dispatchSmartspaceMediaDataRemoved(key)
- }
- }
-
private fun dispatchMediaDataLoaded(key: String, oldKey: String?, info: MediaData) {
foregroundExecutor.execute {
listeners.toSet().forEach { it.onMediaDataLoaded(key, oldKey, info) }
@@ -167,18 +154,6 @@ class MediaSessionBasedFilter @Inject constructor(
}
}
- private fun dispatchSmartspaceMediaDataLoaded(key: String, info: SmartspaceTarget) {
- foregroundExecutor.execute {
- listeners.toSet().forEach { it.onSmartspaceMediaDataLoaded(key, info) }
- }
- }
-
- private fun dispatchSmartspaceMediaDataRemoved(key: String) {
- foregroundExecutor.execute {
- listeners.toSet().forEach { it.onSmartspaceMediaDataRemoved(key) }
- }
- }
-
private fun handleControllersChanged(controllers: List<MediaController>) {
packageControllers.clear()
controllers.forEach {
diff --git a/packages/SystemUI/src/com/android/systemui/media/SmartspaceMediaDataProvider.kt b/packages/SystemUI/src/com/android/systemui/media/SmartspaceMediaDataProvider.kt
deleted file mode 100644
index 0eab572f315f..000000000000
--- a/packages/SystemUI/src/com/android/systemui/media/SmartspaceMediaDataProvider.kt
+++ /dev/null
@@ -1,39 +0,0 @@
-package com.android.systemui.media
-
-import android.app.smartspace.SmartspaceTarget
-import com.android.systemui.plugins.BcSmartspaceDataPlugin
-import com.android.systemui.plugins.BcSmartspaceDataPlugin.SmartspaceTargetListener
-import javax.inject.Inject
-
-/** Provides SmartspaceTargets of media types for SystemUI media control. */
-class SmartspaceMediaDataProvider @Inject constructor() : BcSmartspaceDataPlugin {
-
- private val smartspaceMediaTargetListeners: MutableList<SmartspaceTargetListener> =
- mutableListOf()
- private var smartspaceMediaTargets: List<SmartspaceTarget> = listOf()
-
- override fun registerListener(smartspaceTargetListener: SmartspaceTargetListener) {
- smartspaceMediaTargetListeners.add(smartspaceTargetListener)
- }
-
- override fun unregisterListener(smartspaceTargetListener: SmartspaceTargetListener?) {
- smartspaceMediaTargetListeners.remove(smartspaceTargetListener)
- }
-
- /** Updates Smartspace data and propagates it to any listeners. */
- fun onTargetsAvailable(targets: List<SmartspaceTarget>) {
- // Filter out non-media targets.
- val mediaTargets = mutableListOf<SmartspaceTarget>()
- for (target in targets) {
- val smartspaceTarget = target
- if (smartspaceTarget.featureType == SmartspaceTarget.FEATURE_MEDIA) {
- mediaTargets.add(smartspaceTarget)
- }
- }
-
- smartspaceMediaTargets = mediaTargets
- smartspaceMediaTargetListeners.forEach {
- it.onSmartspaceTargetsUpdated(smartspaceMediaTargets)
- }
- }
-} \ No newline at end of file
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileImpl.java b/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileImpl.java
index a17aebad1989..e8fc245be123 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileImpl.java
@@ -276,7 +276,9 @@ public abstract class QSTileImpl<TState extends State> implements QSTile, Lifecy
mUiEventLogger.logWithInstanceId(QSEvent.QS_ACTION_CLICK, 0, getMetricsSpec(),
getInstanceId());
mQSLogger.logTileClick(mTileSpec, mStatusBarStateController.getState(), mState.state);
- mHandler.sendEmptyMessage(H.CLICK);
+ if (!mFalsingManager.isFalseTap(true, 0.1)) {
+ mHandler.sendEmptyMessage(H.CLICK);
+ }
}
public void secondaryClick() {
@@ -605,9 +607,7 @@ public abstract class QSTileImpl<TState extends State> implements QSTile, Lifecy
mContext, mEnforcedAdmin);
mActivityStarter.postStartActivityDismissingKeyguard(intent, 0);
} else {
- if (!mFalsingManager.isFalseTap(true, 0.1)) {
- handleClick();
- }
+ handleClick();
}
} else if (msg.what == SECONDARY_CLICK) {
name = "handleSecondaryClick";
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationMediaManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationMediaManager.java
index 5782d38a9281..c565a271bdd7 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationMediaManager.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationMediaManager.java
@@ -24,7 +24,6 @@ import android.annotation.MainThread;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.app.Notification;
-import android.app.smartspace.SmartspaceTarget;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
@@ -249,11 +248,6 @@ public class NotificationMediaManager implements Dumpable {
}
@Override
- public void onSmartspaceMediaDataLoaded(@NonNull String key,
- @NonNull SmartspaceTarget data) {
- }
-
- @Override
public void onMediaDataRemoved(@NonNull String key) {
mNotifPipeline.getAllNotifs()
.stream()
@@ -266,9 +260,6 @@ public class NotificationMediaManager implements Dumpable {
getDismissedByUserStats(entry));
});
}
-
- @Override
- public void onSmartspaceMediaDataRemoved(@NonNull String key) {}
});
}
@@ -322,11 +313,6 @@ public class NotificationMediaManager implements Dumpable {
}
@Override
- public void onSmartspaceMediaDataLoaded(@NonNull String key,
- @NonNull SmartspaceTarget data) {
- }
-
- @Override
public void onMediaDataRemoved(@NonNull String key) {
NotificationEntry entry = mEntryManager.getPendingOrActiveNotif(key);
if (entry != null) {
@@ -337,9 +323,6 @@ public class NotificationMediaManager implements Dumpable {
NotificationListenerService.REASON_CANCEL);
}
}
-
- @Override
- public void onSmartspaceMediaDataRemoved(@NonNull String key) {}
});
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/accessibility/floatingmenu/AccessibilityFloatingMenuViewTest.java b/packages/SystemUI/tests/src/com/android/systemui/accessibility/floatingmenu/AccessibilityFloatingMenuViewTest.java
index 814f073edbb0..28cc580546be 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/accessibility/floatingmenu/AccessibilityFloatingMenuViewTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/accessibility/floatingmenu/AccessibilityFloatingMenuViewTest.java
@@ -348,61 +348,95 @@ public class AccessibilityFloatingMenuViewTest extends SysuiTestCase {
final AccessibilityNodeInfo infos = new AccessibilityNodeInfo();
mMenuView.onInitializeAccessibilityNodeInfo(infos);
- assertThat(infos.getActionList().size()).isEqualTo(4);
+ assertThat(infos.getActionList().size()).isEqualTo(5);
}
@Test
- public void accessibilityActionMove_moveTopLeft_success() {
+ public void accessibilityActionMove_halfOval_moveTopLeft_success() {
final AccessibilityFloatingMenuView menuView =
spy(new AccessibilityFloatingMenuView(mContext));
doReturn(mAvailableBounds).when(menuView).getAvailableBounds();
+ menuView.setShapeType(/* halfOvalShape */ 1);
final boolean isActionPerformed =
menuView.performAccessibilityAction(R.id.action_move_top_left, null);
assertThat(isActionPerformed).isTrue();
+ assertThat(menuView.mShapeType).isEqualTo(/* ovalShape */ 0);
verify(menuView).snapToLocation(mAvailableBounds.left, mAvailableBounds.top);
}
@Test
- public void accessibilityActionMove_moveTopRight_success() {
+ public void accessibilityActionMove_halfOval_moveTopRight_success() {
final AccessibilityFloatingMenuView menuView =
spy(new AccessibilityFloatingMenuView(mContext));
doReturn(mAvailableBounds).when(menuView).getAvailableBounds();
+ menuView.setShapeType(/* halfOvalShape */ 1);
final boolean isActionPerformed =
menuView.performAccessibilityAction(R.id.action_move_top_right, null);
assertThat(isActionPerformed).isTrue();
+ assertThat(menuView.mShapeType).isEqualTo(/* ovalShape */ 0);
verify(menuView).snapToLocation(mAvailableBounds.right, mAvailableBounds.top);
}
@Test
- public void accessibilityActionMove_moveBottomLeft_success() {
+ public void accessibilityActionMove_halfOval_moveBottomLeft_success() {
final AccessibilityFloatingMenuView menuView =
spy(new AccessibilityFloatingMenuView(mContext));
doReturn(mAvailableBounds).when(menuView).getAvailableBounds();
+ menuView.setShapeType(/* halfOvalShape */ 1);
final boolean isActionPerformed =
menuView.performAccessibilityAction(R.id.action_move_bottom_left, null);
assertThat(isActionPerformed).isTrue();
+ assertThat(menuView.mShapeType).isEqualTo(/* ovalShape */ 0);
verify(menuView).snapToLocation(mAvailableBounds.left, mAvailableBounds.bottom);
}
@Test
- public void accessibilityActionMove_moveBottomRight_success() {
+ public void accessibilityActionMove_halfOval_moveBottomRight_success() {
final AccessibilityFloatingMenuView menuView =
spy(new AccessibilityFloatingMenuView(mContext));
doReturn(mAvailableBounds).when(menuView).getAvailableBounds();
+ menuView.setShapeType(/* halfOvalShape */ 1);
final boolean isActionPerformed =
menuView.performAccessibilityAction(R.id.action_move_bottom_right, null);
assertThat(isActionPerformed).isTrue();
+ assertThat(menuView.mShapeType).isEqualTo(/* ovalShape */ 0);
verify(menuView).snapToLocation(mAvailableBounds.right, mAvailableBounds.bottom);
}
+ @Test
+ public void accessibilityActionMove_halfOval_moveOutEdgeAndShow_success() {
+ final AccessibilityFloatingMenuView menuView =
+ spy(new AccessibilityFloatingMenuView(mContext));
+ doReturn(mAvailableBounds).when(menuView).getAvailableBounds();
+ menuView.setShapeType(/* halfOvalShape */ 1);
+
+ final boolean isActionPerformed =
+ menuView.performAccessibilityAction(R.id.action_move_out_edge_and_show, null);
+
+ assertThat(isActionPerformed).isTrue();
+ assertThat(menuView.mShapeType).isEqualTo(/* ovalShape */ 0);
+ }
+
+ @Test
+ public void setupAccessibilityActions_oval_hasActionMoveToEdgeAndHide() {
+ final AccessibilityFloatingMenuView menuView = new AccessibilityFloatingMenuView(mContext);
+ menuView.setShapeType(/* ovalShape */ 0);
+
+ final AccessibilityNodeInfo infos = new AccessibilityNodeInfo();
+ menuView.onInitializeAccessibilityNodeInfo(infos);
+
+ assertThat(infos.getActionList().stream().anyMatch(
+ action -> action.getId() == R.id.action_move_to_edge_and_hide)).isTrue();
+ }
+
@After
public void tearDown() {
mInterceptMotionEvent = null;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/classifier/BrightLineClassifierTest.java b/packages/SystemUI/tests/src/com/android/systemui/classifier/BrightLineClassifierTest.java
index 1f165bba2bf7..923cae89401d 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/classifier/BrightLineClassifierTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/classifier/BrightLineClassifierTest.java
@@ -180,6 +180,17 @@ public class BrightLineClassifierTest extends SysuiTestCase {
}
@Test
+ public void testIsFalseTap_EmptyRecentEvents() {
+ // Ensure we look at prior events if recent events has already been emptied.
+ when(mFalsingDataProvider.getRecentMotionEvents()).thenReturn(new ArrayList<>());
+ when(mFalsingDataProvider.getPriorMotionEvents()).thenReturn(mMotionEventList);
+
+ mBrightLineFalsingManager.isFalseTap(false, 0);
+ verify(mSingleTapClassfier).isTap(mMotionEventList);
+ }
+
+
+ @Test
public void testIsFalseTap_RobustCheck_NoFaceAuth() {
when(mSingleTapClassfier.isTap(mMotionEventList)).thenReturn(mPassedResult);
when(mDoubleTapClassifier.classifyGesture(anyInt(), anyDouble(), anyDouble()))
diff --git a/packages/SystemUI/tests/src/com/android/systemui/media/MediaDataManagerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/media/MediaDataManagerTest.kt
index 96eb4b096931..e88c72860ed8 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/media/MediaDataManagerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/media/MediaDataManagerTest.kt
@@ -2,7 +2,6 @@ package com.android.systemui.media
import android.app.Notification.MediaStyle
import android.app.PendingIntent
-import android.app.smartspace.SmartspaceTarget
import android.graphics.Bitmap
import android.media.MediaDescription
import android.media.MediaMetadata
@@ -40,8 +39,6 @@ import org.mockito.Mockito.`when` as whenever
private const val KEY = "KEY"
private const val KEY_2 = "KEY_2"
-private const val KEY_MEDIA_SMARTSPACE = "MEDIA_SMARTSPACE_ID"
-private const val KEY_NONE_MEDIA_SMARTSPACE = "NONE_MEDIA_SMARTSPACE_ID"
private const val PACKAGE_NAME = "com.android.systemui"
private const val APP_NAME = "SystemUI"
private const val SESSION_ARTIST = "artist"
@@ -75,8 +72,6 @@ class MediaDataManagerTest : SysuiTestCase() {
@Mock lateinit var listener: MediaDataManager.Listener
@Mock lateinit var pendingIntent: PendingIntent
@Mock lateinit var activityStarter: ActivityStarter
- lateinit var smartspaceMediaDataProvider: SmartspaceMediaDataProvider
- @Mock lateinit var mediaSmartspaceTarget: SmartspaceTarget
lateinit var mediaDataManager: MediaDataManager
lateinit var mediaNotification: StatusBarNotification
@Captor lateinit var mediaDataCaptor: ArgumentCaptor<MediaData>
@@ -85,7 +80,6 @@ class MediaDataManagerTest : SysuiTestCase() {
fun setup() {
foregroundExecutor = FakeExecutor(FakeSystemClock())
backgroundExecutor = FakeExecutor(FakeSystemClock())
- smartspaceMediaDataProvider = SmartspaceMediaDataProvider()
mediaDataManager = MediaDataManager(
context = context,
backgroundExecutor = backgroundExecutor,
@@ -100,7 +94,6 @@ class MediaDataManagerTest : SysuiTestCase() {
mediaDataCombineLatest = mediaDataCombineLatest,
mediaDataFilter = mediaDataFilter,
activityStarter = activityStarter,
- smartspaceMediaDataProvider = smartspaceMediaDataProvider,
useMediaResumption = true,
useQsMediaPlayer = true
)
@@ -124,9 +117,6 @@ class MediaDataManagerTest : SysuiTestCase() {
// mock, it doesn't pass those events along the chain to the external listeners. So, just
// treat mediaSessionBasedFilter as a listener for testing.
listener = mediaSessionBasedFilter
-
- whenever(mediaSmartspaceTarget.smartspaceTargetId).thenReturn(KEY_MEDIA_SMARTSPACE)
- whenever(mediaSmartspaceTarget.featureType).thenReturn(SmartspaceTarget.FEATURE_MEDIA)
}
@After
@@ -330,24 +320,4 @@ class MediaDataManagerTest : SysuiTestCase() {
assertThat(foregroundExecutor.runAllReady()).isEqualTo(1)
verify(listener).onMediaDataLoaded(eq(KEY), eq(null), capture(mediaDataCaptor))
}
-
- @Test
- fun testOnSmartspaceMediaDataLoaded_hasNewMediaTarget_callsListener() {
- smartspaceMediaDataProvider.onTargetsAvailable(listOf(mediaSmartspaceTarget))
- verify(listener).onSmartspaceMediaDataLoaded(
- eq(KEY_MEDIA_SMARTSPACE), eq(mediaSmartspaceTarget))
- }
-
- @Test
- fun testOnSmartspaceMediaDataLoaded_hasNoneMediaTarget_notCallsListener() {
- smartspaceMediaDataProvider.onTargetsAvailable(listOf())
- verify(listener, never()).onSmartspaceMediaDataLoaded(anyObject(), anyObject())
- }
-
- @Test
- fun testOnSmartspaceMediaDataLoaded_hasNoneMediaTarget_callsRemoveListener() {
- smartspaceMediaDataProvider.onTargetsAvailable(listOf(mediaSmartspaceTarget))
- smartspaceMediaDataProvider.onTargetsAvailable(listOf())
- verify(listener).onSmartspaceMediaDataRemoved(KEY_MEDIA_SMARTSPACE)
- }
}
diff --git a/services/core/java/com/android/server/biometrics/PreAuthInfo.java b/services/core/java/com/android/server/biometrics/PreAuthInfo.java
index ef43bc5f5cf9..262cb36d7bdb 100644
--- a/services/core/java/com/android/server/biometrics/PreAuthInfo.java
+++ b/services/core/java/com/android/server/biometrics/PreAuthInfo.java
@@ -259,6 +259,21 @@ class PreAuthInfo {
this.confirmationRequested = confirmationRequested;
}
+ private Pair<BiometricSensor, Integer> calculateErrorByPriority() {
+ // If the caller requested STRONG, and the device contains both STRONG and non-STRONG
+ // sensors, prioritize BIOMETRIC_NOT_ENROLLED over the weak sensor's
+ // BIOMETRIC_INSUFFICIENT_STRENGTH error. Pretty sure we can always prioritize
+ // BIOMETRIC_NOT_ENROLLED over any other error (unless of course its calculation is
+ // wrong, in which case we should fix that instead).
+ for (Pair<BiometricSensor, Integer> pair : ineligibleSensors) {
+ if (pair.second == BIOMETRIC_NOT_ENROLLED) {
+ return pair;
+ }
+ }
+
+ return ineligibleSensors.get(0);
+ }
+
/**
* With {@link PreAuthInfo} generated with the requested authenticators from the public API
* surface, combined with the actual sensor/credential and user/system settings, calculate the
@@ -281,8 +296,9 @@ class PreAuthInfo {
} else {
// Pick the first sensor error if it exists
if (!ineligibleSensors.isEmpty()) {
- modality |= ineligibleSensors.get(0).first.modality;
- status = ineligibleSensors.get(0).second;
+ final Pair<BiometricSensor, Integer> pair = calculateErrorByPriority();
+ modality |= pair.first.modality;
+ status = pair.second;
} else {
modality |= TYPE_CREDENTIAL;
status = CREDENTIAL_NOT_ENROLLED;
@@ -297,8 +313,9 @@ class PreAuthInfo {
} else {
// Pick the first sensor error if it exists
if (!ineligibleSensors.isEmpty()) {
- modality |= ineligibleSensors.get(0).first.modality;
- status = ineligibleSensors.get(0).second;
+ final Pair<BiometricSensor, Integer> pair = calculateErrorByPriority();
+ modality |= pair.first.modality;
+ status = pair.second;
} else {
modality |= TYPE_NONE;
status = BIOMETRIC_NO_HARDWARE;
diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java
index d13babc166eb..01a46b311740 100644
--- a/services/core/java/com/android/server/wm/ActivityRecord.java
+++ b/services/core/java/com/android/server/wm/ActivityRecord.java
@@ -1949,7 +1949,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
boolean addStartingWindow(String pkg, int resolvedTheme, CompatibilityInfo compatInfo,
CharSequence nonLocalizedLabel, int labelRes, int icon, int logo, int windowFlags,
IBinder transferFrom, boolean newTask, boolean taskSwitch, boolean processRunning,
- boolean allowTaskSnapshot, boolean activityCreated) {
+ boolean allowTaskSnapshot, boolean activityCreated, boolean samePackage) {
// If the display is frozen, we won't do anything until the actual window is
// displayed so there is no reason to put in the starting window.
if (!okToDisplay()) {
@@ -1971,7 +1971,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
false /* restoreFromDisk */, false /* isLowResolution */);
final int typeParameter = mWmService.mStartingSurfaceController
.makeStartingWindowTypeParameter(newTask, taskSwitch, processRunning,
- allowTaskSnapshot, activityCreated);
+ allowTaskSnapshot, activityCreated, samePackage);
final int type = getStartingWindowType(newTask, taskSwitch, processRunning,
allowTaskSnapshot, activityCreated, snapshot);
@@ -6141,11 +6141,11 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
void showStartingWindow(boolean taskSwitch) {
showStartingWindow(null /* prev */, false /* newTask */, taskSwitch,
- 0 /* splashScreenTheme */);
+ 0 /* splashScreenTheme */, true /* samePackage */);
}
void showStartingWindow(ActivityRecord prev, boolean newTask, boolean taskSwitch,
- int splashScreenTheme) {
+ int splashScreenTheme, boolean samePackage) {
if (mTaskOverlay) {
// We don't show starting window for overlay activities.
return;
@@ -6165,7 +6165,8 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
compatInfo, nonLocalizedLabel, labelRes, icon, logo, windowFlags,
prev != null ? prev.appToken : null, newTask, taskSwitch, isProcessRunning(),
allowTaskSnapshot(),
- mState.ordinal() >= STARTED.ordinal() && mState.ordinal() <= STOPPED.ordinal());
+ mState.ordinal() >= STARTED.ordinal() && mState.ordinal() <= STOPPED.ordinal(),
+ samePackage);
if (shown) {
mStartingWindowState = STARTING_WINDOW_SHOWN;
}
diff --git a/services/core/java/com/android/server/wm/ActivityStarter.java b/services/core/java/com/android/server/wm/ActivityStarter.java
index 0efadcf551de..aa1f42ecd853 100644
--- a/services/core/java/com/android/server/wm/ActivityStarter.java
+++ b/services/core/java/com/android/server/wm/ActivityStarter.java
@@ -1769,9 +1769,17 @@ class ActivityStarter {
mRootWindowContainer.startPowerModeLaunchIfNeeded(
false /* forceSend */, mStartActivity);
+ final boolean startFromSamePackage;
+ if (sourceRecord != null && sourceRecord.mActivityComponent != null) {
+ startFromSamePackage = mStartActivity.mActivityComponent
+ .getPackageName().equals(sourceRecord.mActivityComponent.getPackageName());
+ } else {
+ startFromSamePackage = false;
+ }
+
mTargetRootTask.startActivityLocked(mStartActivity,
topRootTask != null ? topRootTask.getTopNonFinishingActivity() : null, newTask,
- mKeepCurTransition, mOptions);
+ mKeepCurTransition, mOptions, startFromSamePackage);
if (mDoResume) {
final ActivityRecord topTaskActivity =
mStartActivity.getTask().topRunningActivityLocked();
diff --git a/services/core/java/com/android/server/wm/StartingSurfaceController.java b/services/core/java/com/android/server/wm/StartingSurfaceController.java
index 070856949bb7..140ae3e7d756 100644
--- a/services/core/java/com/android/server/wm/StartingSurfaceController.java
+++ b/services/core/java/com/android/server/wm/StartingSurfaceController.java
@@ -20,6 +20,7 @@ import static android.window.StartingWindowInfo.TYPE_PARAMETER_ACTIVITY_CREATED;
import static android.window.StartingWindowInfo.TYPE_PARAMETER_ALLOW_TASK_SNAPSHOT;
import static android.window.StartingWindowInfo.TYPE_PARAMETER_NEW_TASK;
import static android.window.StartingWindowInfo.TYPE_PARAMETER_PROCESS_RUNNING;
+import static android.window.StartingWindowInfo.TYPE_PARAMETER_SAME_PACKAGE;
import static android.window.StartingWindowInfo.TYPE_PARAMETER_TASK_SWITCH;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME;
@@ -66,7 +67,8 @@ public class StartingSurfaceController {
}
int makeStartingWindowTypeParameter(boolean newTask, boolean taskSwitch,
- boolean processRunning, boolean allowTaskSnapshot, boolean activityCreated) {
+ boolean processRunning, boolean allowTaskSnapshot, boolean activityCreated,
+ boolean samePackage) {
int parameter = 0;
if (newTask) {
parameter |= TYPE_PARAMETER_NEW_TASK;
@@ -83,6 +85,9 @@ public class StartingSurfaceController {
if (activityCreated) {
parameter |= TYPE_PARAMETER_ACTIVITY_CREATED;
}
+ if (samePackage) {
+ parameter |= TYPE_PARAMETER_SAME_PACKAGE;
+ }
return parameter;
}
diff --git a/services/core/java/com/android/server/wm/Task.java b/services/core/java/com/android/server/wm/Task.java
index b36c25c0cae1..c293a159ec4b 100644
--- a/services/core/java/com/android/server/wm/Task.java
+++ b/services/core/java/com/android/server/wm/Task.java
@@ -6525,7 +6525,8 @@ class Task extends WindowContainer<WindowContainer> {
}
void startActivityLocked(ActivityRecord r, @Nullable ActivityRecord focusedTopActivity,
- boolean newTask, boolean keepCurTransition, ActivityOptions options) {
+ boolean newTask, boolean keepCurTransition, ActivityOptions options,
+ boolean samePackage) {
Task rTask = r.getTask();
final boolean allowMoveToFront = options == null || !options.getAvoidMoveToFront();
final boolean isOrhasTask = rTask == this || hasChild(rTask);
@@ -6647,7 +6648,7 @@ class Task extends WindowContainer<WindowContainer> {
final int splashScreenThemeResId = options != null
? options.getSplashScreenThemeResId() : 0;
r.showStartingWindow(prev, newTask, isTaskSwitch(r, focusedTopActivity),
- splashScreenThemeResId);
+ splashScreenThemeResId, samePackage);
}
} else {
// If this is the first activity, don't do any fancy animations,
diff --git a/services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java b/services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java
index ab9aa26f0e8c..124f6ddc8391 100644
--- a/services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java
@@ -2349,7 +2349,7 @@ public class ActivityRecordTests extends WindowTestsBase {
final ActivityRecord activity = new ActivityBuilder(mAtm).setCreateTask(true).build();
activity.addStartingWindow(mPackageName,
android.R.style.Theme, null, "Test", 0, 0, 0, 0, null, true, true, false, true,
- false);
+ false, false);
waitUntilHandlersIdle();
assertHasStartingWindow(activity);
activity.removeStartingWindow();
@@ -2365,7 +2365,7 @@ public class ActivityRecordTests extends WindowTestsBase {
for (int i = 0; i < 1000; i++) {
appToken.addStartingWindow(mPackageName,
android.R.style.Theme, null, "Test", 0, 0, 0, 0, null, true, true, false, true,
- false);
+ false, false);
appToken.removeStartingWindow();
waitUntilHandlersIdle();
assertNoStartingWindow(appToken);
@@ -2379,11 +2379,11 @@ public class ActivityRecordTests extends WindowTestsBase {
final ActivityRecord activity2 = new ActivityBuilder(mAtm).setCreateTask(true).build();
activity1.addStartingWindow(mPackageName,
android.R.style.Theme, null, "Test", 0, 0, 0, 0, null, true, true, false, true,
- false);
+ false, false);
waitUntilHandlersIdle();
activity2.addStartingWindow(mPackageName,
android.R.style.Theme, null, "Test", 0, 0, 0, 0, activity1.appToken.asBinder(),
- true, true, false, true, false);
+ true, true, false, true, false, false);
waitUntilHandlersIdle();
assertNoStartingWindow(activity1);
assertHasStartingWindow(activity2);
@@ -2400,11 +2400,11 @@ public class ActivityRecordTests extends WindowTestsBase {
activity2.addStartingWindow(mPackageName,
android.R.style.Theme, null, "Test", 0, 0, 0, 0,
activity1.appToken.asBinder(), true, true, false,
- true, false);
+ true, false, false);
});
activity1.addStartingWindow(mPackageName,
android.R.style.Theme, null, "Test", 0, 0, 0, 0, null, true, true, false, true,
- false);
+ false, false);
waitUntilHandlersIdle();
assertNoStartingWindow(activity1);
assertHasStartingWindow(activity2);
@@ -2417,11 +2417,11 @@ public class ActivityRecordTests extends WindowTestsBase {
final ActivityRecord activity2 = new ActivityBuilder(mAtm).setCreateTask(true).build();
activity1.addStartingWindow(mPackageName,
android.R.style.Theme, null, "Test", 0, 0, 0, 0, null, true, true, false, true,
- false);
+ false, false);
waitUntilHandlersIdle();
activity2.addStartingWindow(mPackageName,
android.R.style.Theme, null, "Test", 0, 0, 0, 0, activity1.appToken.asBinder(),
- true, true, false, true, false);
+ true, true, false, true, false, false);
waitUntilHandlersIdle();
assertNoStartingWindow(activity1);
assertHasStartingWindow(activity2);
@@ -2443,20 +2443,21 @@ public class ActivityRecordTests extends WindowTestsBase {
"Test", 0 /* labelRes */, 0 /* icon */, 0 /* logo */, 0 /* windowFlags */,
null /* transferFrom */, true /* newTask */, true /* taskSwitch */,
false /* processRunning */, false /* allowTaskSnapshot */,
- false /* activityCreate */);
+ false /* activityCreate */, false /* samePackage */);
waitUntilHandlersIdle();
assertHasStartingWindow(activity);
activity.mStartingWindowState = ActivityRecord.STARTING_WINDOW_SHOWN;
doCallRealMethod().when(task).startActivityLocked(
- any(), any(), anyBoolean(), anyBoolean(), any());
+ any(), any(), anyBoolean(), anyBoolean(), any(), anyBoolean());
// In normal case, resumeFocusedTasksTopActivities() should be called after
// startActivityLocked(). So skip resumeFocusedTasksTopActivities() in ActivityBuilder.
doReturn(false).when(mRootWindowContainer).resumeFocusedTasksTopActivities();
// Make mVisibleSetFromTransferredStartingWindow true.
final ActivityRecord middle = new ActivityBuilder(mAtm).setTask(task).build();
task.startActivityLocked(middle, null /* focusedTopActivity */,
- false /* newTask */, false /* keepCurTransition */, null /* options */);
+ false /* newTask */, false /* keepCurTransition */, null /* options */,
+ false /* samePackage */);
middle.makeFinishingLocked();
assertNull(activity.mStartingWindow);
@@ -2468,7 +2469,8 @@ public class ActivityRecordTests extends WindowTestsBase {
top.setVisible(false);
// The finishing middle should be able to transfer starting window to top.
task.startActivityLocked(top, null /* focusedTopActivity */,
- false /* newTask */, false /* keepCurTransition */, null /* options */);
+ false /* newTask */, false /* keepCurTransition */, null /* options */,
+ false /* samePackage */);
assertNull(middle.mStartingWindow);
assertHasStartingWindow(top);
@@ -2488,7 +2490,7 @@ public class ActivityRecordTests extends WindowTestsBase {
task.positionChildAt(topActivity, POSITION_TOP);
activity.addStartingWindow(mPackageName,
android.R.style.Theme, null, "Test", 0, 0, 0, 0, null, true, true, false, true,
- false);
+ false, false);
waitUntilHandlersIdle();
// Make activities to have different rotation from it display and set fixed rotation
@@ -2505,7 +2507,7 @@ public class ActivityRecordTests extends WindowTestsBase {
// on activity2.
topActivity.addStartingWindow(mPackageName,
android.R.style.Theme, null, "Test", 0, 0, 0, 0, activity.appToken.asBinder(),
- false, false, false, true, false);
+ false, false, false, true, false, false);
waitUntilHandlersIdle();
assertTrue(topActivity.hasFixedRotationTransform());
}
@@ -2521,7 +2523,7 @@ public class ActivityRecordTests extends WindowTestsBase {
// Add a starting window.
activityTop.addStartingWindow(mPackageName,
android.R.style.Theme, null, "Test", 0, 0, 0, 0, null, true, true, false, true,
- false);
+ false, false);
waitUntilHandlersIdle();
// Make the top one invisible, and try transferring the starting window from the top to the
diff --git a/services/tests/wmtests/src/com/android/server/wm/WindowTestsBase.java b/services/tests/wmtests/src/com/android/server/wm/WindowTestsBase.java
index e9e0c99c3d93..39fdb2d48a70 100644
--- a/services/tests/wmtests/src/com/android/server/wm/WindowTestsBase.java
+++ b/services/tests/wmtests/src/com/android/server/wm/WindowTestsBase.java
@@ -1138,7 +1138,7 @@ class WindowTestsBase extends SystemServiceTestsBase {
spyOn(rootTask);
}
doNothing().when(rootTask).startActivityLocked(
- any(), any(), anyBoolean(), anyBoolean(), any());
+ any(), any(), anyBoolean(), anyBoolean(), any(), anyBoolean());
// Create child task with activity.
if (mCreateActivity) {