mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 18:58:19 +00:00
Move overlay monitoring logic out of config monitor
Bug: 126417894 Change-Id: I5b474a2a41bbd951fa0a99673fa8bf4342adade5
This commit is contained in:
@@ -41,8 +41,6 @@ public class ConfigMonitor extends BroadcastReceiver implements DisplayListener
|
||||
|
||||
private static final String TAG = "ConfigMonitor";
|
||||
|
||||
private final String ACTION_OVERLAY_CHANGED = "android.intent.action.OVERLAY_CHANGED";
|
||||
|
||||
private final Point mTmpPoint1 = new Point();
|
||||
private final Point mTmpPoint2 = new Point();
|
||||
|
||||
@@ -78,11 +76,6 @@ public class ConfigMonitor extends BroadcastReceiver implements DisplayListener
|
||||
// Listen for configuration change
|
||||
mContext.registerReceiver(this, new IntentFilter(Intent.ACTION_CONFIGURATION_CHANGED));
|
||||
|
||||
// Listen for {@link OverlayManager} change
|
||||
IntentFilter filter = new IntentFilter(ACTION_OVERLAY_CHANGED);
|
||||
filter.addDataScheme("package");
|
||||
mContext.registerReceiver(this, filter);
|
||||
|
||||
// Listen for display manager change
|
||||
mContext.getSystemService(DisplayManager.class)
|
||||
.registerDisplayListener(this, new Handler(UiThreadHelper.getBackgroundLooper()));
|
||||
@@ -91,12 +84,6 @@ public class ConfigMonitor extends BroadcastReceiver implements DisplayListener
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
Configuration config = context.getResources().getConfiguration();
|
||||
// TODO: when overlay manager service encodes more information to the Uri such as category
|
||||
// of the overlay, only listen to the ones that are of interest to launcher.
|
||||
if (intent != null && ACTION_OVERLAY_CHANGED.equals(intent.getAction())) {
|
||||
Log.d(TAG, "Overlay changed.");
|
||||
notifyChange();
|
||||
}
|
||||
if (mFontScale != config.fontScale || mDensity != config.densityDpi) {
|
||||
Log.d(TAG, "Configuration changed.");
|
||||
notifyChange();
|
||||
|
||||
Reference in New Issue
Block a user