|
@@ -419,10 +419,10 @@ public class Hostage extends Service {
|
|
|
TaskStackBuilder stackBuilder = TaskStackBuilder.create(this);
|
|
|
stackBuilder.addParentStack(MainActivity.class);
|
|
|
Intent intent = MainActivity.getInstance().getIntent();
|
|
|
- intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
|
+ intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT | Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
|
|
intent.setAction("SHOW_HOME");
|
|
|
stackBuilder.addNextIntent(intent);
|
|
|
- PendingIntent resultPendingIntent = PendingIntent.getActivity(MainActivity.context, 0, intent, 0);
|
|
|
+ PendingIntent resultPendingIntent = stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT);
|
|
|
builder.setContentIntent(resultPendingIntent);
|
|
|
if (defaultPref.getBoolean("pref_vibration", false)) {
|
|
|
builder.setVibrate(new long[] { 100, 200, 100, 200 });
|
|
@@ -486,7 +486,9 @@ public class Hostage extends Service {
|
|
|
bssidSeen = true;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
builder = new NotificationCompat.Builder(this).setContentTitle(getString(R.string.app_name)).setWhen(System.currentTimeMillis());
|
|
|
+
|
|
|
if (!listening) {
|
|
|
builder.setSmallIcon(R.drawable.ic_launcher);
|
|
|
builder.setContentText(getString(R.string.hostage_not_monitoring));
|
|
@@ -500,16 +502,23 @@ public class Hostage extends Service {
|
|
|
builder.setSmallIcon(R.drawable.ic_service_green);
|
|
|
builder.setContentText(getString(R.string.hostage_no_threat));
|
|
|
}
|
|
|
+
|
|
|
Intent launchIntent = new Intent(getApplicationContext(), MainActivity.class);
|
|
|
TaskStackBuilder stackBuilder = TaskStackBuilder.create(this);
|
|
|
stackBuilder.addParentStack(MainActivity.class);
|
|
|
+
|
|
|
Intent intent = MainActivity.getInstance().getIntent();
|
|
|
- intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
|
+ intent.addCategory(Intent.ACTION_MAIN);
|
|
|
+ intent.addCategory(Intent.CATEGORY_LAUNCHER);
|
|
|
+ intent.addFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT | Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
|
|
+
|
|
|
intent.setAction("SHOW_HOME");
|
|
|
stackBuilder.addNextIntent(intent);
|
|
|
+
|
|
|
PendingIntent resultPendingIntent = PendingIntent.getActivity(MainActivity.context, 0, intent, 0);
|
|
|
builder.setContentIntent(resultPendingIntent);
|
|
|
builder.setOngoing(true);
|
|
|
+
|
|
|
NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
|
|
mNotificationManager.notify(1, builder.build());
|
|
|
}
|