diff --git a/quickstep/AndroidManifest-launcher.xml b/quickstep/AndroidManifest-launcher.xml index 60afddb0a8..527bfc3854 100644 --- a/quickstep/AndroidManifest-launcher.xml +++ b/quickstep/AndroidManifest-launcher.xml @@ -52,7 +52,7 @@ android:configChanges="keyboard|keyboardHidden|mcc|mnc|navigation|orientation|screenSize|screenLayout|smallestScreenSize" android:resizeableActivity="true" android:resumeWhilePausing="true" - android:taskAffinity="" + android:taskAffinity="${packageName}.launcher" android:enabled="true"> diff --git a/quickstep/AndroidManifest.xml b/quickstep/AndroidManifest.xml index a06a2dd208..d3606132e5 100644 --- a/quickstep/AndroidManifest.xml +++ b/quickstep/AndroidManifest.xml @@ -93,6 +93,7 @@ android:name="com.android.quickstep.interaction.GestureSandboxActivity" android:autoRemoveFromRecents="true" android:excludeFromRecents="true" + android:taskAffinity="${packageName}.launcher" android:screenOrientation="portrait"> diff --git a/src/com/android/launcher3/settings/DeveloperOptionsFragment.java b/src/com/android/launcher3/settings/DeveloperOptionsFragment.java index 049fda9372..8dc2e611e9 100644 --- a/src/com/android/launcher3/settings/DeveloperOptionsFragment.java +++ b/src/com/android/launcher3/settings/DeveloperOptionsFragment.java @@ -96,6 +96,7 @@ public class DeveloperOptionsFragment extends PreferenceFragmentCompat { initFlags(); loadPluginPrefs(); + maybeAddSandboxCategory(); } @Override @@ -203,6 +204,31 @@ public class DeveloperOptionsFragment extends PreferenceFragmentCompat { }); } + private void maybeAddSandboxCategory() { + Context context = getContext(); + if (context == null) { + return; + } + Intent launchSandboxIntent = + new Intent("com.android.quickstep.action.GESTURE_SANDBOX") + .setPackage(context.getPackageName()) + .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + if (launchSandboxIntent.resolveActivity(context.getPackageManager()) == null) { + return; + } + PreferenceCategory sandboxCategory = newCategory("Sandbox"); + Preference launchSandboxPreference = new Preference(context); + launchSandboxPreference.setKey("launchSandbox"); + launchSandboxPreference.setTitle("Launch Gesture Navigation Sandbox"); + launchSandboxPreference.setSummary( + "This provides tutorials and a place to practice navigation gestures."); + launchSandboxPreference.setOnPreferenceClickListener(preference -> { + startActivity(launchSandboxIntent); + return true; + }); + sandboxCategory.addPreference(launchSandboxPreference); + } + private String toName(String action) { String str = action.replace("com.android.systemui.action.PLUGIN_", "") .replace("com.android.launcher3.action.PLUGIN_", "");