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

Commit 0cbc794a authored by Menghan Li's avatar Menghan Li Committed by Android (Google) Code Review
Browse files

Merge "feat(EDT): Sync force invert callback register by IfThisThenThat Lint" into main

parents 0bf821f5 bd29cc15
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1836,6 +1836,7 @@ public final class ViewRootImpl implements ViewParent,
                        eventsToBeRegistered,
                        mBasePackageName);
        // LINT.IfChange(fi_cb)
        if (forceInvertColor()) {
            if (mForceInvertObserver == null) {
                mForceInvertObserver = new ContentObserver(mHandler) {
@@ -1844,7 +1845,6 @@ public final class ViewRootImpl implements ViewParent,
                        updateForceDarkMode();
                    }
                };
                final Uri[] urisToObserve = {
                    Settings.Secure.getUriFor(
                        Settings.Secure.ACCESSIBILITY_FORCE_INVERT_COLOR_ENABLED),
@@ -1859,6 +1859,7 @@ public final class ViewRootImpl implements ViewParent,
                }
            }
        }
        // LINT.ThenChange(/services/core/java/com/android/server/UiModeManagerService.java:fi_cb)
    }
    /**
+2 −0
Original line number Diff line number Diff line
@@ -514,6 +514,7 @@ final class UiModeManagerService extends SystemService {
                mCarModeEnabled = mDockState == Intent.EXTRA_DOCK_STATE_CAR;
                registerVrStateListener();
                // register listeners
                // LINT.IfChange(fi_cb)
                context.getContentResolver()
                        .registerContentObserver(Secure.getUriFor(Secure.UI_NIGHT_MODE),
                                false, mDarkThemeObserver, 0);
@@ -523,6 +524,7 @@ final class UiModeManagerService extends SystemService {
                                    Secure.getUriFor(ACCESSIBILITY_FORCE_INVERT_COLOR_ENABLED),
                                    false, mForceInvertStateObserver, UserHandle.USER_ALL);
                }
                // LINT.ThenChange(/core/java/android/view/ViewRootImpl.java:fi_cb)
                context.getContentResolver().registerContentObserver(
                        Secure.getUriFor(Secure.CONTRAST_LEVEL), false,
                        mContrastObserver, UserHandle.USER_ALL);