Loading services/core/java/com/android/server/am/ActivityManagerService.java +7 −0 Original line number Original line Diff line number Diff line Loading @@ -16863,6 +16863,13 @@ public final class ActivityManagerService extends ActivityManagerNative return false; return false; } } // If the app is a regular app (uid >= 10000) and not the system server or phone // process, etc, then mark it as being in full backup so that certain calls to the // process can be blocked. This is not reset to false anywhere because we kill the // process after the full backup is done and the ProcessRecord will vaporize anyway. if (UserHandle.isApp(app.uid) && backupMode == IApplicationThread.BACKUP_MODE_FULL) { proc.inFullBackup = true; } r.app = proc; r.app = proc; mBackupTarget = r; mBackupTarget = r; mBackupAppName = app.packageName; mBackupAppName = app.packageName; services/core/java/com/android/server/am/BroadcastQueue.java +24 −7 Original line number Original line Diff line number Diff line Loading @@ -258,6 +258,11 @@ public final class BroadcastQueue { if (app.thread == null) { if (app.thread == null) { throw new RemoteException(); throw new RemoteException(); } } if (app.inFullBackup) { skipReceiverLocked(r); return; } r.receiver = app.thread.asBinder(); r.receiver = app.thread.asBinder(); r.curApp = app; r.curApp = app; app.curReceiver = r; app.curReceiver = r; Loading Loading @@ -341,12 +346,16 @@ public final class BroadcastQueue { } } if (r != null) { if (r != null) { skipReceiverLocked(r); } } private void skipReceiverLocked(BroadcastRecord r) { logBroadcastReceiverDiscardLocked(r); logBroadcastReceiverDiscardLocked(r); finishReceiverLocked(r, r.resultCode, r.resultData, finishReceiverLocked(r, r.resultCode, r.resultData, r.resultExtras, r.resultAbort, false); r.resultExtras, r.resultAbort, false); scheduleBroadcastsLocked(); scheduleBroadcastsLocked(); } } } public void scheduleBroadcastsLocked() { public void scheduleBroadcastsLocked() { if (DEBUG_BROADCAST) Slog.v(TAG_BROADCAST, "Schedule broadcasts [" if (DEBUG_BROADCAST) Slog.v(TAG_BROADCAST, "Schedule broadcasts [" Loading Loading @@ -641,9 +650,17 @@ public final class BroadcastQueue { try { try { if (DEBUG_BROADCAST_LIGHT) Slog.i(TAG_BROADCAST, if (DEBUG_BROADCAST_LIGHT) Slog.i(TAG_BROADCAST, "Delivering to " + filter + " : " + r); "Delivering to " + filter + " : " + r); if (filter.receiverList.app != null && filter.receiverList.app.inFullBackup) { // Skip delivery if full backup in progress // If it's an ordered broadcast, we need to continue to the next receiver. if (ordered) { skipReceiverLocked(r); } } else { performReceiveLocked(filter.receiverList.app, filter.receiverList.receiver, performReceiveLocked(filter.receiverList.app, filter.receiverList.receiver, new Intent(r.intent), r.resultCode, r.resultData, new Intent(r.intent), r.resultCode, r.resultData, r.resultExtras, r.ordered, r.initialSticky, r.userId); r.resultExtras, r.ordered, r.initialSticky, r.userId); } if (ordered) { if (ordered) { r.state = BroadcastRecord.CALL_DONE_RECEIVE; r.state = BroadcastRecord.CALL_DONE_RECEIVE; } } Loading services/core/java/com/android/server/am/ProcessRecord.java +3 −0 Original line number Original line Diff line number Diff line Loading @@ -192,6 +192,9 @@ final class ProcessRecord { // app that installed the package. // app that installed the package. ComponentName errorReportReceiver; ComponentName errorReportReceiver; // Process is currently hosting a backup agent for backup or restore public boolean inFullBackup; void dump(PrintWriter pw, String prefix) { void dump(PrintWriter pw, String prefix) { final long now = SystemClock.uptimeMillis(); final long now = SystemClock.uptimeMillis(); Loading Loading
services/core/java/com/android/server/am/ActivityManagerService.java +7 −0 Original line number Original line Diff line number Diff line Loading @@ -16863,6 +16863,13 @@ public final class ActivityManagerService extends ActivityManagerNative return false; return false; } } // If the app is a regular app (uid >= 10000) and not the system server or phone // process, etc, then mark it as being in full backup so that certain calls to the // process can be blocked. This is not reset to false anywhere because we kill the // process after the full backup is done and the ProcessRecord will vaporize anyway. if (UserHandle.isApp(app.uid) && backupMode == IApplicationThread.BACKUP_MODE_FULL) { proc.inFullBackup = true; } r.app = proc; r.app = proc; mBackupTarget = r; mBackupTarget = r; mBackupAppName = app.packageName; mBackupAppName = app.packageName;
services/core/java/com/android/server/am/BroadcastQueue.java +24 −7 Original line number Original line Diff line number Diff line Loading @@ -258,6 +258,11 @@ public final class BroadcastQueue { if (app.thread == null) { if (app.thread == null) { throw new RemoteException(); throw new RemoteException(); } } if (app.inFullBackup) { skipReceiverLocked(r); return; } r.receiver = app.thread.asBinder(); r.receiver = app.thread.asBinder(); r.curApp = app; r.curApp = app; app.curReceiver = r; app.curReceiver = r; Loading Loading @@ -341,12 +346,16 @@ public final class BroadcastQueue { } } if (r != null) { if (r != null) { skipReceiverLocked(r); } } private void skipReceiverLocked(BroadcastRecord r) { logBroadcastReceiverDiscardLocked(r); logBroadcastReceiverDiscardLocked(r); finishReceiverLocked(r, r.resultCode, r.resultData, finishReceiverLocked(r, r.resultCode, r.resultData, r.resultExtras, r.resultAbort, false); r.resultExtras, r.resultAbort, false); scheduleBroadcastsLocked(); scheduleBroadcastsLocked(); } } } public void scheduleBroadcastsLocked() { public void scheduleBroadcastsLocked() { if (DEBUG_BROADCAST) Slog.v(TAG_BROADCAST, "Schedule broadcasts [" if (DEBUG_BROADCAST) Slog.v(TAG_BROADCAST, "Schedule broadcasts [" Loading Loading @@ -641,9 +650,17 @@ public final class BroadcastQueue { try { try { if (DEBUG_BROADCAST_LIGHT) Slog.i(TAG_BROADCAST, if (DEBUG_BROADCAST_LIGHT) Slog.i(TAG_BROADCAST, "Delivering to " + filter + " : " + r); "Delivering to " + filter + " : " + r); if (filter.receiverList.app != null && filter.receiverList.app.inFullBackup) { // Skip delivery if full backup in progress // If it's an ordered broadcast, we need to continue to the next receiver. if (ordered) { skipReceiverLocked(r); } } else { performReceiveLocked(filter.receiverList.app, filter.receiverList.receiver, performReceiveLocked(filter.receiverList.app, filter.receiverList.receiver, new Intent(r.intent), r.resultCode, r.resultData, new Intent(r.intent), r.resultCode, r.resultData, r.resultExtras, r.ordered, r.initialSticky, r.userId); r.resultExtras, r.ordered, r.initialSticky, r.userId); } if (ordered) { if (ordered) { r.state = BroadcastRecord.CALL_DONE_RECEIVE; r.state = BroadcastRecord.CALL_DONE_RECEIVE; } } Loading
services/core/java/com/android/server/am/ProcessRecord.java +3 −0 Original line number Original line Diff line number Diff line Loading @@ -192,6 +192,9 @@ final class ProcessRecord { // app that installed the package. // app that installed the package. ComponentName errorReportReceiver; ComponentName errorReportReceiver; // Process is currently hosting a backup agent for backup or restore public boolean inFullBackup; void dump(PrintWriter pw, String prefix) { void dump(PrintWriter pw, String prefix) { final long now = SystemClock.uptimeMillis(); final long now = SystemClock.uptimeMillis(); Loading