aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/services/UpdateService.java
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-02-17 21:10:33 +0100
committerChristian Schneppe <christian@pix-art.de>2018-02-17 21:10:33 +0100
commite35610c88df1869059eb2a9ef0fb6093274e1421 (patch)
tree219dabe0ba9dfa88f909fd5857f8c8bdfd62ac88 /src/main/java/de/pixart/messenger/services/UpdateService.java
parent3bb696a5d6c057b6d5df178fa97722680c10580b (diff)
show hint to allow installs from unknown sources just before update starts and don't show this for PlayStore installs
Diffstat (limited to 'src/main/java/de/pixart/messenger/services/UpdateService.java')
-rw-r--r--src/main/java/de/pixart/messenger/services/UpdateService.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/main/java/de/pixart/messenger/services/UpdateService.java b/src/main/java/de/pixart/messenger/services/UpdateService.java
index d4cf2afef..bc5ce90e1 100644
--- a/src/main/java/de/pixart/messenger/services/UpdateService.java
+++ b/src/main/java/de/pixart/messenger/services/UpdateService.java
@@ -33,9 +33,11 @@ public class UpdateService extends AsyncTask<String, Object, UpdateService.Wrapp
}
private Context context;
+ private boolean playstore;
- public UpdateService(Context context) {
+ public UpdateService(Context context, boolean PlayStore) {
this.context = context;
+ this.playstore = PlayStore;
}
public class Wrapper
@@ -93,10 +95,11 @@ public class UpdateService extends AsyncTask<String, Object, UpdateService.Wrapp
if (checkVersion(version, ownVersion) >= 1) {
Log.d(Config.LOGTAG, "AppUpdater: Version " + ownVersion + " should be updated to " + version);
UpdateAvailable = true;
- showNotification(url, changelog, version, filesize);
+ showNotification(url, changelog, version, filesize, playstore);
} else {
Log.d(Config.LOGTAG, "AppUpdater: Version " + ownVersion + " is up to date");
UpdateAvailable = false;
+ showNotification(url, changelog, version, filesize, playstore);
}
}
} catch (JSONException e) {
@@ -141,11 +144,12 @@ public class UpdateService extends AsyncTask<String, Object, UpdateService.Wrapp
});
}
- private void showNotification(String url, String changelog, String version, String filesize) {
+ private void showNotification(String url, String changelog, String version, String filesize, boolean playstore) {
Intent intent = new Intent(context, UpdaterActivity.class);
intent.putExtra("update", "PixArtMessenger_UpdateService");
intent.putExtra("url", url);
intent.putExtra("changelog", changelog);
+ intent.putExtra("playstore", playstore);
PendingIntent pi = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
final NotificationManagerCompat notificationManager = NotificationManagerCompat.from(context);
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context);