List of usage examples for android.app AlarmManager setTime
public void setTime(long millis)
From source file:com.android.managedprovisioning.DeviceOwnerProvisioningService.java
private void setTimeAndTimezone(String timeZone, long localTime) { try {//from www . java2s. c o m final AlarmManager am = (AlarmManager) getSystemService(Context.ALARM_SERVICE); if (timeZone != null) { if (DEBUG) ProvisionLogger.logd("Setting time zone to " + timeZone); am.setTimeZone(timeZone); } if (localTime > 0) { if (DEBUG) ProvisionLogger.logd("Setting time to " + localTime); am.setTime(localTime); } } catch (Exception e) { ProvisionLogger.loge("Alarm manager failed to set the system time/timezone."); // Do not stop provisioning process, but ignore this error. } }