Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6f19d501 authored by Abhishek Aggarwal's avatar Abhishek Aggarwal Committed by Mohammed Althaf T
Browse files

change the way how we init

parent 3eca7440
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -125,7 +125,7 @@ public class LauncherAppMonitor extends LauncherApps.Callback

    public LauncherAppMonitor(Context context) {
        context.getSystemService(LauncherApps.class).registerCallback(this);
        LauncherPrefs.getPrefs(context).registerOnSharedPreferenceChangeListener(this);
        LauncherPrefs.get(context).addListener(this);
        mMultiModeController = new MultiModeController(context, this);
    }

+1 −1
Original line number Diff line number Diff line
@@ -75,7 +75,7 @@ class MultiModeController(val context: Context, val monitor: LauncherAppMonitor)
        }

    init {
        prefs = LauncherPrefs.INSTANCE.get(context)
        prefs = LauncherPrefs.get(context)
        monitor.registerCallback(mAppMonitorCallback)
    }

+6 −3
Original line number Diff line number Diff line
@@ -59,12 +59,13 @@ import kotlinx.coroutines.launch
class BlissInput(context: Context, attrs: AttributeSet) :
    LinearLayout(context, attrs), SearchCallback<AdapterItem>, OnUpdateListener, OnBackKeyListener {
    private val mSearchAlgorithm = DefaultAppSearchAlgorithm(context, true)
    private val appMonitor = LauncherAppMonitor.INSTANCE.get(context)
    private val suggestionProvider by lazy { SearchSuggestionUtil.getSuggestionProvider(context) }
    private val suggestionAdapter by lazy { AutoCompleteAdapter(context) }
    private val idp by lazy { InvariantDeviceProfile.INSTANCE.get(context) }
    private val appUsageStats by lazy { AppUsageStats(context) }
    private val mAppsStore by lazy { appMonitor.launcher.appsView.appsStore }
    private val mAppsStore by lazy {
        LauncherAppMonitor.getInstanceNoCreate().launcher.appsView.appsStore
    }

    private var results: SuggestionsResult? = null
    private lateinit var mSearchInput: ExtendedEditText
@@ -196,7 +197,9 @@ class BlissInput(context: Context, attrs: AttributeSet) :
                setTextColor(Color.WHITE)
                setCenterVertically(false)
                setPaddingRelative(padding, 0, padding, 0)
                setOnClickListener(appMonitor.launcher.itemOnClickListener)
                setOnClickListener(
                    LauncherAppMonitor.getInstanceNoCreate().launcher.itemOnClickListener
                )
            }
    }

+1 −1
Original line number Diff line number Diff line
@@ -671,6 +671,7 @@ public class TouchInteractionService extends Service {
        mTaskbarManager = new TaskbarManager(
                this, mAllAppsActionManager, mNavCallbacks, mDesktopVisibilityController);
        mInputConsumer = InputConsumerController.getRecentsAnimationInputConsumer();
        LauncherAppMonitor.getInstance(this);

        // Call runOnUserUnlocked() before any other callbacks to ensure everything is initialized.
        LockedUserState.get(this).runOnUserUnlocked(this::onUserUnlocked);
@@ -720,7 +721,6 @@ public class TouchInteractionService extends Service {
    @UiThread
    public void onUserUnlocked() {
        Log.d(TAG, "onUserUnlocked: userId=" + getUserId());
        LauncherAppMonitor.getInstance(this);
        mTaskAnimationManager = new TaskAnimationManager(this);
        mOverviewComponentObserver = new OverviewComponentObserver(this, mDeviceState);
        mOverviewCommandHelper = new OverviewCommandHelper(this,
+1 −1
Original line number Diff line number Diff line
@@ -85,7 +85,7 @@ public abstract class BaseDraggingActivity extends BaseActivity
    private void updateTheme() {
        if (mThemeRes != Themes.getActivityThemeRes(this)) {
            recreate();
            LauncherAppMonitor.getInstance(this).onThemeChanged();
            LauncherAppMonitor.getInstanceNoCreate().onThemeChanged();
        }
    }

Loading