Don't use one shot PendingIntents for the notification actions
FLAG_ONE_SHOT doesn't make so much sense here, the intents are generic and can be repeated. Change-Id: Ib457d975387dfd838372639e2aaa40a3df6f4d15
This commit is contained in:
@@ -210,7 +210,6 @@ public class ExportUpdateService extends Service {
|
|||||||
private PendingIntent getStopPendingIntent() {
|
private PendingIntent getStopPendingIntent() {
|
||||||
final Intent intent = new Intent(this, ExportUpdateService.class);
|
final Intent intent = new Intent(this, ExportUpdateService.class);
|
||||||
intent.setAction(ACTION_STOP_EXPORTING);
|
intent.setAction(ACTION_STOP_EXPORTING);
|
||||||
return PendingIntent.getService(this, 0, intent,
|
return PendingIntent.getService(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||||
PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_UPDATE_CURRENT);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -446,8 +446,7 @@ public class UpdaterService extends Service {
|
|||||||
intent.setAction(ACTION_DOWNLOAD_CONTROL);
|
intent.setAction(ACTION_DOWNLOAD_CONTROL);
|
||||||
intent.putExtra(EXTRA_DOWNLOAD_ID, downloadId);
|
intent.putExtra(EXTRA_DOWNLOAD_ID, downloadId);
|
||||||
intent.putExtra(EXTRA_DOWNLOAD_CONTROL, DOWNLOAD_RESUME);
|
intent.putExtra(EXTRA_DOWNLOAD_CONTROL, DOWNLOAD_RESUME);
|
||||||
return PendingIntent.getService(this, 0, intent,
|
return PendingIntent.getService(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||||
PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_UPDATE_CURRENT);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private PendingIntent getPausePendingIntent(String downloadId) {
|
private PendingIntent getPausePendingIntent(String downloadId) {
|
||||||
@@ -455,15 +454,13 @@ public class UpdaterService extends Service {
|
|||||||
intent.setAction(ACTION_DOWNLOAD_CONTROL);
|
intent.setAction(ACTION_DOWNLOAD_CONTROL);
|
||||||
intent.putExtra(EXTRA_DOWNLOAD_ID, downloadId);
|
intent.putExtra(EXTRA_DOWNLOAD_ID, downloadId);
|
||||||
intent.putExtra(EXTRA_DOWNLOAD_CONTROL, DOWNLOAD_PAUSE);
|
intent.putExtra(EXTRA_DOWNLOAD_CONTROL, DOWNLOAD_PAUSE);
|
||||||
return PendingIntent.getService(this, 0, intent,
|
return PendingIntent.getService(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||||
PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_UPDATE_CURRENT);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private PendingIntent getRebootPendingIntent() {
|
private PendingIntent getRebootPendingIntent() {
|
||||||
final Intent intent = new Intent(this, UpdaterReceiver.class);
|
final Intent intent = new Intent(this, UpdaterReceiver.class);
|
||||||
intent.setAction(UpdaterReceiver.ACTION_INSTALL_REBOOT);
|
intent.setAction(UpdaterReceiver.ACTION_INSTALL_REBOOT);
|
||||||
return PendingIntent.getBroadcast(this, 0, intent,
|
return PendingIntent.getBroadcast(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||||
PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_UPDATE_CURRENT);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user