mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-02 19:17:10 +00:00
feat(driver): add FocusedWindowChecker capability
This commit is contained in:
1 parent
2fe01ea254
commit
3fe92537be
2 files changed
+22
No files matched your search
@@ -33,6 +33,16 @@ func (c *Client) ForegroundApp(ctx context.Context) (string, error) {
|
||||
return android.ForegroundPackage(ctx)
|
||||
}
|
||||
|
||||
// FocusedWindowApp reports the package owning the focused window. Only Android
|
||||
// is supported (via adb); other platforms return "" so the startup gate falls
|
||||
// back to the foreground-app signal.
|
||||
func (c *Client) FocusedWindowApp(ctx context.Context) (string, error) {
|
||||
if c.platform != "android" {
|
||||
return "", nil
|
||||
}
|
||||
return android.FocusedWindowPackage(ctx)
|
||||
}
|
||||
|
||||
// Dial connects to the sidecar gRPC server at the given address.
|
||||
// Address must be a host:port pair, typically "127.0.0.1:<sidecar-port>".
|
||||
func Dial(address string) (*Client, error) {
|
||||
|
||||
Reference in new issue
Block a user