Files
launcher/legacy/android-wasm/java/dev/ultra/launcher/wasm/RecentsService.java
T
SpriteandClaude Sonnet 5.5 66e8e90da1 Move the existing launcher into legacy/
git mv of everything (web/ android/ qt/ wasi/ android-wasm/ tests/ ci/ pixi.toml
README) so history follows; legacy/ keeps its own .gitignore and a new root
.gitignore starts for the MoonBit project.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-23 00:55:15 +00:00

39 lines
1019 B
Java

package dev.ultra.launcher.wasm;
import android.accessibilityservice.AccessibilityService;
import android.content.Intent;
import android.view.accessibility.AccessibilityEvent;
/**
* Accessibility service that opens Recents (the system's list of open windows)
* for the home screen's Windows button.
*/
public class RecentsService extends AccessibilityService {
private static volatile RecentsService running;
public static boolean showRecents() {
RecentsService s = running;
return s != null && s.performGlobalAction(GLOBAL_ACTION_RECENTS);
}
@Override
protected void onServiceConnected() {
running = this;
}
@Override
public boolean onUnbind(Intent intent) {
running = null;
return super.onUnbind(intent);
}
@Override
public void onDestroy() {
running = null;
super.onDestroy();
}
@Override public void onAccessibilityEvent(AccessibilityEvent event) { }
@Override public void onInterrupt() { }
}