package com.android.providers.settings;
import android.os.Handler;
-import android.os.HandlerThread;
import android.os.Message;
import android.os.SystemClock;
import android.provider.Settings;
import android.util.Slog;
import android.util.Xml;
import com.android.internal.annotations.GuardedBy;
+import com.android.internal.os.BackgroundThread;
import libcore.io.IoUtils;
import libcore.util.Objects;
import org.xmlpull.v1.XmlPullParser;
final int settingCount = mSettings.size();
for (int i = settingCount - 1; i >= 0; i--) {
String name = mSettings.keyAt(i);
- // Settings defined by us are never dropped.
+ // Settings defined by use are never dropped.
if (Settings.System.PUBLIC_SETTINGS.contains(name)
|| Settings.System.PRIVATE_SETTINGS.contains(name)) {
continue;
public static final int MSG_PERSIST_SETTINGS = 1;
public MyHandler() {
- super(PersistThread.getInstance().getLooper());
+ super(BackgroundThread.getHandler().getLooper());
}
@Override
return true;
}
}
-
- private static final class PersistThread extends HandlerThread {
- private static final Object sLock = new Object();
-
- private static PersistThread sInstance;
-
- private PersistThread() {
- super("settings.persist");
- }
-
- public static PersistThread getInstance() {
- synchronized (sLock) {
- if (sInstance == null) {
- sInstance = new PersistThread();
- sInstance.start();
- }
- return sInstance;
- }
- }
- }
}