Write policy file less
Change-Id: I4357ad25c339d2210a977f661bbc9328bdb59096 Bug: 137568668 Bug: 135660478 Test: device boot, change notification settings, very settings on reboot
This commit is contained in:
@@ -473,6 +473,8 @@ public class NotificationManagerService extends SystemService {
|
||||
private MetricsLogger mMetricsLogger;
|
||||
private TriPredicate<String, Integer, String> mAllowedManagedServicePackages;
|
||||
|
||||
private final SavePolicyFileRunnable mSavePolicyFile = new SavePolicyFileRunnable();
|
||||
|
||||
private static class Archive {
|
||||
final int mBufferSize;
|
||||
final ArrayDeque<StatusBarNotification> mBuffer;
|
||||
@@ -666,7 +668,14 @@ public class NotificationManagerService extends SystemService {
|
||||
|
||||
@VisibleForTesting
|
||||
protected void handleSavePolicyFile() {
|
||||
IoThread.getHandler().post(() -> {
|
||||
if (!IoThread.getHandler().hasCallbacks(mSavePolicyFile)) {
|
||||
IoThread.getHandler().post(mSavePolicyFile);
|
||||
}
|
||||
}
|
||||
|
||||
private final class SavePolicyFileRunnable implements Runnable {
|
||||
@Override
|
||||
public void run() {
|
||||
if (DBG) Slog.d(TAG, "handleSavePolicyFile");
|
||||
synchronized (mPolicyFile) {
|
||||
final FileOutputStream stream;
|
||||
@@ -686,7 +695,7 @@ public class NotificationManagerService extends SystemService {
|
||||
}
|
||||
}
|
||||
BackupManager.dataChanged(getContext().getPackageName());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void writePolicyXml(OutputStream stream, boolean forBackup, int userId)
|
||||
|
||||
Reference in New Issue
Block a user