focusedComponent method
package/activity of the focused window, or null when adb cannot say.
Implementation
Future<String?> focusedComponent() async {
final viaServer = await _serverFocus();
if (viaServer != null) return viaServer;
try {
final r = await runCapped(
run,
adbPath,
['-s', serial, 'shell', 'dumpsys', 'window', 'displays'],
timeout: const Duration(seconds: 10),
phase: 'adb dumpsys window',
);
if (r.exitCode != 0) return null;
return parseFocusedComponent(r.stdout as String);
} on Object {
return null;
}
}