mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 03:08:19 +00:00
Removing all compatibility code below Lollipop
Bug: 32745285 Change-Id: I62971908e3e4402941fab627bbdfd47be64473a3
This commit is contained in:
@@ -23,8 +23,6 @@ import android.content.IntentFilter;
|
||||
import android.content.res.Configuration;
|
||||
import android.util.Log;
|
||||
|
||||
import com.android.launcher3.Utilities;
|
||||
|
||||
/**
|
||||
* {@link BroadcastReceiver} which watches configuration changes and
|
||||
* restarts the process in case changes which affect the device profile occur.
|
||||
@@ -40,13 +38,13 @@ public class ConfigMonitor extends BroadcastReceiver {
|
||||
|
||||
Configuration config = context.getResources().getConfiguration();
|
||||
mFontScale = config.fontScale;
|
||||
mDensity = getDensity(config);
|
||||
mDensity = config.densityDpi;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
Configuration config = context.getResources().getConfiguration();
|
||||
if (mFontScale != config.fontScale || mDensity != getDensity(config)) {
|
||||
if (mFontScale != config.fontScale || mDensity != config.densityDpi) {
|
||||
Log.d("ConfigMonitor", "Configuration changed, restarting launcher");
|
||||
mContext.unregisterReceiver(this);
|
||||
android.os.Process.killProcess(android.os.Process.myPid());
|
||||
@@ -56,8 +54,4 @@ public class ConfigMonitor extends BroadcastReceiver {
|
||||
public void register() {
|
||||
mContext.registerReceiver(this, new IntentFilter(Intent.ACTION_CONFIGURATION_CHANGED));
|
||||
}
|
||||
|
||||
private static int getDensity(Configuration config) {
|
||||
return Utilities.ATLEAST_JB_MR1 ? config.densityDpi : 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user