mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-09-03 15:45:10 +00:00
Use Log.e instead of printStackTrace
This commit is contained in:
@@ -149,7 +149,7 @@ public class BluetoothLinkProvider extends BaseLinkProvider {
|
|||||||
try {
|
try {
|
||||||
serverSocket.close();
|
serverSocket.close();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
Log.e("KDEConnect", "Exception", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -160,7 +160,7 @@ public class BluetoothLinkProvider extends BaseLinkProvider {
|
|||||||
serverSocket = bluetoothAdapter
|
serverSocket = bluetoothAdapter
|
||||||
.listenUsingRfcommWithServiceRecord("KDE Connect", SERVICE_UUID);
|
.listenUsingRfcommWithServiceRecord("KDE Connect", SERVICE_UUID);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
Log.e("KDEConnect", "Exception", e);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -71,7 +71,7 @@ public class LanLink extends BaseLink {
|
|||||||
try {
|
try {
|
||||||
socket.close();
|
socket.close();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
Log.e("LanLink", "Error", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -257,8 +257,7 @@ public class LanLink extends BaseLink {
|
|||||||
try {
|
try {
|
||||||
np = RsaHelper.decrypt(np, privateKey);
|
np = RsaHelper.decrypt(np, privateKey);
|
||||||
} catch(Exception e) {
|
} catch(Exception e) {
|
||||||
e.printStackTrace();
|
Log.e("KDE/onPacketReceived","Exception decrypting the package", e);
|
||||||
Log.e("KDE/onPacketReceived","Exception decrypting the package");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -275,8 +274,7 @@ public class LanLink extends BaseLink {
|
|||||||
np.setPayload(new NetworkPacket.Payload(payloadSocket, np.getPayloadSize()));
|
np.setPayload(new NetworkPacket.Payload(payloadSocket, np.getPayloadSize()));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
try { payloadSocket.close(); } catch(Exception ignored) { }
|
try { payloadSocket.close(); } catch(Exception ignored) { }
|
||||||
e.printStackTrace();
|
Log.e("KDE/LanLink", "Exception connecting to payload remote socket", e);
|
||||||
Log.e("KDE/LanLink", "Exception connecting to payload remote socket");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -102,7 +102,7 @@ public class LanLinkProvider extends BaseLinkProvider implements LanLink.LinkDis
|
|||||||
networkPacket = NetworkPacket.unserialize(message);
|
networkPacket = NetworkPacket.unserialize(message);
|
||||||
//Log.e("TcpListener","Received TCP package: "+networkPacket.serialize());
|
//Log.e("TcpListener","Received TCP package: "+networkPacket.serialize());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
Log.e("KDE/LanLinkProvider", "Exception while receiving TCP packet", e);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -157,8 +157,7 @@ public class LanLinkProvider extends BaseLinkProvider implements LanLink.LinkDis
|
|||||||
identityPacketReceived(identityPacket, socket, LanLink.ConnectionStarted.Remotely);
|
identityPacketReceived(identityPacket, socket, LanLink.ConnectionStarted.Remotely);
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.e("KDE/LanLinkProvider", "Cannot connect to " + address);
|
Log.e("KDE/LanLinkProvider", "Cannot connect to " + address, e);
|
||||||
e.printStackTrace();
|
|
||||||
if (!reverseConnectionBlackList.contains(address)) {
|
if (!reverseConnectionBlackList.contains(address)) {
|
||||||
Log.w("KDE/LanLinkProvider", "Blacklisting " + address);
|
Log.w("KDE/LanLinkProvider", "Blacklisting " + address);
|
||||||
reverseConnectionBlackList.add(address);
|
reverseConnectionBlackList.add(address);
|
||||||
@@ -179,7 +178,7 @@ public class LanLinkProvider extends BaseLinkProvider implements LanLink.LinkDis
|
|||||||
try {
|
try {
|
||||||
socket.setKeepAlive(true);
|
socket.setKeepAlive(true);
|
||||||
} catch (SocketException e) {
|
} catch (SocketException e) {
|
||||||
e.printStackTrace();
|
Log.e("LanLink", "Exception", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -236,8 +235,7 @@ public class LanLinkProvider extends BaseLinkProvider implements LanLink.LinkDis
|
|||||||
Log.i("KDE/LanLinkProvider", "Handshake as " + mode + " successful with " + identityPacket.getString("deviceName") + " secured with " + event.getCipherSuite());
|
Log.i("KDE/LanLinkProvider", "Handshake as " + mode + " successful with " + identityPacket.getString("deviceName") + " secured with " + event.getCipherSuite());
|
||||||
addLink(identityPacket, sslsocket, connectionStarted);
|
addLink(identityPacket, sslsocket, connectionStarted);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.e("KDE/LanLinkProvider", "Handshake as " + mode + " failed with " + identityPacket.getString("deviceName"));
|
Log.e("KDE/LanLinkProvider", "Handshake as " + mode + " failed with " + identityPacket.getString("deviceName"), e);
|
||||||
e.printStackTrace();
|
|
||||||
BackgroundService.RunCommand(context, service -> {
|
BackgroundService.RunCommand(context, service -> {
|
||||||
Device device = service.getDevice(deviceId);
|
Device device = service.getDevice(deviceId);
|
||||||
if (device == null) return;
|
if (device == null) return;
|
||||||
@@ -252,8 +250,7 @@ public class LanLinkProvider extends BaseLinkProvider implements LanLink.LinkDis
|
|||||||
sslsocket.startHandshake();
|
sslsocket.startHandshake();
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.e("KDE/LanLinkProvider", "Handshake failed with " + identityPacket.getString("deviceName"));
|
Log.e("KDE/LanLinkProvider", "Handshake failed with " + identityPacket.getString("deviceName"), e);
|
||||||
e.printStackTrace();
|
|
||||||
|
|
||||||
//String[] ciphers = sslsocket.getSupportedCipherSuites();
|
//String[] ciphers = sslsocket.getSupportedCipherSuites();
|
||||||
//for (String cipher : ciphers) {
|
//for (String cipher : ciphers) {
|
||||||
@@ -265,7 +262,7 @@ public class LanLinkProvider extends BaseLinkProvider implements LanLink.LinkDis
|
|||||||
addLink(identityPacket, socket, connectionStarted);
|
addLink(identityPacket, socket, connectionStarted);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
Log.e("LanLink", "Exception", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -311,8 +308,7 @@ public class LanLinkProvider extends BaseLinkProvider implements LanLink.LinkDis
|
|||||||
udpServer.setReuseAddress(true);
|
udpServer.setReuseAddress(true);
|
||||||
udpServer.setBroadcast(true);
|
udpServer.setBroadcast(true);
|
||||||
} catch (SocketException e) {
|
} catch (SocketException e) {
|
||||||
Log.e("LanLinkProvider", "Error creating udp server");
|
Log.e("LanLinkProvider", "Error creating udp server", e);
|
||||||
e.printStackTrace();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
new Thread(() -> {
|
new Thread(() -> {
|
||||||
@@ -324,8 +320,7 @@ public class LanLinkProvider extends BaseLinkProvider implements LanLink.LinkDis
|
|||||||
udpServer.receive(packet);
|
udpServer.receive(packet);
|
||||||
udpPacketReceived(packet);
|
udpPacketReceived(packet);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
Log.e("LanLinkProvider", "UdpReceive exception", e);
|
||||||
Log.e("LanLinkProvider", "UdpReceive exception");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Log.w("UdpListener", "Stopping UDP listener");
|
Log.w("UdpListener", "Stopping UDP listener");
|
||||||
@@ -336,8 +331,7 @@ public class LanLinkProvider extends BaseLinkProvider implements LanLink.LinkDis
|
|||||||
try {
|
try {
|
||||||
tcpServer = openServerSocketOnFreePort(MIN_PORT);
|
tcpServer = openServerSocketOnFreePort(MIN_PORT);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.e("LanLinkProvider", "Error creating tcp server");
|
Log.e("LanLinkProvider", "Error creating tcp server", e);
|
||||||
e.printStackTrace();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
new Thread(() -> {
|
new Thread(() -> {
|
||||||
@@ -347,8 +341,7 @@ public class LanLinkProvider extends BaseLinkProvider implements LanLink.LinkDis
|
|||||||
configureSocket(socket);
|
configureSocket(socket);
|
||||||
tcpPacketReceived(socket);
|
tcpPacketReceived(socket);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
Log.e("LanLinkProvider", "TcpReceive exception", e);
|
||||||
Log.e("LanLinkProvider", "TcpReceive exception");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Log.w("TcpListener", "Stopping TCP listener");
|
Log.w("TcpListener", "Stopping TCP listener");
|
||||||
@@ -398,8 +391,7 @@ public class LanLinkProvider extends BaseLinkProvider implements LanLink.LinkDis
|
|||||||
socket.setBroadcast(true);
|
socket.setBroadcast(true);
|
||||||
bytes = identity.serialize().getBytes(StringsHelper.UTF8);
|
bytes = identity.serialize().getBytes(StringsHelper.UTF8);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
Log.e("KDE/LanLinkProvider", "Failed to create DatagramSocket", e);
|
||||||
Log.e("KDE/LanLinkProvider", "Failed to create DatagramSocket");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bytes != null) {
|
if (bytes != null) {
|
||||||
@@ -410,8 +402,7 @@ public class LanLinkProvider extends BaseLinkProvider implements LanLink.LinkDis
|
|||||||
socket.send(new DatagramPacket(bytes, bytes.length, client, MIN_PORT));
|
socket.send(new DatagramPacket(bytes, bytes.length, client, MIN_PORT));
|
||||||
//Log.i("KDE/LanLinkProvider","Udp identity package sent to address "+client);
|
//Log.i("KDE/LanLinkProvider","Udp identity package sent to address "+client);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
Log.e("KDE/LanLinkProvider", "Sending udp identity package failed. Invalid address? (" + ipstr + ")", e);
|
||||||
Log.e("KDE/LanLinkProvider", "Sending udp identity package failed. Invalid address? (" + ipstr + ")");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -449,12 +440,12 @@ public class LanLinkProvider extends BaseLinkProvider implements LanLink.LinkDis
|
|||||||
try {
|
try {
|
||||||
tcpServer.close();
|
tcpServer.close();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
Log.e("LanLink", "Exception", e);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
udpServer.close();
|
udpServer.close();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
Log.e("LanLink", "Exception", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -158,11 +158,7 @@ public class LanPairingHandler extends BasePairingHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable e) {
|
public void onFailure(Throwable e) {
|
||||||
if (e != null) {
|
Log.e("LanPairing/onFailure", "Exception", e);
|
||||||
e.printStackTrace();
|
|
||||||
} else {
|
|
||||||
Log.e("LanPairing/onFailure", "Unknown (null) exception");
|
|
||||||
}
|
|
||||||
mCallback.pairingFailed(mDevice.getContext().getString(R.string.error_could_not_send_package));
|
mCallback.pairingFailed(mDevice.getContext().getString(R.string.error_could_not_send_package));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -187,11 +183,7 @@ public class LanPairingHandler extends BasePairingHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable e) {
|
public void onFailure(Throwable e) {
|
||||||
if (e != null) {
|
Log.e("LanPairing/onFailure", "Exception", e);
|
||||||
e.printStackTrace();
|
|
||||||
} else {
|
|
||||||
Log.e("LanPairing/onFailure", "Unknown (null) exception");
|
|
||||||
}
|
|
||||||
mCallback.pairingFailed(mDevice.getContext().getString(R.string.error_not_reachable));
|
mCallback.pairingFailed(mDevice.getContext().getString(R.string.error_not_reachable));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -217,7 +209,7 @@ public class LanPairingHandler extends BasePairingHandler {
|
|||||||
String encodedPublicKey = Base64.encodeToString(mDevice.publicKey.getEncoded(), 0);
|
String encodedPublicKey = Base64.encodeToString(mDevice.publicKey.getEncoded(), 0);
|
||||||
editor.putString("publicKey", encodedPublicKey);
|
editor.putString("publicKey", encodedPublicKey);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.e("KDE/PairingDone", "Error encoding public key");
|
Log.e("KDE/PairingDone", "Error encoding public key", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -225,12 +217,11 @@ public class LanPairingHandler extends BasePairingHandler {
|
|||||||
String encodedCertificate = Base64.encodeToString(mDevice.certificate.getEncoded(), 0);
|
String encodedCertificate = Base64.encodeToString(mDevice.certificate.getEncoded(), 0);
|
||||||
editor.putString("certificate", encodedCertificate);
|
editor.putString("certificate", encodedCertificate);
|
||||||
} catch (NullPointerException n) {
|
} catch (NullPointerException n) {
|
||||||
Log.w("KDE/PairingDone", "Certificate is null, remote device does not support ssl");
|
Log.w("KDE/PairingDone", "Certificate is null, remote device does not support ssl", n);
|
||||||
} catch (CertificateEncodingException c) {
|
} catch (CertificateEncodingException c) {
|
||||||
Log.e("KDE/PairingDOne", "Error encoding certificate");
|
Log.e("KDE/PairingDOne", "Error encoding certificate", c);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
Log.e("KDE/Pairng", "Exception", e);
|
||||||
Log.e("KDE/Pairng", "Exception");
|
|
||||||
}
|
}
|
||||||
editor.apply();
|
editor.apply();
|
||||||
|
|
||||||
|
@@ -157,8 +157,7 @@ public class Device implements BaseLink.PacketReceiver {
|
|||||||
publicKey = KeyFactory.getInstance("RSA").generatePublic(new X509EncodedKeySpec(publicKeyBytes));
|
publicKey = KeyFactory.getInstance("RSA").generatePublic(new X509EncodedKeySpec(publicKeyBytes));
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
Log.e("KDE/Device", "Exception deserializing stored public key for device", e);
|
||||||
Log.e("KDE/Device", "Exception deserializing stored public key for device");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Assume every plugin is supported until addLink is called and we can get the actual list
|
//Assume every plugin is supported until addLink is called and we can get the actual list
|
||||||
@@ -459,8 +458,7 @@ public class Device implements BaseLink.PacketReceiver {
|
|||||||
certificate = SslHelper.parseCertificate(certificateBytes);
|
certificate = SslHelper.parseCertificate(certificateBytes);
|
||||||
Log.i("KDE/Device", "Got certificate ");
|
Log.i("KDE/Device", "Got certificate ");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
Log.e("KDE/Device", "Error getting certificate", e);
|
||||||
Log.e("KDE/Device", "Error getting certificate");
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -474,8 +472,7 @@ public class Device implements BaseLink.PacketReceiver {
|
|||||||
PrivateKey privateKey = KeyFactory.getInstance("RSA").generatePrivate(new PKCS8EncodedKeySpec(privateKeyBytes));
|
PrivateKey privateKey = KeyFactory.getInstance("RSA").generatePrivate(new PKCS8EncodedKeySpec(privateKeyBytes));
|
||||||
link.setPrivateKey(privateKey);
|
link.setPrivateKey(privateKey);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
Log.e("KDE/Device", "Exception reading our own private key", e); //Should not happen
|
||||||
Log.e("KDE/Device", "Exception reading our own private key"); //Should not happen
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.i("KDE/Device", "addLink " + link.getLinkProvider().getName() + " -> " + getName() + " active links: " + links.size());
|
Log.i("KDE/Device", "addLink " + link.getLinkProvider().getName() + " -> " + getName() + " active links: " + links.size());
|
||||||
@@ -559,8 +556,7 @@ public class Device implements BaseLink.PacketReceiver {
|
|||||||
try {
|
try {
|
||||||
ph.packageReceived(np);
|
ph.packageReceived(np);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
Log.e("PairingPacketReceived", "Exception", e);
|
||||||
Log.e("PairingPacketReceived", "Exception");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (isPaired()) {
|
} else if (isPaired()) {
|
||||||
@@ -578,8 +574,7 @@ public class Device implements BaseLink.PacketReceiver {
|
|||||||
try {
|
try {
|
||||||
plugin.onPacketReceived(np);
|
plugin.onPacketReceived(np);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
Log.e("KDE/Device", "Exception in " + plugin.getPluginKey() + "'s onPacketReceived()", e);
|
||||||
Log.e("KDE/Device", "Exception in " + plugin.getPluginKey() + "'s onPacketReceived()");
|
|
||||||
//try { Log.e("KDE/Device", "NetworkPacket:" + np.serialize()); } catch (Exception _) { }
|
//try { Log.e("KDE/Device", "NetworkPacket:" + np.serialize()); } catch (Exception _) { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -604,8 +599,7 @@ public class Device implements BaseLink.PacketReceiver {
|
|||||||
try {
|
try {
|
||||||
plugin.onUnpairedDevicePacketReceived(np);
|
plugin.onUnpairedDevicePacketReceived(np);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
Log.e("KDE/Device", "Exception in " + plugin.getDisplayName() + "'s onPacketReceived() in unPairedPacketListeners", e);
|
||||||
Log.e("KDE/Device", "Exception in " + plugin.getDisplayName() + "'s onPacketReceived() in unPairedPacketListeners");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -631,11 +625,7 @@ public class Device implements BaseLink.PacketReceiver {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable e) {
|
public void onFailure(Throwable e) {
|
||||||
if (e != null) {
|
Log.e("KDE/sendPacket", "Exception", e);
|
||||||
e.printStackTrace();
|
|
||||||
} else {
|
|
||||||
Log.e("KDE/sendPacket", "Unknown (null) exception");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -734,10 +724,7 @@ public class Device implements BaseLink.PacketReceiver {
|
|||||||
success = plugin.onCreate();
|
success = plugin.onCreate();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
success = false;
|
success = false;
|
||||||
e.printStackTrace();
|
Log.e("KDE/addPlugin", "plugin failed to load " + pluginKey, e);
|
||||||
}
|
|
||||||
if (!success) {
|
|
||||||
Log.e("KDE/addPlugin", "plugin failed to load " + pluginKey);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
plugins.put(pluginKey, plugin);
|
plugins.put(pluginKey, plugin);
|
||||||
@@ -775,8 +762,7 @@ public class Device implements BaseLink.PacketReceiver {
|
|||||||
plugin.onDestroy();
|
plugin.onDestroy();
|
||||||
//Log.e("removePlugin","removed " + pluginKey);
|
//Log.e("removePlugin","removed " + pluginKey);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
Log.e("KDE/removePlugin", "Exception calling onDestroy for plugin " + pluginKey, e);
|
||||||
Log.e("KDE/removePlugin", "Exception calling onDestroy for plugin " + pluginKey);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@@ -39,8 +39,7 @@ public class AppsHelper {
|
|||||||
|
|
||||||
} catch (final PackageManager.NameNotFoundException e) {
|
} catch (final PackageManager.NameNotFoundException e) {
|
||||||
|
|
||||||
e.printStackTrace();
|
Log.e("AppsHelper", "Could not resolve name " + packageName, e);
|
||||||
Log.e("AppsHelper", "Could not resolve name " + packageName);
|
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
@@ -57,15 +56,8 @@ public class AppsHelper {
|
|||||||
return pm.getApplicationIcon(ai);
|
return pm.getApplicationIcon(ai);
|
||||||
|
|
||||||
} catch (final PackageManager.NameNotFoundException e) {
|
} catch (final PackageManager.NameNotFoundException e) {
|
||||||
|
Log.e("AppsHelper", "Could not find icon for " + packageName, e);
|
||||||
e.printStackTrace();
|
|
||||||
Log.e("AppsHelper", "Could not find icon for " + packageName);
|
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -191,7 +191,7 @@ public class ContactsHelper {
|
|||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
// If you are experiencing this, please open a bug report indicating how you got here
|
// If you are experiencing this, please open a bug report indicating how you got here
|
||||||
e.printStackTrace();
|
Log.e("Contacts", "Exception while fetching vcards", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
// At this point we are screwed:
|
// At this point we are screwed:
|
||||||
@@ -239,10 +239,10 @@ public class ContactsHelper {
|
|||||||
toReturn.put(ID, new VCardBuilder(vcard.toString()));
|
toReturn.put(ID, new VCardBuilder(vcard.toString()));
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
// If you are experiencing this, please open a bug report indicating how you got here
|
// If you are experiencing this, please open a bug report indicating how you got here
|
||||||
e.printStackTrace();
|
Log.e("Contacts", "Exception while fetching vcards", e);
|
||||||
} catch (NullPointerException e) {
|
} catch (NullPointerException e) {
|
||||||
// If you are experiencing this, please open a bug report indicating how you got here
|
// If you are experiencing this, please open a bug report indicating how you got here
|
||||||
e.printStackTrace();
|
Log.e("Contacts", "Exception while fetching vcards", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -496,8 +496,7 @@ public class DeviceHelper {
|
|||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
//Some phones might not define BRAND or MODEL, ignore exceptions
|
//Some phones might not define BRAND or MODEL, ignore exceptions
|
||||||
Log.e("Exception", e.getMessage());
|
Log.e("Exception", e.getMessage(), e);
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
if (deviceName == null || deviceName.isEmpty()) {
|
if (deviceName == null || deviceName.isEmpty()) {
|
||||||
return "Android"; //Could not find a name
|
return "Android"; //Could not find a name
|
||||||
|
@@ -129,8 +129,7 @@ public class FilesHelper {
|
|||||||
try {
|
try {
|
||||||
size = new File(uri.getPath()).length();
|
size = new File(uri.getPath()).length();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.e("SendFileActivity", "Could not obtain file size");
|
Log.e("SendFileActivity", "Could not obtain file size", e);
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@@ -155,8 +154,7 @@ public class FilesHelper {
|
|||||||
String name = cursor.getString(column_index);
|
String name = cursor.getString(column_index);
|
||||||
np.set("filename", name);
|
np.set("filename", name);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
Log.e("SendFileActivity", "Could not obtain file name", e);
|
||||||
Log.e("SendFileActivity", "Could not obtain file name");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -165,8 +163,7 @@ public class FilesHelper {
|
|||||||
//For some reason this size can differ from the actual file size!
|
//For some reason this size can differ from the actual file size!
|
||||||
size = cursor.getInt(column_index);
|
size = cursor.getInt(column_index);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.e("SendFileActivity", "Could not obtain file size");
|
Log.e("SendFileActivity", "Could not obtain file size", e);
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
try {
|
try {
|
||||||
@@ -182,7 +179,6 @@ public class FilesHelper {
|
|||||||
return np;
|
return np;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.e("SendFileActivity", "Exception creating network packet", e);
|
Log.e("SendFileActivity", "Exception creating network packet", e);
|
||||||
e.printStackTrace();
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -45,14 +45,12 @@ public class NetworkHelper {
|
|||||||
return false; //I have neighbours, so this doesn't look like a mobile network
|
return false; //I have neighbours, so this doesn't look like a mobile network
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.e("NetworkHelper", "Exception reading procnetarp");
|
Log.e("NetworkHelper", "Exception reading procnetarp", e);
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return mobile;
|
return mobile;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
Log.e("isOnMobileNetwork", "Something went wrong, but this is non-critical.", e);
|
||||||
Log.d("isOnMobileNetwork", "Something went wrong, but this is non-critical.");
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@@ -55,8 +55,7 @@ public class RsaHelper {
|
|||||||
keyGen.initialize(2048);
|
keyGen.initialize(2048);
|
||||||
keyPair = keyGen.genKeyPair();
|
keyPair = keyGen.genKeyPair();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
Log.e("KDE/initializeRsaKeys", "Exception", e);
|
||||||
Log.e("KDE/initializeRsaKeys", "Exception");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -114,8 +114,7 @@ public class SslHelper {
|
|||||||
edit.apply();
|
edit.apply();
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
Log.e("KDE/initialiseCert", "Exception", e);
|
||||||
Log.e("KDE/initialiseCert", "Exception");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@@ -125,8 +124,7 @@ public class SslHelper {
|
|||||||
X509CertificateHolder certificateHolder = new X509CertificateHolder(certificateBytes);
|
X509CertificateHolder certificateHolder = new X509CertificateHolder(certificateBytes);
|
||||||
certificate = new JcaX509CertificateConverter().setProvider(BC).getCertificate(certificateHolder);
|
certificate = new JcaX509CertificateConverter().setProvider(BC).getCertificate(certificateHolder);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.e("KDE/SslHelper", "Exception reading own certificate");
|
Log.e("KDE/SslHelper", "Exception reading own certificate", e);
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -195,8 +193,7 @@ public class SslHelper {
|
|||||||
}
|
}
|
||||||
return tlsContext;
|
return tlsContext;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.e("KDE/SslHelper", "Error creating tls context");
|
Log.e("KDE/SslHelper", "Error creating tls context", e);
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
@@ -26,6 +26,7 @@ import android.net.Uri;
|
|||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Environment;
|
import android.os.Environment;
|
||||||
import android.provider.DocumentsContract;
|
import android.provider.DocumentsContract;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@@ -89,7 +90,7 @@ public class StorageHelper {
|
|||||||
try (Scanner scanner = new Scanner(new File("/proc/mounts"))) {
|
try (Scanner scanner = new Scanner(new File("/proc/mounts"))) {
|
||||||
mounts = scanner.useDelimiter("\\A").next();
|
mounts = scanner.useDelimiter("\\A").next();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
Log.e("StorageHelper", "Exception while getting storageList", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
File dirs[] = storage.listFiles();
|
File dirs[] = storage.listFiles();
|
||||||
@@ -129,7 +130,7 @@ public class StorageHelper {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
Log.e("StorageHelper", "Exception", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (String line : entries) {
|
for (String line : entries) {
|
||||||
|
@@ -279,8 +279,7 @@ public class NetworkPacket {
|
|||||||
np.mBody.put("incomingCapabilities", new JSONArray(PluginFactory.getIncomingCapabilities()));
|
np.mBody.put("incomingCapabilities", new JSONArray(PluginFactory.getIncomingCapabilities()));
|
||||||
np.mBody.put("outgoingCapabilities", new JSONArray(PluginFactory.getOutgoingCapabilities()));
|
np.mBody.put("outgoingCapabilities", new JSONArray(PluginFactory.getOutgoingCapabilities()));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
Log.e("NetworkPackage", "Exception on createIdentityPacket", e);
|
||||||
Log.e("NetworkPacakge", "Exception on createIdentityPacket");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return np;
|
return np;
|
||||||
|
@@ -307,8 +307,7 @@ public class MprisPlugin extends Plugin {
|
|||||||
try {
|
try {
|
||||||
playerStatusUpdated.get(key).dispatchMessage(new Message());
|
playerStatusUpdated.get(key).dispatchMessage(new Message());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
Log.e("MprisControl", "Exception", e);
|
||||||
Log.e("MprisControl", "Exception");
|
|
||||||
playerStatusUpdated.remove(key);
|
playerStatusUpdated.remove(key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -355,8 +354,7 @@ public class MprisPlugin extends Plugin {
|
|||||||
try {
|
try {
|
||||||
playerListUpdated.get(key).dispatchMessage(new Message());
|
playerListUpdated.get(key).dispatchMessage(new Message());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
Log.e("MprisControl", "Exception", e);
|
||||||
Log.e("MprisControl", "Exception");
|
|
||||||
playerListUpdated.remove(key);
|
playerListUpdated.remove(key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -468,8 +466,7 @@ public class MprisPlugin extends Plugin {
|
|||||||
try {
|
try {
|
||||||
playerStatusUpdated.get(key).dispatchMessage(new Message());
|
playerStatusUpdated.get(key).dispatchMessage(new Message());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
Log.e("MprisControl", "Exception", e);
|
||||||
Log.e("MprisControl", "Exception");
|
|
||||||
playerStatusUpdated.remove(key);
|
playerStatusUpdated.remove(key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -256,8 +256,7 @@ public class NotificationsPlugin extends Plugin implements NotificationReceiver.
|
|||||||
np.set("payloadHash", getChecksum(bitmapData));
|
np.set("payloadHash", getChecksum(bitmapData));
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
Log.e("NotificationsPlugin", "Error retrieving icon", e);
|
||||||
Log.e("NotificationsPlugin", "Error retrieving icon");
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
currentNotifications.add(key);
|
currentNotifications.add(key);
|
||||||
@@ -379,8 +378,7 @@ public class NotificationsPlugin extends Plugin implements NotificationReceiver.
|
|||||||
Bundle extras = notification.extras;
|
Bundle extras = notification.extras;
|
||||||
title = extractStringFromExtra(extras, TITLE_KEY);
|
title = extractStringFromExtra(extras, TITLE_KEY);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.w("NotificationPlugin", "problem parsing notification extras for " + notification.tickerText);
|
Log.e("NotificationPlugin", "problem parsing notification extras for " + notification.tickerText, e);
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -407,8 +405,7 @@ public class NotificationsPlugin extends Plugin implements NotificationReceiver.
|
|||||||
repliableNotification.tag = statusBarNotification.getTag();//TODO find how to pass Tag with sending PendingIntent, might fix Hangout problem
|
repliableNotification.tag = statusBarNotification.getTag();//TODO find how to pass Tag with sending PendingIntent, might fix Hangout problem
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.w("NotificationPlugin", "problem extracting notification wear for " + statusBarNotification.getNotification().tickerText);
|
Log.e("NotificationPlugin", "problem extracting notification wear for " + statusBarNotification.getNotification().tickerText, e);
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -427,8 +424,7 @@ public class NotificationsPlugin extends Plugin implements NotificationReceiver.
|
|||||||
Object extraTextExtra = extras.get(TEXT_KEY);
|
Object extraTextExtra = extras.get(TEXT_KEY);
|
||||||
if (extraTextExtra != null) text = extraTextExtra.toString();
|
if (extraTextExtra != null) text = extraTextExtra.toString();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.w("NotificationPlugin", "problem parsing notification extras for " + notification.tickerText);
|
Log.e("NotificationPlugin", "problem parsing notification extras for " + notification.tickerText, e);
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -476,8 +472,7 @@ public class NotificationsPlugin extends Plugin implements NotificationReceiver.
|
|||||||
ticker = extraText;
|
ticker = extraText;
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.w("NotificationPlugin", "problem parsing notification extras for " + notification.tickerText);
|
Log.e("NotificationPlugin", "problem parsing notification extras for " + notification.tickerText, e);
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -141,8 +141,7 @@ public class PluginFactory {
|
|||||||
plugin.setContext(context, device);
|
plugin.setContext(context, device);
|
||||||
return plugin;
|
return plugin;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.e("PluginFactory", "Could not instantiate plugin: " + pluginKey);
|
Log.e("PluginFactory", "Could not instantiate plugin: " + pluginKey, e);
|
||||||
e.printStackTrace();
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -25,6 +25,7 @@ import android.content.ClipboardManager;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.util.Log;
|
||||||
import android.view.ContextMenu;
|
import android.view.ContextMenu;
|
||||||
import android.view.MenuInflater;
|
import android.view.MenuInflater;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
@@ -69,7 +70,7 @@ public class RunCommandActivity extends AppCompatActivity {
|
|||||||
commandItems.add(new CommandEntry(obj.getString("name"),
|
commandItems.add(new CommandEntry(obj.getString("name"),
|
||||||
obj.getString("command"), obj.getString("key")));
|
obj.getString("command"), obj.getString("key")));
|
||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
e.printStackTrace();
|
Log.e("RunCommand", "Error parsing JSON", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -24,6 +24,7 @@ package org.kde.kdeconnect.Plugins.RunCommandPlugin;
|
|||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
@@ -115,7 +116,7 @@ public class RunCommandPlugin extends Plugin {
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
e.printStackTrace();
|
Log.e("RunCommand", "Error parsing JSON", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -125,7 +126,7 @@ public class RunCommandPlugin extends Plugin {
|
|||||||
context.sendBroadcast(updateWidget);
|
context.sendBroadcast(updateWidget);
|
||||||
|
|
||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
e.printStackTrace();
|
Log.e("RunCommand", "Error parsing JSON", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (CommandsChangedCallback aCallback : callbacks) {
|
for (CommandsChangedCallback aCallback : callbacks) {
|
||||||
|
@@ -324,8 +324,7 @@ public class SMSPlugin extends Plugin {
|
|||||||
//TODO: Notify other end
|
//TODO: Notify other end
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
//TODO: Notify other end
|
//TODO: Notify other end
|
||||||
Log.e("SMSPlugin", e.getMessage());
|
Log.e("SMSPlugin", "Exception", e);
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@@ -25,6 +25,7 @@ import android.content.ContentResolver;
|
|||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
@@ -80,7 +81,7 @@ public class SftpPlugin extends Plugin implements SharedPreferences.OnSharedPref
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
Log.e("SFTP", "Exception in server.init()", e);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -30,6 +30,7 @@ import android.net.Uri;
|
|||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Environment;
|
import android.os.Environment;
|
||||||
|
import android.util.Log;
|
||||||
import android.util.SparseBooleanArray;
|
import android.util.SparseBooleanArray;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuInflater;
|
import android.view.MenuInflater;
|
||||||
@@ -276,7 +277,7 @@ public class SftpSettingsFragment
|
|||||||
storageInfoList.add(SftpPlugin.StorageInfo.fromJSON(jsonArray.getJSONObject(i)));
|
storageInfoList.add(SftpPlugin.StorageInfo.fromJSON(jsonArray.getJSONObject(i)));
|
||||||
}
|
}
|
||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
e.printStackTrace();
|
Log.e("SFTPSettings", "Couldn't load storage info", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT <= 19) {
|
if (Build.VERSION.SDK_INT <= 19) {
|
||||||
|
@@ -116,7 +116,6 @@ class SimpleSftpServer {
|
|||||||
sshd.start();
|
sshd.start();
|
||||||
started = true;
|
started = true;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
|
||||||
port++;
|
port++;
|
||||||
if (port >= ENDPORT) {
|
if (port >= ENDPORT) {
|
||||||
port = -1;
|
port = -1;
|
||||||
@@ -135,7 +134,7 @@ class SimpleSftpServer {
|
|||||||
started = false;
|
started = false;
|
||||||
sshd.stop(true);
|
sshd.stop(true);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
Log.e("SFTP", "Exception while stopping the server", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -3,6 +3,7 @@ package org.kde.kdeconnect.Plugins.SharePlugin;
|
|||||||
import android.app.NotificationManager;
|
import android.app.NotificationManager;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
import org.kde.kdeconnect.Device;
|
import org.kde.kdeconnect.Device;
|
||||||
import org.kde.kdeconnect.Helpers.NotificationHelper;
|
import org.kde.kdeconnect.Helpers.NotificationHelper;
|
||||||
@@ -75,9 +76,7 @@ class NotificationUpdateCallback extends Device.SendPacketStatusCallback {
|
|||||||
public void onFailure(Throwable e) {
|
public void onFailure(Throwable e) {
|
||||||
updateDone(false);
|
updateDone(false);
|
||||||
NotificationHelper.notifyCompat(notificationManager, notificationId, builder.build());
|
NotificationHelper.notifyCompat(notificationManager, notificationId, builder.build());
|
||||||
if (e != null) {
|
Log.e("KDEConnect", "Exception", e);
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateText() {
|
private void updateText() {
|
||||||
|
@@ -147,8 +147,7 @@ public class SharePlugin extends Plugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.e("SharePlugin", "Exception");
|
Log.e("SharePlugin", "Exception", e);
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -231,7 +230,7 @@ public class SharePlugin extends Plugin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
Log.e("SharePlugin", "Error sending files", e);
|
||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
|
|
||||||
@@ -255,8 +254,7 @@ public class SharePlugin extends Plugin {
|
|||||||
|
|
||||||
queuedSendUriList(uriList);
|
queuedSendUriList(uriList);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.e("ShareActivity", "Exception");
|
Log.e("ShareActivity", "Exception", e);
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (extras.containsKey(Intent.EXTRA_TEXT)) {
|
} else if (extras.containsKey(Intent.EXTRA_TEXT)) {
|
||||||
|
@@ -127,7 +127,7 @@ public class ShareSettingsFragment extends PluginSettingsFragment {
|
|||||||
try {
|
try {
|
||||||
getDefaultDestinationDirectory().mkdirs();
|
getDefaultDestinationDirectory().mkdirs();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
Log.e("KDEConnect", "Exception", e);
|
||||||
}
|
}
|
||||||
return DocumentFile.fromFile(getDefaultDestinationDirectory());
|
return DocumentFile.fromFile(getDefaultDestinationDirectory());
|
||||||
}
|
}
|
||||||
|
@@ -20,6 +20,8 @@
|
|||||||
|
|
||||||
package org.kde.kdeconnect.Plugins.SystemvolumePlugin;
|
package org.kde.kdeconnect.Plugins.SystemvolumePlugin;
|
||||||
|
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
import org.json.JSONArray;
|
import org.json.JSONArray;
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
@@ -75,7 +77,7 @@ public class SystemVolumePlugin extends Plugin {
|
|||||||
sinks.put(sink.getName(), sink);
|
sinks.put(sink.getName(), sink);
|
||||||
}
|
}
|
||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
e.printStackTrace();
|
Log.e("KDEConnect", "Exception", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (SinkListener l : listeners) {
|
for (SinkListener l : listeners) {
|
||||||
|
@@ -352,7 +352,6 @@ public class DeviceFragment extends Fragment {
|
|||||||
mActivity.invalidateOptionsMenu();
|
mActivity.invalidateOptionsMenu();
|
||||||
|
|
||||||
} catch (IllegalStateException e) {
|
} catch (IllegalStateException e) {
|
||||||
e.printStackTrace();
|
|
||||||
//Ignore: The activity was closed while we were trying to update it
|
//Ignore: The activity was closed while we were trying to update it
|
||||||
} catch (ConcurrentModificationException e) {
|
} catch (ConcurrentModificationException e) {
|
||||||
Log.e("DeviceActivity", "ConcurrentModificationException");
|
Log.e("DeviceActivity", "ConcurrentModificationException");
|
||||||
|
@@ -185,7 +185,6 @@ public class PairingFragment extends Fragment implements PairingDeviceItem.Callb
|
|||||||
//Restore scroll
|
//Restore scroll
|
||||||
list.setSelectionFromTop(index, top);
|
list.setSelectionFromTop(index, top);
|
||||||
} catch (IllegalStateException e) {
|
} catch (IllegalStateException e) {
|
||||||
e.printStackTrace();
|
|
||||||
//Ignore: The activity was closed while we were trying to update it
|
//Ignore: The activity was closed while we were trying to update it
|
||||||
} finally {
|
} finally {
|
||||||
listRefreshCalledThisFrame = false;
|
listRefreshCalledThisFrame = false;
|
||||||
|
@@ -75,8 +75,7 @@ public class DeviceTest {
|
|||||||
keyGen.initialize(2048);
|
keyGen.initialize(2048);
|
||||||
keyPair = keyGen.genKeyPair();
|
keyPair = keyGen.genKeyPair();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
Log.e("KDE/initializeRsaKeys", "Exception", e);
|
||||||
Log.e("KDE/initializeRsaKeys", "Exception");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -162,8 +161,8 @@ public class DeviceTest {
|
|||||||
keyGen.initialize(2048);
|
keyGen.initialize(2048);
|
||||||
keyPair = keyGen.genKeyPair();
|
keyPair = keyGen.genKeyPair();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
Log.e("KDE/initializeRsaKeys", "Exception", e);
|
||||||
Log.e("KDE/initializeRsaKeys", "Exception");
|
Log.e("KDE/initializeRsaKeys", "Exception", e);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
device.publicKey = keyPair.getPublic();
|
device.publicKey = keyPair.getPublic();
|
||||||
@@ -203,8 +202,7 @@ public class DeviceTest {
|
|||||||
keyGen.initialize(2048);
|
keyGen.initialize(2048);
|
||||||
keyPair = keyGen.genKeyPair();
|
keyPair = keyGen.genKeyPair();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
Log.e("KDE/initializeRsaKeys", "Exception", e);
|
||||||
Log.e("KDE/initializeRsaKeys", "Exception");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NetworkPacket fakeNetworkPacket = new NetworkPacket(NetworkPacket.PACKET_TYPE_IDENTITY);
|
NetworkPacket fakeNetworkPacket = new NetworkPacket(NetworkPacket.PACKET_TYPE_IDENTITY);
|
||||||
@@ -251,7 +249,7 @@ public class DeviceTest {
|
|||||||
method.setAccessible(true);
|
method.setAccessible(true);
|
||||||
method.invoke(device);
|
method.invoke(device);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
Log.e("KDEConnect", "Exception", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
assertTrue(device.isPaired());
|
assertTrue(device.isPaired());
|
||||||
|
@@ -142,8 +142,7 @@ public class LanLinkTest {
|
|||||||
np.setPayload(new NetworkPacket.Payload(socket.getInputStream(), np.getPayloadSize()));
|
np.setPayload(new NetworkPacket.Payload(socket.getInputStream(), np.getPayloadSize()));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
socket.close();
|
socket.close();
|
||||||
e.printStackTrace();
|
Log.e("KDE/LanLinkTest", "Exception connecting to remote socket", e);
|
||||||
Log.e("KDE/LanLinkTest", "Exception connecting to remote socket");
|
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -169,8 +168,7 @@ public class LanLinkTest {
|
|||||||
input.close();
|
input.close();
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.e("Downloader Test", "Exception");
|
Log.e("Downloader Test", "Exception", e);
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -233,7 +231,7 @@ public class LanLinkTest {
|
|||||||
// Wait 1 secs for downloader to finish (if some error, it will continue and assert will fail)
|
// Wait 1 secs for downloader to finish (if some error, it will continue and assert will fail)
|
||||||
downloader.join(1000);
|
downloader.join(1000);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
Log.e("Test", "Exception", e);
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
assertEquals(new String(data), new String(downloader.getOutputStream().toByteArray()));
|
assertEquals(new String(data), new String(downloader.getOutputStream().toByteArray()));
|
||||||
|
Reference in New Issue
Block a user