CurrentUserTracker#UserReceiver listen USER_ALL
The CurrentUserTracker is supposed to notify other processes when the
user changes. However, not all the systemui processes were getting this
broadcast (this problem existed before BroadcastDispatcher).
In particular, TunerServiceImpl was not being notified every time the
user changed which caused the settings not being reloaded. In
particular, sysui_qs_tiles was modified by QSTileHost but the changes
were never picked up as TunerServiceImpl was tracking the wrong user.
This CL guarantees that UserReceiver will be notified about changes in
all processes.
Test: manual switch users and change tiles
Fixes: 141904434
Change-Id: I0557a0321cc31240dbff390525ca909a13aef257
diff --git a/packages/SystemUI/src/com/android/systemui/settings/CurrentUserTracker.java b/packages/SystemUI/src/com/android/systemui/settings/CurrentUserTracker.java
index 9f79785..077d260 100644
--- a/packages/SystemUI/src/com/android/systemui/settings/CurrentUserTracker.java
+++ b/packages/SystemUI/src/com/android/systemui/settings/CurrentUserTracker.java
@@ -21,6 +21,7 @@
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
+import android.os.UserHandle;
import com.android.internal.annotations.VisibleForTesting;
import com.android.systemui.broadcast.BroadcastDispatcher;
@@ -97,7 +98,7 @@
if (!mReceiverRegistered) {
mCurrentUserId = ActivityManager.getCurrentUser();
IntentFilter filter = new IntentFilter(Intent.ACTION_USER_SWITCHED);
- mBroadcastDispatcher.registerReceiver(this, filter);
+ mBroadcastDispatcher.registerReceiver(this, filter, null, UserHandle.ALL);
mReceiverRegistered = true;
}
}