]> glassweightruler.freedombox.rocks Git - waydroid.git/commitdiff
app_manager: Fix IPlatform error logging
authorAlessandro Astone <ales.astone@gmail.com>
Tue, 24 Jan 2023 21:24:07 +0000 (22:24 +0100)
committerAlessandro Astone <ales.astone@gmail.com>
Tue, 24 Jan 2023 22:13:26 +0000 (23:13 +0100)
tools/actions/app_manager.py

index 51002cb07cf50b12937d87a2b12df440af1c762d..53234ac94314d1aee444abd3632322371a13a4e8 100644 (file)
@@ -28,6 +28,8 @@ def install(args):
         platformService = IPlatform.get_service(args)
         if platformService:
             platformService.installApp("/data/waydroid_tmp/base.apk")
         platformService = IPlatform.get_service(args)
         if platformService:
             platformService.installApp("/data/waydroid_tmp/base.apk")
+        else:
+            logging.error("Failed to access IPlatform service")
         os.remove(tmp_dir + "/base.apk")
 
         if session["state"] == "FROZEN":
         os.remove(tmp_dir + "/base.apk")
 
         if session["state"] == "FROZEN":
@@ -49,6 +51,8 @@ def remove(args):
             ret = platformService.removeApp(args.PACKAGE)
             if ret != 0:
                 logging.error("Failed to uninstall package: {}".format(args.PACKAGE))
             ret = platformService.removeApp(args.PACKAGE)
             if ret != 0:
                 logging.error("Failed to uninstall package: {}".format(args.PACKAGE))
+        else:
+            logging.error("Failed to access IPlatform service")
 
         if session["state"] == "FROZEN":
             cm.Freeze()
 
         if session["state"] == "FROZEN":
             cm.Freeze()
@@ -103,11 +107,11 @@ def list(args):
                 print("categories:")
                 for cat in app["categories"]:
                     print("\t" + cat)
                 print("categories:")
                 for cat in app["categories"]:
                     print("\t" + cat)
+        else:
+            logging.error("Failed to access IPlatform service")
 
         if session["state"] == "FROZEN":
             cm.Freeze()
 
         if session["state"] == "FROZEN":
             cm.Freeze()
-        else:
-            logging.error("Failed to access IPlatform service")
     except dbus.DBusException:
         logging.error("WayDroid session is stopped")
 
     except dbus.DBusException:
         logging.error("WayDroid session is stopped")
 
@@ -123,6 +127,8 @@ def showFullUI(args):
                 statusBarService.expand()
                 time.sleep(0.5)
                 statusBarService.collapse()
                 statusBarService.expand()
                 time.sleep(0.5)
                 statusBarService.collapse()
+        else:
+            logging.error("Failed to access IPlatform service")
     maybeLaunchLater(args, justShow)
 
 def intent(args):
     maybeLaunchLater(args, justShow)
 
 def intent(args):