diff --git a/src/org/kde/kdeconnect/Device.java b/src/org/kde/kdeconnect/Device.java index b3e9c31c..00dd18a8 100644 --- a/src/org/kde/kdeconnect/Device.java +++ b/src/org/kde/kdeconnect/Device.java @@ -722,6 +722,15 @@ public class Device implements BaseLink.PacketReceiver { return plugins.get(pluginKey); } + @Nullable + public Plugin getPluginIncludingWithoutPermissions(String pluginKey) { + Plugin p = plugins.get(pluginKey); + if (p == null) { + p = pluginsWithoutPermissions.get(pluginKey); + } + return p; + } + private synchronized boolean addPlugin(final String pluginKey) { Plugin existing = plugins.get(pluginKey); if (existing != null) { diff --git a/src/org/kde/kdeconnect/UserInterface/PluginPreference.java b/src/org/kde/kdeconnect/UserInterface/PluginPreference.java index 37a8ac8e..1c8b6643 100644 --- a/src/org/kde/kdeconnect/UserInterface/PluginPreference.java +++ b/src/org/kde/kdeconnect/UserInterface/PluginPreference.java @@ -30,15 +30,14 @@ public class PluginPreference extends SwitchPreference { PluginFactory.PluginInfo info = PluginFactory.getPluginInfo(pluginKey); setTitle(info.getDisplayName()); setSummary(info.getDescription()); -setIcon(android.R.color.transparent); + setIcon(android.R.color.transparent); setChecked(device.isPluginEnabled(pluginKey)); - Plugin plugin = device.getPlugin(pluginKey); - if (info.hasSettings() && plugin != null) { + if (info.hasSettings()) { this.listener = v -> { - Plugin plugin1 = device.getPlugin(pluginKey); - if (plugin1 != null) { - callback.onStartPluginSettingsFragment(plugin1); + Plugin plugin = device.getPluginIncludingWithoutPermissions(pluginKey); + if (plugin != null) { + callback.onStartPluginSettingsFragment(plugin); } else { //Could happen if the device is not connected anymore callback.onFinish(); } diff --git a/src/org/kde/kdeconnect/UserInterface/PluginSettingsActivity.java b/src/org/kde/kdeconnect/UserInterface/PluginSettingsActivity.java index c84f5374..0bb30157 100644 --- a/src/org/kde/kdeconnect/UserInterface/PluginSettingsActivity.java +++ b/src/org/kde/kdeconnect/UserInterface/PluginSettingsActivity.java @@ -58,7 +58,7 @@ public class PluginSettingsActivity if (pluginKey != null) { Device device = BackgroundService.getInstance().getDevice(deviceId); if (device != null) { - Plugin plugin = device.getPlugin(pluginKey); + Plugin plugin = device.getPluginIncludingWithoutPermissions(pluginKey); if (plugin != null) { fragment = plugin.getSettingsFragment(this); } diff --git a/src/org/kde/kdeconnect/UserInterface/PluginSettingsFragment.java b/src/org/kde/kdeconnect/UserInterface/PluginSettingsFragment.java index 9e767d77..a0a80946 100644 --- a/src/org/kde/kdeconnect/UserInterface/PluginSettingsFragment.java +++ b/src/org/kde/kdeconnect/UserInterface/PluginSettingsFragment.java @@ -57,7 +57,7 @@ public class PluginSettingsFragment extends PreferenceFragmentCompat { this.pluginKey = getArguments().getString(ARG_PLUGIN_KEY); this.layout = getArguments().getInt(ARG_LAYOUT); this.device = getDeviceOrThrow(getDeviceId()); - this.plugin = device.getPlugin(pluginKey); + this.plugin = device.getPluginIncludingWithoutPermissions(pluginKey); super.onCreate(savedInstanceState); }