mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-08-22 18:07:55 +00:00
## Summary This contains some minor code quality improvements in `RunCommandControlsProviderService`, as well as the following feature changes: * If the device for a Device Control is reachable, clicking on the secondary space of the control will launch RunCommandActivity. If the device isn't reachable, we launch the MainActivity like usual. * Pixel 7 and other modern Google devices can now show KDE Connect commands in the 'Home' quick access tile (you still have to 'add app') ## Test Plan 0. Make sure your Android OS supports Device Controls (Android 11+) 1. Choose a paired device to work with 2. Place at least one command in the Run Command list 3. Enable the command in the Device Controls screen 4. Test what happens when you click on the secondary space of the control
39 lines
908 B
Java
39 lines
908 B
Java
/*
|
|
* SPDX-FileCopyrightText: 2016 Thomas Posch <kdeconnect@online.posch.name>
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
|
|
*/
|
|
|
|
package org.kde.kdeconnect.Plugins.RunCommandPlugin;
|
|
|
|
import androidx.annotation.NonNull;
|
|
|
|
import org.json.JSONException;
|
|
import org.json.JSONObject;
|
|
import org.kde.kdeconnect.UserInterface.List.EntryItem;
|
|
|
|
class CommandEntry extends EntryItem {
|
|
private final String key;
|
|
|
|
public CommandEntry(@NonNull JSONObject o) throws JSONException {
|
|
this(o.getString("name"), o.getString("command"), o.getString("key"));
|
|
}
|
|
|
|
public CommandEntry(String name, String cmd, String key) {
|
|
super(name, cmd);
|
|
this.key = key;
|
|
}
|
|
|
|
public String getKey() {
|
|
return key;
|
|
}
|
|
|
|
public String getName() {
|
|
return title;
|
|
}
|
|
|
|
public String getCommand() {
|
|
return subtitle;
|
|
}
|
|
}
|