Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions quickstep/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<uses-permission android:name="android.permission.CONTROL_REMOTE_APP_TRANSITION_ANIMATIONS" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />
<uses-permission android:name="android.permission.ALLOW_SLIPPERY_TOUCHES"/>
<uses-permission android:name="${packageName}.permission.HOTSEAT_EDU" />
<uses-permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL" />
<uses-permission android:name="android.permission.FORCE_STOP_PACKAGES" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down
12 changes: 12 additions & 0 deletions src/com/android/launcher3/util/PackageManagerHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down