Example usage for android.os SystemClock setCurrentTimeMillis

List of usage examples for android.os SystemClock setCurrentTimeMillis

Introduction

In this page you can find the example usage for android.os SystemClock setCurrentTimeMillis.

Prototype

public static boolean setCurrentTimeMillis(long millis) 

Source Link

Document

Sets the current wall time, in milliseconds.

Usage

From source file:se.leap.bitmaskclient.test.testVpnCertificateValidator.java

private void setTime(int year, int month, int day) {
    shellCommand("adb shell chmod 666 /dev/alarm");
    Calendar c = Calendar.getInstance();
    c.set(year, month, day, 12, 00, 00);
    SystemClock.setCurrentTimeMillis(c.getTimeInMillis());
    shellCommand("adb shell chmod 664 /dev/alarm");
}