From afd7ef04d04e004538ba220cee19e874ab8a9698 Mon Sep 17 00:00:00 2001 From: abbasfatullaev Date: Thu, 6 Apr 2023 12:54:20 +0600 Subject: [PATCH] android added isSupported method; --- .../java/com/mycompany/plugins/example/AppIconBase.java | 4 ++++ .../java/com/mycompany/plugins/example/AppIconPlugin.java | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/android/src/main/java/com/mycompany/plugins/example/AppIconBase.java b/android/src/main/java/com/mycompany/plugins/example/AppIconBase.java index 902aa8f..5d3dea0 100644 --- a/android/src/main/java/com/mycompany/plugins/example/AppIconBase.java +++ b/android/src/main/java/com/mycompany/plugins/example/AppIconBase.java @@ -30,6 +30,10 @@ public AppIconBase(Activity activity, Context context) { activeIconName = ""; } + public Boolean isSupported() { + return true; + } + public String getName() { ComponentName componentName = new ComponentName(this.activity, this.activity.getClass()); int status = pm.getComponentEnabledSetting(componentName); diff --git a/android/src/main/java/com/mycompany/plugins/example/AppIconPlugin.java b/android/src/main/java/com/mycompany/plugins/example/AppIconPlugin.java index 3c5adb2..70c2bd4 100644 --- a/android/src/main/java/com/mycompany/plugins/example/AppIconPlugin.java +++ b/android/src/main/java/com/mycompany/plugins/example/AppIconPlugin.java @@ -16,6 +16,13 @@ public void load() { implementation = new AppIconBase(this.getActivity(), this.getContext()); } + @PluginMethod() + public void isSupported(PluginCall call) { + JSObject r = new JSObject(); + r.put("value", implementation.isSupported()); + call.resolve(r); + } + @PluginMethod() public void getName(PluginCall call) { JSObject r = new JSObject();