actions.app_manager.remove(args)
elif args.subaction == "launch":
actions.app_manager.launch(args)
+ elif args.subaction == "intent":
+ actions.app_manager.intent(args)
elif args.subaction == "list":
actions.app_manager.list(args)
else:
time.sleep(0.5)
statusBarService.collapse()
maybeLaunchLater(args, showFullUI, justShow)
+
+def intent(args):
+ def justLaunch():
+ platformService = IPlatform.get_service(args)
+ if platformService:
+ ret = platformService.launchIntent(args.ACTION, args.URI)
+ if ret == "":
+ return
+ pkg = ret if ret != "android" else "Waydroid"
+ platformService.setprop("waydroid.active_apps", pkg)
+ multiwin = platformService.getprop(
+ "persist.waydroid.multi_windows", "false")
+ if multiwin == "false":
+ platformService.settingsPutString(
+ 2, "policy_control", "immersive.status=*")
+ else:
+ platformService.settingsPutString(
+ 2, "policy_control", "immersive.full=*")
+ else:
+ logging.error("Failed to access IPlatform service")
+ maybeLaunchLater(args, intent, justLaunch)
remove.add_argument('PACKAGE', help="package name of app to remove")
launch = sub.add_parser("launch", help="start single application")
launch.add_argument('PACKAGE', help="package name of app to launch")
+ intent = sub.add_parser("intent", help="start single application")
+ intent.add_argument('ACTION', help="action name")
+ intent.add_argument('URI', help="data uri")
sub.add_parser("list", help="list installed applications")
return ret
TRANSACTION_settingsPutString = 9
TRANSACTION_settingsGetString = 10
TRANSACTION_settingsPutInt = 11
-TRANSACTION_getAppName = 12
+TRANSACTION_settingsGetInt = 12
+TRANSACTION_launchIntent = 13
class IPlatform:
def __init__(self, remote):
if exception != 0:
logging.error("Failed with code: {}".format(exception))
+ def launchIntent(self, arg1, arg2):
+ request = self.client.new_request()
+ request.append_string16(arg1)
+ request.append_string16(arg2)
+ reply, status = self.client.transact_sync_reply(
+ TRANSACTION_launchIntent, request)
+
+ if status:
+ logging.error("Sending reply failed")
+ else:
+ reader = reply.init_reader()
+ status, exception = reader.read_int32()
+ if exception == 0:
+ rep1 = reader.read_string16()
+ return rep1
+ else:
+ logging.error("Failed with code: {}".format(exception))
+ return None
+
def getAppName(self, arg1):
request = self.client.new_request()
request.append_string16(arg1)