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

Commit e50848bf authored by Romain Guy's avatar Romain Guy
Browse files

Avoid Binder call when getting the Window service

Change-Id: Ie4f01838402bec4b387e40ce02a1af7f12941538
parent be1b127c
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -513,12 +513,16 @@ class ContextImpl extends Context {
                }});

        registerService(WINDOW_SERVICE, new ServiceFetcher() {
                Display mDefaultDisplay;
                public Object getService(ContextImpl ctx) {
                    Display display = ctx.mDisplay;
                    if (display == null) {
                        DisplayManager dm = (DisplayManager)ctx.getOuterContext().getSystemService(
                                Context.DISPLAY_SERVICE);
                        display = dm.getDisplay(Display.DEFAULT_DISPLAY);
                        if (mDefaultDisplay == null) {
                            DisplayManager dm = (DisplayManager)ctx.getOuterContext().
                                    getSystemService(Context.DISPLAY_SERVICE);
                            mDefaultDisplay = dm.getDisplay(Display.DEFAULT_DISPLAY);
                        }
                        display = mDefaultDisplay;
                    }
                    return new WindowManagerImpl(display);
                }});