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

Commit 2a5d79aa authored by Jason Monk's avatar Jason Monk
Browse files

Fix crashes in Settings + SUW

Bug: 25981625
Bug: 25989520
Bug: 25987331
Change-Id: Ib53c99edf45bb4550bfb9761ed09ca3677068591
parent 8f7f3184
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -116,7 +116,7 @@ public class ApplicationsState {

    final HandlerThread mThread;
    final BackgroundHandler mBackgroundHandler;
    final MainHandler mMainHandler = new MainHandler();
    final MainHandler mMainHandler = new MainHandler(Looper.getMainLooper());

    private ApplicationsState(Application app) {
        mContext = app;
@@ -687,6 +687,10 @@ public class ApplicationsState {
        static final int MSG_LAUNCHER_INFO_CHANGED = 7;
        static final int MSG_LOAD_ENTRIES_COMPLETE = 8;

        public MainHandler(Looper looper) {
            super(looper);
        }

        @Override
        public void handleMessage(Message msg) {
            rebuildActiveSessions();
+17 −12
Original line number Diff line number Diff line
@@ -77,10 +77,7 @@ public class SettingsDrawerActivity extends Activity {
            mDrawerLayout = null;
            return;
        }
        if (sDashboardCategories == null) {
            sTileCache = new HashMap<>();
            sDashboardCategories = TileUtils.getCategories(this, sTileCache);
        }
        getDashboardCategories();
        setActionBar(toolbar);
        mDrawerAdapter = new SettingsDrawerAdapter(this);
        ListView listView = (ListView) findViewById(R.id.left_drawer);
@@ -109,6 +106,7 @@ public class SettingsDrawerActivity extends Activity {
    protected void onResume() {
        super.onResume();

        if (mDrawerLayout != null) {
            final IntentFilter filter = new IntentFilter(Intent.ACTION_PACKAGE_ADDED);
            filter.addAction(Intent.ACTION_PACKAGE_REMOVED);
            filter.addAction(Intent.ACTION_PACKAGE_CHANGED);
@@ -118,10 +116,13 @@ public class SettingsDrawerActivity extends Activity {

            new CategoriesUpdater().execute();
        }
    }

    @Override
    protected void onPause() {
        if (mDrawerLayout != null) {
            unregisterReceiver(mPackageReceiver);
        }

        super.onPause();
    }
@@ -178,6 +179,10 @@ public class SettingsDrawerActivity extends Activity {
    }

    public List<DashboardCategory> getDashboardCategories() {
        if (sDashboardCategories == null) {
            sTileCache = new HashMap<>();
            sDashboardCategories = TileUtils.getCategories(this, sTileCache);
        }
        return sDashboardCategories;
    }