Loading quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java +3 −3 Original line number Diff line number Diff line Loading @@ -753,7 +753,7 @@ public class TouchInteractionService extends Service implements PluginListener<O protected boolean shouldNotifyBackGesture() { return mBackGestureNotificationCounter > 0 && mDeviceState.getGestureBlockedActivityPackage() != null; !mDeviceState.getGestureBlockedActivityPackages().isEmpty(); } @WorkerThread Loading @@ -762,8 +762,8 @@ public class TouchInteractionService extends Service implements PluginListener<O mBackGestureNotificationCounter--; Utilities.getDevicePrefs(this).edit() .putInt(KEY_BACK_NOTIFICATION_COUNT, mBackGestureNotificationCounter).apply(); sendBroadcast(new Intent(NOTIFY_ACTION_BACK).setPackage( mDeviceState.getGestureBlockedActivityPackage())); mDeviceState.getGestureBlockedActivityPackages().forEach(blockedPackage -> sendBroadcast(new Intent(NOTIFY_ACTION_BACK).setPackage(blockedPackage))); } } Loading quickstep/res/values/config.xml +7 −5 Original line number Diff line number Diff line Loading @@ -13,11 +13,13 @@ See the License for the specific language governing permissions and limitations under the License. --> <resources> <string name="task_overlay_factory_class" translatable="false"></string> <resources xmlns:tools="http://schemas.android.com/tools"> <string name="task_overlay_factory_class" translatable="false"/> <!-- Activity which blocks home gesture --> <string name="gesture_blocking_activity" translatable="false"></string> <!-- Activities which block home gesture --> <string-array name="gesture_blocking_activities" tools:ignore="InconsistentArrays"> <item>com.android.launcher3/com.android.quickstep.interaction.BackGestureTutorialActivity</item> </string-array> <string name="stats_log_manager_class" translatable="false">com.android.quickstep.logging.StatsLogCompatManager</string> Loading @@ -32,5 +34,5 @@ <integer name="assistant_gesture_min_time_threshold">200</integer> <integer name="assistant_gesture_corner_deg_threshold">20</integer> <string name="wellbeing_provider_pkg" translatable="false"></string> <string name="wellbeing_provider_pkg" translatable="false"/> </resources> quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java +22 −11 Original line number Diff line number Diff line Loading @@ -66,6 +66,8 @@ import com.android.systemui.shared.system.SystemGestureExclusionListenerCompat; import java.io.PrintWriter; import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; /** * Manages the state of the system during a swipe up gesture. Loading Loading @@ -107,7 +109,7 @@ public class RecentsAnimationDeviceState implements private Region mExclusionRegion; private SystemGestureExclusionListenerCompat mExclusionListener; private ComponentName mGestureBlockedActivity; private final List<ComponentName> mGestureBlockedActivities; public RecentsAnimationDeviceState(Context context) { final ContentResolver resolver = context.getContentResolver(); Loading Loading @@ -142,9 +144,19 @@ public class RecentsAnimationDeviceState implements runOnDestroy(() -> mSysUiNavMode.removeModeChangeListener(this)); // Add any blocked activities String blockingActivity = context.getString(R.string.gesture_blocking_activity); String[] blockingActivities; try { blockingActivities = context.getResources().getStringArray(R.array.gesture_blocking_activities); } catch (Resources.NotFoundException e) { blockingActivities = new String[0]; } mGestureBlockedActivities = new ArrayList<>(blockingActivities.length); for (String blockingActivity : blockingActivities) { if (!TextUtils.isEmpty(blockingActivity)) { mGestureBlockedActivity = ComponentName.unflattenFromString(blockingActivity); mGestureBlockedActivities.add( ComponentName.unflattenFromString(blockingActivity)); } } } Loading Loading @@ -272,17 +284,16 @@ public class RecentsAnimationDeviceState implements * @return whether the given running task info matches the gesture-blocked activity. */ public boolean isGestureBlockedActivity(ActivityManager.RunningTaskInfo runningTaskInfo) { return runningTaskInfo != null && mGestureBlockedActivity != null && mGestureBlockedActivity.equals(runningTaskInfo.topActivity); return runningTaskInfo != null && mGestureBlockedActivities.contains(runningTaskInfo.topActivity); } /** * @return the package of the gesture-blocked activity or {@code null} if there is none. * @return the packages of gesture-blocked activities. */ public String getGestureBlockedActivityPackage() { return (mGestureBlockedActivity != null) ? mGestureBlockedActivity.getPackageName() : null; public List<String> getGestureBlockedActivityPackages() { return mGestureBlockedActivities.stream().map(ComponentName::getPackageName) .collect(Collectors.toList()); } /** Loading Loading
quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java +3 −3 Original line number Diff line number Diff line Loading @@ -753,7 +753,7 @@ public class TouchInteractionService extends Service implements PluginListener<O protected boolean shouldNotifyBackGesture() { return mBackGestureNotificationCounter > 0 && mDeviceState.getGestureBlockedActivityPackage() != null; !mDeviceState.getGestureBlockedActivityPackages().isEmpty(); } @WorkerThread Loading @@ -762,8 +762,8 @@ public class TouchInteractionService extends Service implements PluginListener<O mBackGestureNotificationCounter--; Utilities.getDevicePrefs(this).edit() .putInt(KEY_BACK_NOTIFICATION_COUNT, mBackGestureNotificationCounter).apply(); sendBroadcast(new Intent(NOTIFY_ACTION_BACK).setPackage( mDeviceState.getGestureBlockedActivityPackage())); mDeviceState.getGestureBlockedActivityPackages().forEach(blockedPackage -> sendBroadcast(new Intent(NOTIFY_ACTION_BACK).setPackage(blockedPackage))); } } Loading
quickstep/res/values/config.xml +7 −5 Original line number Diff line number Diff line Loading @@ -13,11 +13,13 @@ See the License for the specific language governing permissions and limitations under the License. --> <resources> <string name="task_overlay_factory_class" translatable="false"></string> <resources xmlns:tools="http://schemas.android.com/tools"> <string name="task_overlay_factory_class" translatable="false"/> <!-- Activity which blocks home gesture --> <string name="gesture_blocking_activity" translatable="false"></string> <!-- Activities which block home gesture --> <string-array name="gesture_blocking_activities" tools:ignore="InconsistentArrays"> <item>com.android.launcher3/com.android.quickstep.interaction.BackGestureTutorialActivity</item> </string-array> <string name="stats_log_manager_class" translatable="false">com.android.quickstep.logging.StatsLogCompatManager</string> Loading @@ -32,5 +34,5 @@ <integer name="assistant_gesture_min_time_threshold">200</integer> <integer name="assistant_gesture_corner_deg_threshold">20</integer> <string name="wellbeing_provider_pkg" translatable="false"></string> <string name="wellbeing_provider_pkg" translatable="false"/> </resources>
quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java +22 −11 Original line number Diff line number Diff line Loading @@ -66,6 +66,8 @@ import com.android.systemui.shared.system.SystemGestureExclusionListenerCompat; import java.io.PrintWriter; import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; /** * Manages the state of the system during a swipe up gesture. Loading Loading @@ -107,7 +109,7 @@ public class RecentsAnimationDeviceState implements private Region mExclusionRegion; private SystemGestureExclusionListenerCompat mExclusionListener; private ComponentName mGestureBlockedActivity; private final List<ComponentName> mGestureBlockedActivities; public RecentsAnimationDeviceState(Context context) { final ContentResolver resolver = context.getContentResolver(); Loading Loading @@ -142,9 +144,19 @@ public class RecentsAnimationDeviceState implements runOnDestroy(() -> mSysUiNavMode.removeModeChangeListener(this)); // Add any blocked activities String blockingActivity = context.getString(R.string.gesture_blocking_activity); String[] blockingActivities; try { blockingActivities = context.getResources().getStringArray(R.array.gesture_blocking_activities); } catch (Resources.NotFoundException e) { blockingActivities = new String[0]; } mGestureBlockedActivities = new ArrayList<>(blockingActivities.length); for (String blockingActivity : blockingActivities) { if (!TextUtils.isEmpty(blockingActivity)) { mGestureBlockedActivity = ComponentName.unflattenFromString(blockingActivity); mGestureBlockedActivities.add( ComponentName.unflattenFromString(blockingActivity)); } } } Loading Loading @@ -272,17 +284,16 @@ public class RecentsAnimationDeviceState implements * @return whether the given running task info matches the gesture-blocked activity. */ public boolean isGestureBlockedActivity(ActivityManager.RunningTaskInfo runningTaskInfo) { return runningTaskInfo != null && mGestureBlockedActivity != null && mGestureBlockedActivity.equals(runningTaskInfo.topActivity); return runningTaskInfo != null && mGestureBlockedActivities.contains(runningTaskInfo.topActivity); } /** * @return the package of the gesture-blocked activity or {@code null} if there is none. * @return the packages of gesture-blocked activities. */ public String getGestureBlockedActivityPackage() { return (mGestureBlockedActivity != null) ? mGestureBlockedActivity.getPackageName() : null; public List<String> getGestureBlockedActivityPackages() { return mGestureBlockedActivities.stream().map(ComponentName::getPackageName) .collect(Collectors.toList()); } /** Loading