|
2 | 2 |
|
3 | 3 | import android.app.Activity; |
4 | 4 | import android.app.NotificationManager; |
| 5 | +import android.app.PendingIntent; |
5 | 6 | import android.content.Context; |
6 | 7 | import android.content.Intent; |
7 | 8 | import android.content.IntentFilter; |
@@ -68,16 +69,21 @@ private void showToastForStatus(Context context, MsfRpcdService.Status status) { |
68 | 69 | } |
69 | 70 |
|
70 | 71 | private void updateNotificationForStatus(Context context, MsfRpcdService.Status status) { |
71 | | - NotificationCompat.Builder mBuilder = |
| 72 | + NotificationCompat.Builder builder = |
72 | 73 | new NotificationCompat.Builder(context) |
73 | 74 | .setSmallIcon(R.drawable.exploit_msf) |
74 | 75 | .setContentTitle(context.getString(R.string.msf_status)) |
75 | 76 | .setProgress(0, 0, status.inProgress()) |
76 | 77 | .setContentText(context.getString(status.getText())) |
77 | 78 | .setColor(ContextCompat.getColor(context, status.getColor())); |
78 | 79 |
|
| 80 | + PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, |
| 81 | + new Intent(), PendingIntent.FLAG_UPDATE_CURRENT); |
| 82 | + |
| 83 | + builder.setContentIntent(pendingIntent); |
| 84 | + |
79 | 85 | NotificationManager mNotificationManager = |
80 | 86 | (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); |
81 | | - mNotificationManager.notify(MSF_NOTIFICATION, mBuilder.build()); |
| 87 | + mNotificationManager.notify(MSF_NOTIFICATION, builder.build()); |
82 | 88 | } |
83 | 89 | } |
0 commit comments