mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-11 06:44:00 +00:00
Fixed crashes on android 8
This commit is contained in:
6
lawnchair/res/values-v27/colors.xml
Normal file
6
lawnchair/res/values-v27/colors.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="system_accent1_100">@android:color/transparent</color>
|
||||
<color name="accent_primary_device_default">@android:color/transparent</color>
|
||||
<color name="overview_foreground_scrim_color">@android:color/black</color>
|
||||
</resources>
|
||||
@@ -117,7 +117,7 @@ public class QuickstepModelDelegate extends ModelDelegate {
|
||||
|
||||
private final InvariantDeviceProfile mIDP;
|
||||
private final AppEventProducer mAppEventProducer;
|
||||
private final StatsManager mStatsManager;
|
||||
private StatsManager mStatsManager;
|
||||
|
||||
protected boolean mActive = false;
|
||||
|
||||
@@ -127,7 +127,11 @@ public class QuickstepModelDelegate extends ModelDelegate {
|
||||
|
||||
mIDP = InvariantDeviceProfile.INSTANCE.get(context);
|
||||
StatsLogCompatManager.LOGS_CONSUMER.add(mAppEventProducer);
|
||||
mStatsManager = context.getSystemService(StatsManager.class);
|
||||
try {
|
||||
mStatsManager = context.getSystemService(StatsManager.class);
|
||||
} catch (Throwable e) {
|
||||
Log.e(TAG, "Failed to get StatsManager", e);
|
||||
}
|
||||
}
|
||||
|
||||
@CallSuper
|
||||
@@ -300,7 +304,7 @@ public class QuickstepModelDelegate extends ModelDelegate {
|
||||
return StatsManager.PULL_SUCCESS;
|
||||
});
|
||||
Log.d(TAG, "Successfully registered for launcher snapshot logging!");
|
||||
} catch (RuntimeException e) {
|
||||
} catch (Throwable e) {
|
||||
Log.e(TAG, "Failed to register launcher snapshot logging callback with StatsManager",
|
||||
e);
|
||||
}
|
||||
@@ -342,7 +346,7 @@ public class QuickstepModelDelegate extends ModelDelegate {
|
||||
if (mIsPrimaryInstance && mStatsManager != null && LawnchairQuickstepCompat.ATLEAST_R) {
|
||||
try {
|
||||
mStatsManager.clearPullAtomCallback(SysUiStatsLog.LAUNCHER_LAYOUT_SNAPSHOT);
|
||||
} catch (RuntimeException e) {
|
||||
} catch (Throwable e) {
|
||||
Log.e(TAG, "Failed to unregister snapshot logging callback with StatsManager", e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="overview_foreground_scrim_color">@android:color/black</color>/color>
|
||||
<color name="overview_foreground_scrim_color">@android:color/black</color>
|
||||
</resources>
|
||||
|
||||
@@ -15,6 +15,7 @@ import android.os.UserHandle;
|
||||
import com.android.launcher3.DeviceProfile;
|
||||
import com.android.launcher3.InvariantDeviceProfile;
|
||||
import com.android.launcher3.LauncherAppState;
|
||||
import com.android.launcher3.Utilities;
|
||||
import com.android.launcher3.icons.ComponentWithLabelAndIcon;
|
||||
import com.android.launcher3.icons.IconCache;
|
||||
import com.android.launcher3.model.data.LauncherAppWidgetInfo;
|
||||
@@ -205,6 +206,7 @@ public class LauncherAppWidgetProviderInfo extends AppWidgetProviderInfo
|
||||
}
|
||||
|
||||
public int getWidgetFeatures() {
|
||||
if (!Utilities.ATLEAST_P) return 0;
|
||||
return widgetFeatures;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user