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

Commit 81dbf32b authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add "overload" of currentTimeMillis() returning Instant" into main

parents 9939b3c5 54459e48
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -702,6 +702,9 @@ java_library {
        "tests/utils/src/com/android/systemui/util/concurrency/FakeExecutor.java",
        "tests/utils/src/com/android/systemui/util/time/FakeSystemClock.java",
    ],
    libs: [
        "androidx.annotation_annotation",
    ],
    jarjar_rules: ":jarjar-rules-shared",
}

+3 −0
Original line number Diff line number Diff line
@@ -24,6 +24,9 @@ java_library {
        "*.java",
        "*.kt",
    ],
    libs: [
        "androidx.annotation_annotation",
    ],
    defaults: [
        "SystemUI_pod_defaults_api",
    ],
+10 −0
Original line number Diff line number Diff line
@@ -16,6 +16,10 @@

package com.android.systemui.util.time;

import androidx.annotation.NonNull;

import java.time.Instant;

/**
 * Testable wrapper around {@link android.os.SystemClock}.
 *
@@ -40,4 +44,10 @@ public interface SystemClock {

    /** @see System#currentTimeMillis()  */
    long currentTimeMillis();

    /** @see System#currentTimeMillis()  */
    @NonNull
    default Instant currentTime() {
        return Instant.ofEpochMilli(currentTimeMillis());
    }
}