Merge "Fix flaky sysui crash in devicehealthchecks test." into qt-qpr1-dev am: 72be6295c0
Change-Id: I96d2dd32ecdd2af08a454be40efc30eac375b815
This commit is contained in:
@@ -15,7 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.android.systemui.tuner;
|
package com.android.systemui.tuner;
|
||||||
|
|
||||||
import static com.android.systemui.Dependency.BG_HANDLER_NAME;
|
import static com.android.systemui.Dependency.MAIN_HANDLER_NAME;
|
||||||
|
|
||||||
import android.app.ActivityManager;
|
import android.app.ActivityManager;
|
||||||
import android.content.ContentResolver;
|
import android.content.ContentResolver;
|
||||||
@@ -82,7 +82,7 @@ public class TunerServiceImpl extends TunerService {
|
|||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
@Inject
|
@Inject
|
||||||
public TunerServiceImpl(Context context, @Named(BG_HANDLER_NAME) Handler bgHandler,
|
public TunerServiceImpl(Context context, @Named(MAIN_HANDLER_NAME) Handler mainHandler,
|
||||||
LeakDetector leakDetector) {
|
LeakDetector leakDetector) {
|
||||||
mContext = context;
|
mContext = context;
|
||||||
mContentResolver = mContext.getContentResolver();
|
mContentResolver = mContext.getContentResolver();
|
||||||
@@ -91,7 +91,7 @@ public class TunerServiceImpl extends TunerService {
|
|||||||
for (UserInfo user : UserManager.get(mContext).getUsers()) {
|
for (UserInfo user : UserManager.get(mContext).getUsers()) {
|
||||||
mCurrentUser = user.getUserHandle().getIdentifier();
|
mCurrentUser = user.getUserHandle().getIdentifier();
|
||||||
if (getValue(TUNER_VERSION, 0) != CURRENT_TUNER_VERSION) {
|
if (getValue(TUNER_VERSION, 0) != CURRENT_TUNER_VERSION) {
|
||||||
upgradeTuner(getValue(TUNER_VERSION, 0), CURRENT_TUNER_VERSION, bgHandler);
|
upgradeTuner(getValue(TUNER_VERSION, 0), CURRENT_TUNER_VERSION, mainHandler);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -112,7 +112,7 @@ public class TunerServiceImpl extends TunerService {
|
|||||||
mUserTracker.stopTracking();
|
mUserTracker.stopTracking();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void upgradeTuner(int oldVersion, int newVersion, Handler bgHandler) {
|
private void upgradeTuner(int oldVersion, int newVersion, Handler mainHandler) {
|
||||||
if (oldVersion < 1) {
|
if (oldVersion < 1) {
|
||||||
String blacklistStr = getValue(StatusBarIconController.ICON_BLACKLIST);
|
String blacklistStr = getValue(StatusBarIconController.ICON_BLACKLIST);
|
||||||
if (blacklistStr != null) {
|
if (blacklistStr != null) {
|
||||||
@@ -134,7 +134,7 @@ public class TunerServiceImpl extends TunerService {
|
|||||||
if (oldVersion < 4) {
|
if (oldVersion < 4) {
|
||||||
// Delay this so that we can wait for everything to be registered first.
|
// Delay this so that we can wait for everything to be registered first.
|
||||||
final int user = mCurrentUser;
|
final int user = mCurrentUser;
|
||||||
bgHandler.postDelayed(
|
mainHandler.postDelayed(
|
||||||
() -> clearAllFromUser(user), 5000);
|
() -> clearAllFromUser(user), 5000);
|
||||||
}
|
}
|
||||||
setValue(TUNER_VERSION, newVersion);
|
setValue(TUNER_VERSION, newVersion);
|
||||||
|
|||||||
Reference in New Issue
Block a user