mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-08-30 21:55:10 +00:00
Fixed silly stuff reported by the lint analyzer
This commit is contained in:
@@ -24,14 +24,18 @@ android {
|
||||
exclude "META-INF/LICENSE.txt"
|
||||
exclude "META-INF/NOTICE.txt"
|
||||
}
|
||||
lintOptions {
|
||||
abortOnError false
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
dependencies {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
compile "com.android.support:support-v4:19.0.+"
|
||||
compile "com.android.support:appcompat-v7:19.0.+"
|
||||
compile "com.android.support:support-v4:19.1.+"
|
||||
compile "com.android.support:appcompat-v7:19.1.+"
|
||||
compile "org.apache.mina:mina-core:2.0.+"
|
||||
compile 'org.bouncycastle:bcprov-jdk16:1.45'
|
||||
compile 'org.apache.sshd:sshd-core:0.8.0'
|
||||
|
@@ -3,11 +3,10 @@
|
||||
<component name="FacetManager">
|
||||
<facet type="android" name="Android">
|
||||
<configuration>
|
||||
<option name="SELECTED_BUILD_VARIANT" value="debug" />
|
||||
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
|
||||
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebugJava" />
|
||||
<option name="ASSEMBLE_TEST_TASK_NAME" value="assembleDebugTest" />
|
||||
<option name="SOURCE_GEN_TASK_NAME" value="generateDebugSources" />
|
||||
<option name="SELECTED_BUILD_VARIANT" value="release" />
|
||||
<option name="ASSEMBLE_TASK_NAME" value="assembleRelease" />
|
||||
<option name="COMPILE_JAVA_TASK_NAME" value="compileReleaseJava" />
|
||||
<option name="SOURCE_GEN_TASK_NAME" value="generateReleaseSources" />
|
||||
<option name="ALLOW_USER_CONFIGURATION" value="false" />
|
||||
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
|
||||
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
|
||||
@@ -22,26 +21,21 @@
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="false">
|
||||
<output url="file://$MODULE_DIR$/build/classes/debug" />
|
||||
<output url="file://$MODULE_DIR$/build/classes/release" />
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/source/r/debug" isTestSource="false" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/source/aidl/debug" isTestSource="false" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/source/buildConfig/debug" isTestSource="false" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/source/rs/debug" isTestSource="false" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/res/rs/debug" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/source/r/test/debug" isTestSource="true" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/source/aidl/test/debug" isTestSource="true" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/source/buildConfig/test/debug" isTestSource="true" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/source/rs/test/debug" isTestSource="true" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/res/rs/test/debug" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/debug/jni" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/source/r/release" isTestSource="false" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/source/aidl/release" isTestSource="false" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/source/buildConfig/release" isTestSource="false" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/source/rs/release" isTestSource="false" generated="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/build/res/rs/release" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/release/res" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/release/resources" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/release/aidl" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/release/assets" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/release/java" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/release/jni" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/release/rs" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" />
|
||||
@@ -74,12 +68,12 @@
|
||||
<orderEntry type="jdk" jdkName="Android API 19 Platform" jdkType="Android SDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" exported="" name="sshd-core-0.8.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="appcompat-v7-19.0.1" level="project" />
|
||||
<orderEntry type="library" exported="" name="tomcat-apr-5.5.15" level="project" />
|
||||
<orderEntry type="library" exported="" name="slf4j-api-1.6.6" level="project" />
|
||||
<orderEntry type="library" exported="" name="appcompat-v7-19.1.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="support-v4-19.1.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="bcprov-jdk16-1.45" level="project" />
|
||||
<orderEntry type="library" exported="" name="mina-core-2.0.7" level="project" />
|
||||
<orderEntry type="library" exported="" name="support-v4-19.0.1" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
|
||||
|
@@ -1,11 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="org.kde.kdeconnect_tp"
|
||||
android:versionCode="17"
|
||||
android:versionCode="18"
|
||||
android:versionName="0.6.3">
|
||||
|
||||
<uses-sdk android:minSdkVersion="9"
|
||||
android:targetSdkVersion="18" />
|
||||
android:targetSdkVersion="19" />
|
||||
|
||||
<supports-screens
|
||||
android:smallScreens="true"
|
||||
@@ -32,7 +32,6 @@
|
||||
android:allowBackup="true"
|
||||
android:icon="@drawable/icon"
|
||||
android:label="KDE Connect"
|
||||
android:debuggable="false"
|
||||
>
|
||||
|
||||
<service
|
||||
|
@@ -1,23 +1,17 @@
|
||||
package org.kde.kdeconnect.Backends;
|
||||
|
||||
import android.content.SharedPreferences;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.util.Base64;
|
||||
|
||||
import org.kde.kdeconnect.NetworkPackage;
|
||||
|
||||
import java.security.KeyFactory;
|
||||
import java.security.PrivateKey;
|
||||
import java.security.PublicKey;
|
||||
import java.security.spec.PKCS8EncodedKeySpec;
|
||||
import java.util.ArrayList;
|
||||
|
||||
|
||||
public abstract class BaseLink {
|
||||
|
||||
private BaseLinkProvider linkProvider;
|
||||
private String deviceId;
|
||||
private ArrayList<PackageReceiver> receivers = new ArrayList<PackageReceiver>();
|
||||
private final BaseLinkProvider linkProvider;
|
||||
private final String deviceId;
|
||||
private final ArrayList<PackageReceiver> receivers = new ArrayList<PackageReceiver>();
|
||||
protected PrivateKey privateKey;
|
||||
|
||||
protected BaseLink(String deviceId, BaseLinkProvider linkProvider) {
|
||||
|
@@ -9,7 +9,7 @@ import java.util.ArrayList;
|
||||
|
||||
public abstract class BaseLinkProvider {
|
||||
|
||||
private ArrayList<ConnectionReceiver> connectionReceivers = new ArrayList<ConnectionReceiver>();
|
||||
private final ArrayList<ConnectionReceiver> connectionReceivers = new ArrayList<ConnectionReceiver>();
|
||||
|
||||
public interface ConnectionReceiver {
|
||||
public void onConnectionReceived(NetworkPackage identityPackage, BaseLink link);
|
||||
|
@@ -3,6 +3,7 @@ package org.kde.kdeconnect.Backends.LanBackend;
|
||||
import android.content.Context;
|
||||
import android.os.AsyncTask;
|
||||
import android.util.Log;
|
||||
import android.support.v4.util.LongSparseArray;
|
||||
|
||||
import org.apache.mina.core.future.ConnectFuture;
|
||||
import org.apache.mina.core.future.IoFuture;
|
||||
@@ -30,9 +31,9 @@ public class LanLinkProvider extends BaseLinkProvider {
|
||||
|
||||
private final static int port = 1714;
|
||||
|
||||
private Context context;
|
||||
private HashMap<String, LanLink> visibleComputers = new HashMap<String, LanLink>();
|
||||
private HashMap<Long, LanLink> nioSessions = new HashMap<Long, LanLink>();
|
||||
private final Context context;
|
||||
private final HashMap<String, LanLink> visibleComputers = new HashMap<String, LanLink>();
|
||||
private final LongSparseArray<LanLink> nioSessions = new LongSparseArray<LanLink>();
|
||||
|
||||
private NioSocketAcceptor tcpAcceptor = null;
|
||||
private NioDatagramAcceptor udpAcceptor = null;
|
||||
@@ -41,8 +42,9 @@ public class LanLinkProvider extends BaseLinkProvider {
|
||||
@Override
|
||||
public void sessionClosed(IoSession session) throws Exception {
|
||||
|
||||
LanLink brokenLink = nioSessions.remove(session.getId());
|
||||
LanLink brokenLink = nioSessions.get(session.getId());
|
||||
if (brokenLink != null) {
|
||||
nioSessions.remove(session.getId());
|
||||
connectionLost(brokenLink);
|
||||
brokenLink.disconnect();
|
||||
String deviceId = brokenLink.getDeviceId();
|
||||
@@ -92,7 +94,7 @@ public class LanLinkProvider extends BaseLinkProvider {
|
||||
}
|
||||
};
|
||||
|
||||
private IoHandler udpHandler = new IoHandlerAdapter() {
|
||||
private final IoHandler udpHandler = new IoHandlerAdapter() {
|
||||
@Override
|
||||
public void messageReceived(IoSession udpSession, Object message) throws Exception {
|
||||
super.messageReceived(udpSession, message);
|
||||
|
@@ -7,7 +7,7 @@ import org.kde.kdeconnect.NetworkPackage;
|
||||
|
||||
public class LoopbackLinkProvider extends BaseLinkProvider {
|
||||
|
||||
private Context context;
|
||||
private final Context context;
|
||||
|
||||
public LoopbackLinkProvider(Context context) {
|
||||
this.context = context;
|
||||
|
@@ -26,11 +26,11 @@ import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
public class BackgroundService extends Service {
|
||||
|
||||
private ArrayList<BaseLinkProvider> linkProviders = new ArrayList<BaseLinkProvider>();
|
||||
private final ArrayList<BaseLinkProvider> linkProviders = new ArrayList<BaseLinkProvider>();
|
||||
|
||||
private HashMap<String, Device> devices = new HashMap<String, Device>();
|
||||
private final HashMap<String, Device> devices = new HashMap<String, Device>();
|
||||
|
||||
private Device.PairingCallback devicePairingCallback = new Device.PairingCallback() {
|
||||
private final Device.PairingCallback devicePairingCallback = new Device.PairingCallback() {
|
||||
@Override
|
||||
public void incomingRequest() {
|
||||
if (deviceListChangedCallback != null) deviceListChangedCallback.onDeviceListChanged();
|
||||
@@ -63,7 +63,7 @@ public class BackgroundService extends Service {
|
||||
}
|
||||
}
|
||||
|
||||
public void registerLinkProviders() {
|
||||
private void registerLinkProviders() {
|
||||
|
||||
SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
|
||||
@@ -81,7 +81,7 @@ public class BackgroundService extends Service {
|
||||
return devices.get(id);
|
||||
}
|
||||
|
||||
private BaseLinkProvider.ConnectionReceiver deviceListener = new BaseLinkProvider.ConnectionReceiver() {
|
||||
private final BaseLinkProvider.ConnectionReceiver deviceListener = new BaseLinkProvider.ConnectionReceiver() {
|
||||
@Override
|
||||
public void onConnectionReceived(final NetworkPackage identityPackage, final BaseLink link) {
|
||||
|
||||
@@ -266,9 +266,9 @@ public class BackgroundService extends Service {
|
||||
void onServiceStart(BackgroundService service);
|
||||
}
|
||||
|
||||
private static ArrayList<InstanceCallback> callbacks = new ArrayList<InstanceCallback>();
|
||||
private final static ArrayList<InstanceCallback> callbacks = new ArrayList<InstanceCallback>();
|
||||
|
||||
private static final Lock mutex = new ReentrantLock(true);
|
||||
private final static Lock mutex = new ReentrantLock(true);
|
||||
|
||||
@Override
|
||||
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||
|
@@ -35,10 +35,10 @@ import java.util.TimerTask;
|
||||
|
||||
public class Device implements BaseLink.PackageReceiver {
|
||||
|
||||
private Context context;
|
||||
private final Context context;
|
||||
|
||||
private String deviceId;
|
||||
private String name;
|
||||
private final String deviceId;
|
||||
private final String name;
|
||||
public PublicKey publicKey;
|
||||
private int notificationId;
|
||||
private int protocolVersion;
|
||||
@@ -61,11 +61,11 @@ public class Device implements BaseLink.PackageReceiver {
|
||||
private ArrayList<PairingCallback> pairingCallback = new ArrayList<PairingCallback>();
|
||||
private Timer pairingTimer;
|
||||
|
||||
private ArrayList<BaseLink> links = new ArrayList<BaseLink>();
|
||||
private HashMap<String, Plugin> plugins = new HashMap<String, Plugin>();
|
||||
private HashMap<String, Plugin> failedPlugins = new HashMap<String, Plugin>();
|
||||
private final ArrayList<BaseLink> links = new ArrayList<BaseLink>();
|
||||
private final HashMap<String, Plugin> plugins = new HashMap<String, Plugin>();
|
||||
private final HashMap<String, Plugin> failedPlugins = new HashMap<String, Plugin>();
|
||||
|
||||
SharedPreferences settings;
|
||||
private final SharedPreferences settings;
|
||||
|
||||
//Remembered trusted device, we need to wait for a incoming devicelink to communicate
|
||||
Device(Context context, String deviceId) {
|
||||
@@ -653,7 +653,7 @@ public class Device implements BaseLink.PackageReceiver {
|
||||
void onPluginsChanged(Device device);
|
||||
}
|
||||
|
||||
private ArrayList<PluginsChangedListener> pluginsChangedListeners = new ArrayList<PluginsChangedListener>();
|
||||
private final ArrayList<PluginsChangedListener> pluginsChangedListeners = new ArrayList<PluginsChangedListener>();
|
||||
|
||||
public void addPluginsChangedListener(PluginsChangedListener listener) {
|
||||
pluginsChangedListeners.add(listener);
|
||||
|
@@ -13,7 +13,7 @@ public class AppsHelper {
|
||||
try {
|
||||
|
||||
PackageManager pm = context.getPackageManager();
|
||||
ApplicationInfo ai = pm.getApplicationInfo( packageName, 0);
|
||||
ApplicationInfo ai = pm.getApplicationInfo(packageName, 0);
|
||||
|
||||
return pm.getApplicationLabel(ai).toString();
|
||||
|
||||
|
@@ -3,9 +3,7 @@ package org.kde.kdeconnect.Helpers;
|
||||
import android.content.Context;
|
||||
import android.database.Cursor;
|
||||
import android.net.Uri;
|
||||
import android.provider.ContactsContract;
|
||||
import android.provider.ContactsContract.PhoneLookup;
|
||||
import android.util.Log;
|
||||
|
||||
public class ContactsHelper {
|
||||
|
||||
@@ -31,7 +29,7 @@ public class ContactsHelper {
|
||||
|
||||
// Take the first match only
|
||||
if (cursor != null && cursor.moveToFirst()) {
|
||||
int nameIndex = cursor.getColumnIndex(ContactsContract.PhoneLookup.DISPLAY_NAME);
|
||||
int nameIndex = cursor.getColumnIndex(PhoneLookup.DISPLAY_NAME);
|
||||
if (nameIndex != -1) {
|
||||
String name = cursor.getString(nameIndex);
|
||||
//Log.e("PhoneNumberLookup", "success: " + name);
|
||||
|
@@ -11,7 +11,7 @@ public class DeviceHelper {
|
||||
//from https://github.com/meetup/android-device-names
|
||||
//Converted to java using:
|
||||
//cat android_models.properties | awk -F'=' '{sub(/ *$/, "", $1)} sub(/^ */, "", $2) { if ($2 != "") print "humanReadableNames.put(\""$1"\",\"" $2 "\");"}'
|
||||
private static HashMap<String,String> humanReadableNames = new HashMap<String,String>();
|
||||
private final static HashMap<String,String> humanReadableNames = new HashMap<String,String>();
|
||||
static {
|
||||
humanReadableNames.put("5860E","Coolpad Quattro 4G");
|
||||
humanReadableNames.put("ADR6300","HTC Droid Incredible");
|
||||
|
@@ -8,7 +8,6 @@ import android.util.Base64;
|
||||
import android.util.Log;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
import org.kde.kdeconnect.Helpers.DeviceHelper;
|
||||
import org.kde.kdeconnect.UserInterface.MainSettingsActivity;
|
||||
|
@@ -8,7 +8,6 @@ import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.BatteryManager;
|
||||
import android.util.Log;
|
||||
import android.widget.Button;
|
||||
|
||||
import org.kde.kdeconnect.NetworkPackage;
|
||||
@@ -21,7 +20,7 @@ public class BatteryPlugin extends Plugin {
|
||||
private static final int THRESHOLD_EVENT_NONE= 0;
|
||||
private static final int THRESHOLD_EVENT_BATTERY_LOW = 1;
|
||||
|
||||
NetworkPackage lastInfo = null;
|
||||
private NetworkPackage lastInfo = null;
|
||||
|
||||
/*static {
|
||||
PluginFactory.registerPlugin(BatteryPlugin.class);
|
||||
@@ -52,7 +51,7 @@ public class BatteryPlugin extends Plugin {
|
||||
return true;
|
||||
}
|
||||
|
||||
private BroadcastReceiver receiver = new BroadcastReceiver() {
|
||||
private final BroadcastReceiver receiver = new BroadcastReceiver() {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent batteryIntent) {
|
||||
|
||||
|
@@ -10,11 +10,11 @@ import org.kde.kdeconnect.NetworkPackage;
|
||||
public class ClipboardListener {
|
||||
|
||||
|
||||
private Context context;
|
||||
private final Context context;
|
||||
private String currentContent;
|
||||
|
||||
private ClipboardManager cm = null;
|
||||
ClipboardManager.OnPrimaryClipChangedListener listener;
|
||||
private ClipboardManager.OnPrimaryClipChangedListener listener;
|
||||
|
||||
ClipboardListener(final Context ctx, final Device device) {
|
||||
context = ctx;
|
||||
|
@@ -126,7 +126,7 @@ public class MprisActivity extends Activity {
|
||||
|
||||
}
|
||||
|
||||
BaseLinkProvider.ConnectionReceiver connectionReceiver = new BaseLinkProvider.ConnectionReceiver() {
|
||||
private final BaseLinkProvider.ConnectionReceiver connectionReceiver = new BaseLinkProvider.ConnectionReceiver() {
|
||||
@Override
|
||||
public void onConnectionReceived(NetworkPackage identityPackage, BaseLink link) {
|
||||
connectToPlugin();
|
||||
|
@@ -5,7 +5,6 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.service.notification.NotificationListenerService;
|
||||
import android.service.notification.StatusBarNotification;
|
||||
import android.util.Log;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -16,7 +15,7 @@ public class NotificationReceiver extends NotificationListenerService {
|
||||
void onNotificationRemoved(StatusBarNotification statusBarNotification);
|
||||
}
|
||||
|
||||
private ArrayList<NotificationListener> listeners = new ArrayList<NotificationListener>();
|
||||
private final ArrayList<NotificationListener> listeners = new ArrayList<NotificationListener>();
|
||||
|
||||
public void addListener(NotificationListener listener) {
|
||||
listeners.add(listener);
|
||||
@@ -61,7 +60,7 @@ public class NotificationReceiver extends NotificationListenerService {
|
||||
void onServiceStart(NotificationReceiver service);
|
||||
}
|
||||
|
||||
private static ArrayList<InstanceCallback> callbacks = new ArrayList<InstanceCallback>();
|
||||
private final static ArrayList<InstanceCallback> callbacks = new ArrayList<InstanceCallback>();
|
||||
|
||||
public static void Start(Context c) {
|
||||
RunCommand(c, null);
|
||||
|
@@ -243,7 +243,7 @@ public class NotificationsPlugin extends Plugin implements NotificationReceiver.
|
||||
}
|
||||
}
|
||||
|
||||
if (ticker == "") {
|
||||
if (ticker.isEmpty()) {
|
||||
ticker = (notification.tickerText != null)? notification.tickerText.toString() : "";
|
||||
}
|
||||
}
|
||||
|
@@ -50,11 +50,11 @@ public class PluginFactory {
|
||||
return enabledByDefault;
|
||||
}
|
||||
|
||||
private String pluginName;
|
||||
private String displayName;
|
||||
private String description;
|
||||
private final String pluginName;
|
||||
private final String displayName;
|
||||
private final String description;
|
||||
private final Drawable icon;
|
||||
private boolean enabledByDefault;
|
||||
private final boolean enabledByDefault;
|
||||
|
||||
}
|
||||
|
||||
|
@@ -10,7 +10,6 @@ import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.telephony.SmsMessage;
|
||||
import android.telephony.TelephonyManager;
|
||||
import android.util.Log;
|
||||
import android.widget.Button;
|
||||
|
||||
import org.kde.kdeconnect.Helpers.ContactsHelper;
|
||||
@@ -49,7 +48,7 @@ public class TelephonyPlugin extends Plugin {
|
||||
return true;
|
||||
}
|
||||
|
||||
private BroadcastReceiver receiver = new BroadcastReceiver() {
|
||||
private final BroadcastReceiver receiver = new BroadcastReceiver() {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
|
||||
|
@@ -32,7 +32,7 @@ public class DeviceActivity extends ActionBarActivity {
|
||||
static private String deviceId; //Static because if we get here by using the back button in the action bar, the extra deviceId will not be set.
|
||||
private Device device;
|
||||
|
||||
private Device.PluginsChangedListener pluginsChangedListener = new Device.PluginsChangedListener() {
|
||||
private final Device.PluginsChangedListener pluginsChangedListener = new Device.PluginsChangedListener() {
|
||||
@Override
|
||||
public void onPluginsChanged(final Device device) {
|
||||
|
||||
@@ -59,6 +59,7 @@ public class DeviceActivity extends ActionBarActivity {
|
||||
errorList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> adapterView, View view, int position, long id) {
|
||||
if (position == 0) return;
|
||||
Plugin p = failedPlugins.get(ids[position - 1]); //Header is position 0, so we have to subtract one
|
||||
p.getErrorDialog(DeviceActivity.this).show();
|
||||
}
|
||||
|
@@ -1,15 +1,9 @@
|
||||
package org.kde.kdeconnect.UserInterface.List;
|
||||
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import org.kde.kdeconnect.Device;
|
||||
import org.kde.kdeconnect.UserInterface.DeviceActivity;
|
||||
import org.kde.kdeconnect.UserInterface.PairActivity;
|
||||
import org.kde.kdeconnect_tp.R;
|
||||
|
||||
public class EntryItem implements ListAdapter.Item {
|
||||
|
@@ -14,8 +14,8 @@ public class ListAdapter extends ArrayAdapter<ListAdapter.Item> {
|
||||
public View inflateView(LayoutInflater layoutInflater);
|
||||
}
|
||||
|
||||
private ArrayList<Item> items;
|
||||
private LayoutInflater layoutInflater;
|
||||
private final ArrayList<Item> items;
|
||||
private final LayoutInflater layoutInflater;
|
||||
|
||||
public ListAdapter(Context context, ArrayList<Item> items) {
|
||||
super(context, 0, items);
|
||||
|
@@ -6,7 +6,6 @@ import android.content.res.Resources;
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.app.ActionBar;
|
||||
import android.support.v7.app.ActionBarActivity;
|
||||
import android.util.Log;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
@@ -145,12 +144,13 @@ public class MainActivity extends ActionBarActivity {
|
||||
list.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
|
||||
view.callOnClick();
|
||||
view.performClick();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@@ -67,7 +67,7 @@ public class MainSettingsActivity extends PreferenceActivity{
|
||||
/**
|
||||
* Until now it sets only the default deviceName (if not already set).
|
||||
* It's safe to call this multiple time because doesn't override any previous value.
|
||||
* @param context
|
||||
* @param context the application context
|
||||
*/
|
||||
public static void initializeDeviceName(Context context){
|
||||
// I could have used getDefaultSharedPreferences(context).contains but we need to check
|
||||
@@ -84,7 +84,7 @@ public class MainSettingsActivity extends PreferenceActivity{
|
||||
}
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
|
||||
public static class GeneralPrefsFragment extends PreferenceFragment {
|
||||
private static class GeneralPrefsFragment extends PreferenceFragment {
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
@@ -18,7 +18,7 @@ public class PairActivity extends ActionBarActivity {
|
||||
private String deviceId;
|
||||
private Device device = null;
|
||||
|
||||
private Device.PairingCallback pairingCallback = new Device.PairingCallback() {
|
||||
private final Device.PairingCallback pairingCallback = new Device.PairingCallback() {
|
||||
|
||||
@Override
|
||||
public void incomingRequest() {
|
||||
|
@@ -2,7 +2,6 @@ package org.kde.kdeconnect.UserInterface;
|
||||
|
||||
import android.content.Context;
|
||||
import android.preference.Preference;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ArrayAdapter;
|
||||
@@ -12,7 +11,7 @@ import java.util.ArrayList;
|
||||
public class PreferenceListAdapter extends ArrayAdapter<Preference> {
|
||||
|
||||
|
||||
private ArrayList<Preference> localList;
|
||||
private final ArrayList<Preference> localList;
|
||||
|
||||
public PreferenceListAdapter(Context context, ArrayList<Preference> items) {
|
||||
super(context,0, items);
|
||||
|
@@ -4,7 +4,6 @@ import android.app.ListActivity;
|
||||
import android.os.Bundle;
|
||||
import android.preference.CheckBoxPreference;
|
||||
import android.preference.Preference;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.AdapterView;
|
||||
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 750 B |
Binary file not shown.
Before Width: | Height: | Size: 365 B |
Binary file not shown.
Before Width: | Height: | Size: 1.0 KiB |
Binary file not shown.
Before Width: | Height: | Size: 3.0 KiB |
@@ -5,7 +5,7 @@
|
||||
android:id="@+id/menu_refresh"
|
||||
android:icon="@drawable/ic_action_refresh"
|
||||
android:orderInCategory="200"
|
||||
kdeconnect:showAsAction="always"
|
||||
kdeconnect:showAsAction="ifRoom"
|
||||
android:title="@string/reconnect"
|
||||
/>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
android:id="@+id/menu_progress"
|
||||
android:orderInCategory="200"
|
||||
android:visible="false"
|
||||
kdeconnect:showAsAction="always"
|
||||
kdeconnect:showAsAction="ifRoom"
|
||||
kdeconnect:actionViewClass="android.widget.ProgressBar"
|
||||
/>
|
||||
|
||||
|
@@ -1,8 +0,0 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<resources>
|
||||
<string name="pref_plugin_battery">Baterijski izvještaj</string>
|
||||
<string name="pref_plugin_battery_desc">Periodično javi baterijski status</string>
|
||||
<string name="pref_plugin_ping">Ping</string>
|
||||
<string name="pref_plugin_ping_desc">Šalji i primaj ping-ove</string>
|
||||
<string name="pref_plugin_notifications">Sinhronizovano obavještenje</string>
|
||||
</resources>
|
Reference in New Issue
Block a user