diff --git a/quickstep/AndroidManifest.xml b/quickstep/AndroidManifest.xml
index 75277a96d0..3e4b3f194b 100644
--- a/quickstep/AndroidManifest.xml
+++ b/quickstep/AndroidManifest.xml
@@ -32,6 +32,7 @@
+
diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/StatusBarTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/StatusBarTouchController.java
index 7a7cbb4d9b..6bd5657f86 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/StatusBarTouchController.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/StatusBarTouchController.java
@@ -20,6 +20,7 @@
import static android.view.MotionEvent.ACTION_UP;
import static android.view.MotionEvent.ACTION_CANCEL;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_SWIPE_DOWN_WORKSPACE_NOTISHADE_OPEN;
+import static android.view.WindowManager.LayoutParams.FLAG_SLIPPERY;
import android.graphics.PointF;
import android.util.SparseArray;
@@ -49,17 +50,6 @@ public class StatusBarTouchController implements TouchController {
private static final String TAG = "StatusBarController";
- /**
- * Window flag: Enable touches to slide out of a window into neighboring
- * windows in mid-gesture instead of being captured for the duration of
- * the gesture.
- *
- * This flag changes the behavior of touch focus for this window only.
- * Touches can slide out of the window but they cannot necessarily slide
- * back in (unless the other window with touch focus permits it).
- */
- private static final int FLAG_SLIPPERY = 0x20000000;
-
private final Launcher mLauncher;
private final SystemUiProxy mSystemUiProxy;
private final float mTouchSlop;
@@ -145,6 +135,15 @@ public final boolean onControllerTouchEvent(MotionEvent ev) {
return true;
}
+ /**
+ * FLAG_SLIPPERY enables touches to slide out of a window into neighboring
+ * windows in mid-gesture instead of being captured for the duration of
+ * the gesture.
+ *
+ * This flag changes the behavior of touch focus for this window only.
+ * Touches can slide out of the window but they cannot necessarily slide
+ * back in (unless the other window with touch focus permits it).
+ */
private void setWindowSlippery(boolean enable) {
Window w = mLauncher.getWindow();
WindowManager.LayoutParams wlp = w.getAttributes();
diff --git a/src/com/android/launcher3/util/PackageManagerHelper.java b/src/com/android/launcher3/util/PackageManagerHelper.java
index 8234ee0bf3..041f7aa8dc 100644
--- a/src/com/android/launcher3/util/PackageManagerHelper.java
+++ b/src/com/android/launcher3/util/PackageManagerHelper.java
@@ -153,6 +153,18 @@ public static boolean isAppSuspended(ApplicationInfo info) {
* any permissions
*/
public boolean hasPermissionForActivity(Intent intent, String srcPackage) {
+ // b/270152142
+ if (Intent.ACTION_CHOOSER.equals(intent.getAction())) {
+ final Bundle extras = intent.getExtras();
+ if (extras == null) {
+ return true;
+ }
+ // If given intent is ACTION_CHOOSER, verify srcPackage has permission over EXTRA_INTENT
+ intent = (Intent) extras.getParcelable(Intent.EXTRA_INTENT);
+ if (intent == null) {
+ return true;
+ }
+ }
ResolveInfo target = mPm.resolveActivity(intent, 0);
if (target == null) {
// Not a valid target