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

Commit ea8801a3 authored by Soonil Nagarkar's avatar Soonil Nagarkar
Browse files

Move work off UI thread

Move UI thread callbacks to the shared fg thread to lower the risk of
blocking the UI thread.

BUG: 123960196
Test: manual
Change-Id: Id8da54975934b68199433c8ffe5b73b427f00f4f
parent 47119cf9
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -309,9 +309,13 @@ public class LocationManagerService extends ILocationManager.Stub {
                AppOpsManager.WATCH_FOREGROUND_CHANGES,
                new AppOpsManager.OnOpChangedInternalListener() {
                    public void onOpChanged(int op, String packageName) {
                        // onOpChanged invoked on ui thread, move to our thread to reduce risk of
                        // blocking ui thread
                        mHandler.post(() -> {
                            synchronized (mLock) {
                                onAppOpChangedLocked();
                            }
                        });
                    }
                });
        mPackageManager.addOnPermissionsChangeListener(