X-Git-Url: https://glassweightruler.freedombox.rocks/gitweb/waydroid.git/blobdiff_plain/21607bbefb2ec7cb04771ad6892a7b20f63f963e..20ad11568352afdbf30dacaa34c9ecd3ee926b26:/tools/interfaces/IPlatform.py diff --git a/tools/interfaces/IPlatform.py b/tools/interfaces/IPlatform.py index 12d1e1d..307508c 100644 --- a/tools/interfaces/IPlatform.py +++ b/tools/interfaces/IPlatform.py @@ -71,11 +71,11 @@ class IPlatform: reply, status = self.client.transact_sync_reply( TRANSACTION_getAppsInfo, request) + apps_list = [] if status: logging.error("Sending reply failed") else: reader = reply.init_reader() - apps_list = [] status, exception = reader.read_int32() if exception == 0: status, apps = reader.read_int32() @@ -326,10 +326,11 @@ def get_service(args): # Like ServiceManager.wait() but can be interrupted def wait_for_manager(sm): mainloop = GLib.MainLoop() - sm.add_presence_handler(lambda: mainloop.quit() if sm.is_present() else None) + hndl = sm.add_presence_handler(lambda: mainloop.quit() if sm.is_present() else None) GLib.timeout_add_seconds(60, lambda: mainloop.quit()) GLib.unix_signal_add(GLib.PRIORITY_HIGH, signal.SIGINT, lambda _: mainloop.quit(), None) mainloop.run() + sm.remove_handler(hndl) if not sm.is_present(): return False return True