diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2019-05-02 11:11:42 -0700 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2019-05-02 13:02:22 -0700 |
commit | 69300227c4e6ec7009f1949af15a7a880fbf7de1 (patch) | |
tree | cdc0953dbd2dc15f02b0e84682cff20edc024bf4 | |
parent | c2803ec5b272c902b6ab314d782afe852163b4ff (diff) | |
download | packages_apps_Trebuchet-69300227c4e6ec7009f1949af15a7a880fbf7de1.tar.gz packages_apps_Trebuchet-69300227c4e6ec7009f1949af15a7a880fbf7de1.tar.bz2 packages_apps_Trebuchet-69300227c4e6ec7009f1949af15a7a880fbf7de1.zip |
Adding support for blocking gesture nav on a particular activity
Bug: 129796627
Change-Id: I939598f62924fb113e913e0309247d8a2088bf8a
-rw-r--r-- | quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java | 13 | ||||
-rw-r--r-- | quickstep/res/values/config.xml | 3 |
2 files changed, 15 insertions, 1 deletions
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java index 09a1f3b23..b25865e64 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java @@ -30,6 +30,7 @@ import android.app.ActivityManager.RunningTaskInfo; import android.app.KeyguardManager; import android.app.Service; import android.content.BroadcastReceiver; +import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; @@ -45,6 +46,7 @@ import android.os.IBinder; import android.os.Looper; import android.os.Process; import android.os.RemoteException; +import android.text.TextUtils; import android.util.Log; import android.view.Choreographer; import android.view.Display; @@ -54,6 +56,7 @@ import android.view.Surface; import android.view.WindowManager; import com.android.launcher3.MainThreadExecutor; +import com.android.launcher3.R; import com.android.launcher3.Utilities; import com.android.launcher3.compat.UserManagerCompat; import com.android.launcher3.logging.EventLogArray; @@ -78,7 +81,7 @@ import java.util.List; /** * Service connected by system-UI for handling touch interaction. */ -@TargetApi(Build.VERSION_CODES.O) +@TargetApi(Build.VERSION_CODES.Q) public class TouchInteractionService extends Service implements NavigationModeChangeListener, DisplayListener { @@ -229,6 +232,7 @@ public class TouchInteractionService extends Service implements private Mode mMode = Mode.THREE_BUTTONS; private int mDefaultDisplayId; private final RectF mSwipeTouchRegion = new RectF(); + private ComponentName mGestureBlockingActivity; @Override public void onCreate() { @@ -250,6 +254,10 @@ public class TouchInteractionService extends Service implements mDefaultDisplayId = getSystemService(WindowManager.class).getDefaultDisplay() .getDisplayId(); + + String blockingActivity = getString(R.string.gesture_blocking_activity); + mGestureBlockingActivity = TextUtils.isEmpty(blockingActivity) ? null : + ComponentName.unflattenFromString(blockingActivity); sConnected = true; } @@ -464,6 +472,9 @@ public class TouchInteractionService extends Service implements } else if (ENABLE_QUICKSTEP_LIVE_TILE.get() && activityControl.isInLiveTileMode()) { base = OverviewInputConsumer.newInstance(activityControl, mInputMonitorCompat, false); + } else if (mGestureBlockingActivity != null && runningTaskInfo != null + && mGestureBlockingActivity.equals(runningTaskInfo.topActivity)) { + base = InputConsumer.NO_OP; } else { base = createOtherActivityInputConsumer(event, runningTaskInfo); } diff --git a/quickstep/res/values/config.xml b/quickstep/res/values/config.xml index 95aea43ae..e84543b37 100644 --- a/quickstep/res/values/config.xml +++ b/quickstep/res/values/config.xml @@ -18,6 +18,9 @@ <string name="overview_callbacks_class" translatable="false"></string> + <!-- Activity which blocks home gesture --> + <string name="gesture_blocking_activity" translatable="false"></string> + <string name="user_event_dispatcher_class" translatable="false">com.android.quickstep.logging.UserEventDispatcherExtension</string> <string name="stats_log_manager_class" translatable="false">com.android.quickstep.logging.StatsLogCompatManager</string> |