From 9fcc8ffd7bdc2e604df39ebaf9a5e9fd1385de4e Mon Sep 17 00:00:00 2001 From: Bartosz Fabianowski Date: Tue, 2 Jan 2018 18:10:18 +0100 Subject: [PATCH] Send backup success notification to background apps as well When the backup manager is configured to notify one or more apps of successful backups, the notifications should be sent to apps that are currently stopped as well. Bug: 63885845 Test: cts-tradefed run cts-dev --module CtsBackupHostTestCase Change-Id: I7086aee105229e0f8db4b1ec26639d53a4e0af37 --- .../android/server/backup/RefactoredBackupManagerService.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/services/backup/java/com/android/server/backup/RefactoredBackupManagerService.java b/services/backup/java/com/android/server/backup/RefactoredBackupManagerService.java index 3a37459843beb..51c44e103cc4c 100644 --- a/services/backup/java/com/android/server/backup/RefactoredBackupManagerService.java +++ b/services/backup/java/com/android/server/backup/RefactoredBackupManagerService.java @@ -1424,6 +1424,8 @@ public class RefactoredBackupManagerService implements BackupManagerServiceInter final Intent notification = new Intent(); notification.setAction(BACKUP_FINISHED_ACTION); notification.setPackage(receiver); + notification.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES | + Intent.FLAG_RECEIVER_FOREGROUND); notification.putExtra(BACKUP_FINISHED_PACKAGE_EXTRA, packageName); mContext.sendBroadcastAsUser(notification, UserHandle.OWNER); }