Make early stage of Lawnchair 15 launchable in A14 (#4975)

* Make Lawnchair 15 launchable in current state

* Allow LC to change DP without crash
This commit is contained in:
Pun Butrach authored and GitHub committed 2024-11-07 07:59:35 +08:00
1 parent a195be84e3
commit b86b188307
4 files changed
+16 -15

No files matched your search

@@ -141,14 +141,7 @@ public final class FeatureFlagsImpl implements FeatureFlags {
useActivityOverlay =
properties.getBoolean(Flags.FLAG_USE_ACTIVITY_OVERLAY, true);
} catch (NullPointerException e) {
throw new RuntimeException(
"Cannot read value from namespace launcher "
+ "from DeviceConfig. It could be that the code using flag "
+ "executed before SettingsProvider initialization. Please use "
+ "fixed read-only flag by adding is_fixed_read_only: true in "
+ "flag declaration.",
e
);
// Ignored
}
launcher_is_cached = true;
}
@@ -666,7 +666,12 @@ public class QuickstepLauncher extends Launcher implements RecentsViewContainer
// work, we must opt-in BEFORE registering back dispatcher. So we need to call
// setEnableOnBackInvokedCallback() before super.onCreate()
if (Utilities.ATLEAST_U && enablePredictiveBackGesture()) {
getApplicationInfo().setEnableOnBackInvokedCallback(true);
try {
getApplicationInfo().setEnableOnBackInvokedCallback(true);
} catch (NoSuchMethodError e) {
// Ignore
}
}
super.onCreate(savedInstanceState);
if (savedInstanceState != null) {
@@ -1354,8 +1359,6 @@ public class QuickstepLauncher extends Launcher implements RecentsViewContainer
@Override
public void dispatchDeviceProfileChanged() {
super.dispatchDeviceProfileChanged();
Trace.instantForTrack(TRACE_TAG_APP, "QuickstepLauncher#DeviceProfileChanged",
getDeviceProfile().toSmallString());
SystemUiProxy.INSTANCE.get(this).setLauncherAppIconSize(mDeviceProfile.iconSizePx);
TaskbarManager taskbarManager = mTISBindHelper.getTaskbarManager();
if (taskbarManager != null) {
+6 -2
View File
@@ -585,8 +585,12 @@ public class Launcher extends StatefulActivity<LauncherState>
getRootView().dispatchInsets();
final SettingsCache settingsCache = SettingsCache.INSTANCE.get(this);
settingsCache.register(TOUCHPAD_NATURAL_SCROLLING, mNaturalScrollingChangedListener);
mIsNaturalScrollingEnabled = settingsCache.getValue(TOUCHPAD_NATURAL_SCROLLING);
try {
settingsCache.register(TOUCHPAD_NATURAL_SCROLLING, mNaturalScrollingChangedListener);
mIsNaturalScrollingEnabled = settingsCache.getValue(TOUCHPAD_NATURAL_SCROLLING);
} catch (Exception e) {
mIsNaturalScrollingEnabled = false;
}
// Listen for screen turning off
ScreenOnTracker.INSTANCE.get(this).addListener(mScreenOnListener);
@@ -23,6 +23,7 @@ import android.os.PatternMatcher;
import android.text.TextUtils;
import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;
import java.util.function.Consumer;
@@ -43,14 +44,14 @@ public class SimpleBroadcastReceiver extends BroadcastReceiver {
* Helper method to register multiple actions
*/
public void register(Context context, String... actions) {
context.registerReceiver(this, getFilter(actions));
ContextCompat.registerReceiver(context, this, getFilter(actions), ContextCompat.RECEIVER_NOT_EXPORTED);
}
/**
* Helper method to register multiple actions associated with a paction
*/
public void registerPkgActions(Context context, @Nullable String pkg, String... actions) {
context.registerReceiver(this, getPackageFilter(pkg, actions));
ContextCompat.registerReceiver(context, this, getPackageFilter(pkg, actions), ContextCompat.RECEIVER_NOT_EXPORTED);
}
/**