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

Commit 4bcc06f3 authored by Justin Klaassen's avatar Justin Klaassen
Browse files

Reset last activated time after auto mode changed

Fixes: 62749129
Test: runtest -c com.android.server.NightDisplayServiceTest \
      frameworks-services
Change-Id: I7e5a4c56cd20be70e693aa2327972b5da77b6f27
parent ca7da2b2
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -182,6 +182,10 @@ public final class NightDisplayController {
            throw new IllegalArgumentException("Invalid autoMode: " + autoMode);
        }

        if (getAutoMode() != autoMode) {
            Secure.putLongForUser(mContext.getContentResolver(),
                    Secure.NIGHT_DISPLAY_LAST_ACTIVATED_TIME, -1L, mUserId);
        }
        return Secure.putIntForUser(mContext.getContentResolver(),
                Secure.NIGHT_DISPLAY_AUTO_MODE, autoMode, mUserId);
    }