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

Commit deb43282 authored by Cody Northrop's avatar Cody Northrop
Browse files

Add ANGLE_ENABLED_APP to CoreSettings

The way we were checking Settings was invoking a 2ms hit.

Move ANGLE_ENABLED_APP to CoreSettings, which are already
available to the ActivityThread, eliminating the hit.

Test: Verify developer option works as expected
Test: atest google/perf/app-startup/benchmark-app-hermetic/cold-dropcache-test
Bug: 117107368
Bug: 80239516
Change-Id: I3df4c3c43489a338b3631484a8811b38c4eff2e6
parent 7891b6a9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -5666,7 +5666,7 @@ public final class ActivityThread extends ClientTransactionHandler {
            }
        }

        GraphicsEnvironment.getInstance().setup(context);
        GraphicsEnvironment.getInstance().setup(context, mCoreSettings);
        Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);
    }

+4 −5
Original line number Diff line number Diff line
@@ -54,9 +54,9 @@ public class GraphicsEnvironment {
    /**
     * Set up GraphicsEnvironment
     */
    public void setup(Context context) {
    public void setup(Context context, Bundle coreSettings) {
        setupGpuLayers(context);
        setupAngle(context);
        setupAngle(context, coreSettings);
        chooseDriver(context);
    }

@@ -135,11 +135,10 @@ public class GraphicsEnvironment {
    /**
     * Pass ANGLE details down to trigger enable logic
     */
    private static void setupAngle(Context context) {
    private static void setupAngle(Context context, Bundle coreSettings) {

        String angleEnabledApp =
                Settings.Global.getString(context.getContentResolver(),
                                          Settings.Global.ANGLE_ENABLED_APP);
                coreSettings.getString(Settings.Global.ANGLE_ENABLED_APP);

        String packageName = context.getPackageName();

+1 −0
Original line number Diff line number Diff line
@@ -55,6 +55,7 @@ final class CoreSettingsObserver extends ContentObserver {
        // add other system settings here...

        sGlobalSettingToTypeMap.put(Settings.Global.DEBUG_VIEW_ATTRIBUTES, int.class);
        sGlobalSettingToTypeMap.put(Settings.Global.ANGLE_ENABLED_APP, String.class);
        // add other global settings here...
    }