aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2016-10-18 20:59:00 +0200
committerChristian Schneppe <christian@pix-art.de>2016-10-18 20:59:00 +0200
commit9c34a356fa59652aa9d1e79b1016b54d903650af (patch)
tree2e9862c7a5d15debdc5afeacc7b51e07b6a7f9f0 /src/main/java/de
parent94a45d8458ac8e02c994a16023ecf026210a2bad (diff)
code cleanup
Diffstat (limited to 'src/main/java/de')
-rw-r--r--src/main/java/de/pixart/messenger/services/AbstractConnectionManager.java1
-rw-r--r--src/main/java/de/pixart/messenger/services/NotificationService.java1
-rw-r--r--src/main/java/de/pixart/messenger/services/XmppConnectionService.java3
-rw-r--r--src/main/java/de/pixart/messenger/ui/ShareLocationActivity.java1
-rw-r--r--src/main/java/de/pixart/messenger/ui/ShowFullscreenMessageActivity.java1
-rw-r--r--src/main/java/de/pixart/messenger/ui/ShowLocationActivity.java1
-rw-r--r--src/main/java/de/pixart/messenger/ui/WelcomeActivity.java42
-rw-r--r--src/main/java/de/pixart/messenger/ui/XmppActivity.java7
-rw-r--r--src/main/java/de/pixart/messenger/xmpp/XmppConnection.java2
9 files changed, 1 insertions, 58 deletions
diff --git a/src/main/java/de/pixart/messenger/services/AbstractConnectionManager.java b/src/main/java/de/pixart/messenger/services/AbstractConnectionManager.java
index f888d8fd0..6b0bfdc35 100644
--- a/src/main/java/de/pixart/messenger/services/AbstractConnectionManager.java
+++ b/src/main/java/de/pixart/messenger/services/AbstractConnectionManager.java
@@ -3,7 +3,6 @@ package de.pixart.messenger.services;
import android.Manifest;
import android.content.Context;
import android.content.pm.PackageManager;
-import android.net.ConnectivityManager;
import android.os.Build;
import android.os.PowerManager;
import android.util.Log;
diff --git a/src/main/java/de/pixart/messenger/services/NotificationService.java b/src/main/java/de/pixart/messenger/services/NotificationService.java
index 13ac34cc0..a774f7641 100644
--- a/src/main/java/de/pixart/messenger/services/NotificationService.java
+++ b/src/main/java/de/pixart/messenger/services/NotificationService.java
@@ -13,7 +13,6 @@ import android.support.v4.app.NotificationCompat.BigPictureStyle;
import android.support.v4.app.NotificationCompat.Builder;
import android.support.v4.app.NotificationManagerCompat;
import android.support.v4.app.RemoteInput;
-import android.support.v4.app.TaskStackBuilder;
import android.text.Html;
import android.util.DisplayMetrics;
import android.util.Log;
diff --git a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
index 59ef4c299..8f66b1971 100644
--- a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
+++ b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
@@ -101,7 +101,6 @@ import de.pixart.messenger.parser.PresenceParser;
import de.pixart.messenger.persistance.DatabaseBackend;
import de.pixart.messenger.persistance.FileBackend;
import de.pixart.messenger.ui.UiCallback;
-import de.pixart.messenger.ui.XmppActivity;
import de.pixart.messenger.utils.ConversationsFileObserver;
import de.pixart.messenger.utils.CryptoHelper;
import de.pixart.messenger.utils.ExceptionHelper;
@@ -138,8 +137,6 @@ import de.pixart.messenger.xmpp.stanzas.MessagePacket;
import de.pixart.messenger.xmpp.stanzas.PresencePacket;
import me.leolin.shortcutbadger.ShortcutBadger;
-import static de.pixart.messenger.services.NotificationService.NOTIFICATION_ID;
-
public class XmppConnectionService extends Service {
public static final String ACTION_REPLY_TO_CONVERSATION = "reply_to_conversations";
diff --git a/src/main/java/de/pixart/messenger/ui/ShareLocationActivity.java b/src/main/java/de/pixart/messenger/ui/ShareLocationActivity.java
index 03258712e..2bb9dfd9d 100644
--- a/src/main/java/de/pixart/messenger/ui/ShareLocationActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/ShareLocationActivity.java
@@ -13,7 +13,6 @@ import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
import android.provider.Settings;
-import android.support.v4.app.ActivityCompat;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
diff --git a/src/main/java/de/pixart/messenger/ui/ShowFullscreenMessageActivity.java b/src/main/java/de/pixart/messenger/ui/ShowFullscreenMessageActivity.java
index bca5ee183..ffa9018ec 100644
--- a/src/main/java/de/pixart/messenger/ui/ShowFullscreenMessageActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/ShowFullscreenMessageActivity.java
@@ -12,7 +12,6 @@ import android.os.Build;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
-import android.view.Window;
import android.view.WindowManager;
import android.webkit.MimeTypeMap;
import android.widget.ImageButton;
diff --git a/src/main/java/de/pixart/messenger/ui/ShowLocationActivity.java b/src/main/java/de/pixart/messenger/ui/ShowLocationActivity.java
index 3bfecddfa..1eac42936 100644
--- a/src/main/java/de/pixart/messenger/ui/ShowLocationActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/ShowLocationActivity.java
@@ -1,7 +1,6 @@
package de.pixart.messenger.ui;
import android.Manifest;
-import android.app.ActionBar;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
diff --git a/src/main/java/de/pixart/messenger/ui/WelcomeActivity.java b/src/main/java/de/pixart/messenger/ui/WelcomeActivity.java
index 1297f0fd2..b28a7f414 100644
--- a/src/main/java/de/pixart/messenger/ui/WelcomeActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/WelcomeActivity.java
@@ -7,11 +7,9 @@ import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.ActivityInfo;
-import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteException;
-import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.util.Log;
@@ -30,7 +28,6 @@ import java.io.InputStream;
import java.io.OutputStream;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
-import java.util.List;
import javax.crypto.NoSuchPaddingException;
@@ -248,33 +245,7 @@ public class WelcomeActivity extends Activity {
Log.d(Config.LOGTAG, "Delete temp file from " + TempFile.toString());
TempFile.delete();
}
-
- Log.d(Config.LOGTAG, "New Features - Uninstall old version of Pix-Art Messenger");
- if (isPackageInstalled("eu.siacs.conversations")) {
- AlertDialog.Builder builder = new AlertDialog.Builder(this);
- builder.setMessage(R.string.uninstall_app_text)
- .setPositiveButton(R.string.uninstall, new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialogInterface, int i) {
- //start the deinstallation of old version
- if (isPackageInstalled("eu.siacs.conversations")) {
- Uri packageURI_VR = Uri.parse("package:eu.siacs.conversations");
- Intent uninstallIntent_VR = new Intent(Intent.ACTION_UNINSTALL_PACKAGE, packageURI_VR);
- if (uninstallIntent_VR.resolveActivity(getPackageManager()) != null) {
- startActivity(uninstallIntent_VR);
- }
- }
- }
- })
- .setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialogInterface, int i) {
- Log.d(Config.LOGTAG, "New Features - Uninstall cancled");
- restart();
- }
- });
- builder.create().show();
- } else {
- restart();
- }
+ restart();
}
private void restart() {
@@ -287,17 +258,6 @@ public class WelcomeActivity extends Activity {
System.exit(0);
}
- private boolean isPackageInstalled(String targetPackage) {
- List<ApplicationInfo> packages;
- PackageManager pm;
- pm = getPackageManager();
- packages = pm.getInstalledApplications(0);
- for (ApplicationInfo packageInfo : packages) {
- if (packageInfo.packageName.equals(targetPackage)) return true;
- }
- return false;
- }
-
public boolean hasStoragePermission(int requestCode) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
if (checkSelfPermission(Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
diff --git a/src/main/java/de/pixart/messenger/ui/XmppActivity.java b/src/main/java/de/pixart/messenger/ui/XmppActivity.java
index 051b660bd..6503cbb41 100644
--- a/src/main/java/de/pixart/messenger/ui/XmppActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/XmppActivity.java
@@ -7,10 +7,7 @@ import android.app.ActionBar;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
-import android.app.Notification;
-import android.app.NotificationManager;
import android.app.PendingIntent;
-import android.app.ProgressDialog;
import android.content.ActivityNotFoundException;
import android.content.ClipData;
import android.content.ClipboardManager;
@@ -22,7 +19,6 @@ import android.content.Intent;
import android.content.IntentSender.SendIntentException;
import android.content.ServiceConnection;
import android.content.SharedPreferences;
-import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.content.res.Resources;
@@ -44,7 +40,6 @@ import android.os.IBinder;
import android.os.PowerManager;
import android.os.SystemClock;
import android.preference.PreferenceManager;
-import android.support.v4.app.NotificationCompat;
import android.text.InputType;
import android.util.DisplayMetrics;
import android.util.Log;
@@ -99,8 +94,6 @@ import de.pixart.messenger.xmpp.OnUpdateBlocklist;
import de.pixart.messenger.xmpp.jid.InvalidJidException;
import de.pixart.messenger.xmpp.jid.Jid;
-import static de.pixart.messenger.services.NotificationService.NOTIFICATION_ID;
-
public abstract class XmppActivity extends Activity {
protected static final int REQUEST_ANNOUNCE_PGP = 0x0101;
diff --git a/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java b/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java
index 5f42339f7..4b98a9fd3 100644
--- a/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java
+++ b/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java
@@ -13,8 +13,6 @@ import android.util.Log;
import android.util.Pair;
import android.util.SparseArray;
-import org.json.JSONException;
-import org.json.JSONObject;
import org.xmlpull.v1.XmlPullParserException;
import java.io.ByteArrayInputStream;