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

Commit aa55c3d9 authored by Android Build Merger (Role)'s avatar Android Build Merger (Role) Committed by Android (Google) Code Review
Browse files

Merge "Merge "Add function to query last estimate time to Estimate" into...

Merge "Merge "Add function to query last estimate time to Estimate" into qt-dev am: ade071d6 am: e6594049" into qt-r1-dev-plus-aosp
parents 0484d894 850250ce
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -77,5 +77,17 @@ class Estimate(
            Settings.Global.putLong(resolver, Settings.Global.BATTERY_ESTIMATES_LAST_UPDATE_TIME,
                    System.currentTimeMillis())
        }

        /**
         * Returns when the estimate was last updated as an Instant
         */
        @JvmStatic
        fun getLastCacheUpdateTime(context: Context): Instant {
            return Instant.ofEpochMilli(
                    Settings.Global.getLong(
                            context.contentResolver,
                            Settings.Global.BATTERY_ESTIMATES_LAST_UPDATE_TIME,
                            -1))
        }
    }
}