diff --git a/tools/droiddeckctl b/tools/droiddeckctl index 831f5fbf89..fd9931a9cd 100755 --- a/tools/droiddeckctl +++ b/tools/droiddeckctl @@ -108,7 +108,8 @@ def receiver_call(adb: str, serial: str, method: str, arg: str | None, request: raise ControlError(f"{PACKAGE} is not running and this shell has no `content` command to start it; open DroidDeck once", "APP_NOT_RUNNING") call_id = uuid.uuid4().hex[:16] remote = f"/sdcard/Android/data/{PACKAGE}/files/agent-calls/{call_id}.json" - command = ["shell", "am", "broadcast", "-a", f"{PACKAGE}.AGENT_CALL", "-p", PACKAGE, + # By component: release variants rename the package but not the receiver's intent action. + command = ["shell", "am", "broadcast", "-n", f"{PACKAGE}/com.droiddeck.launcher.agent.AgentCallReceiver", "--es", "method", method, "--es", "id", call_id] if arg is not None: command += ["--es", "arg", shlex.quote(arg)] diff --git a/tools/tests/test_droiddeckctl.py b/tools/tests/test_droiddeckctl.py index 8a15ec92a3..4873d13ce5 100644 --- a/tools/tests/test_droiddeckctl.py +++ b/tools/tests/test_droiddeckctl.py @@ -522,7 +522,9 @@ class DroiddeckctlTest(FakeAdbTest): answer = ctl.provider_call("adb", "fake-1", "state", arg="a b", request={"x": 1}) self.assertEqual({"ok": True, "command": "state"}, answer) broadcast = next(c for c in calls if c[:2] == ("shell", "am")) - self.assertEqual(("shell", "am", "broadcast", "-a", ctl.PACKAGE + ".AGENT_CALL", "-p", ctl.PACKAGE), broadcast[:7]) + receiver = ctl.PACKAGE + "/com.droiddeck.launcher.agent.AgentCallReceiver" + self.assertEqual(("shell", "am", "broadcast", "-n", receiver), broadcast[:5]) + self.assertNotIn("-a", broadcast) self.assertIn("'a b'", broadcast) self.assertEqual(ctl.encode_request({"x": 1}), broadcast[broadcast.index("request") + 1]) call_id = broadcast[broadcast.index("id") + 1]