diff --git a/flags/src/com/android/launcher3/FeatureFlagsImpl.java b/flags/src/com/android/launcher3/FeatureFlagsImpl.java index 46217f1c21..8c8a88e557 100644 --- a/flags/src/com/android/launcher3/FeatureFlagsImpl.java +++ b/flags/src/com/android/launcher3/FeatureFlagsImpl.java @@ -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; } diff --git a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java index 9bcf50eafb..fcd79b6ec8 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java +++ b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java @@ -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) { diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index ad456a3f63..8501a40b06 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -585,8 +585,12 @@ public class Launcher extends StatefulActivity 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); diff --git a/src/com/android/launcher3/util/SimpleBroadcastReceiver.java b/src/com/android/launcher3/util/SimpleBroadcastReceiver.java index 064bcd072f..5ccd4d00ea 100644 --- a/src/com/android/launcher3/util/SimpleBroadcastReceiver.java +++ b/src/com/android/launcher3/util/SimpleBroadcastReceiver.java @@ -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); } /**