Marek Degma
Nov 07, 2018
5:57 pm

DateTimePolicy.setNtpInfo has no effect whatsoever

I am building an internal Android application that is intended to run on a secured internal network with no access to the internet. Therefore, the app has to override NTP settings to point to internal NTP server. The application successfully performs the update as described here (

EnterpriseDeviceManager edm = (EnterpriseDeviceManager) getSystemService
 DateTimePolicy dateTimePolicy = edm.getDateTimePolicy();
 try {
     boolean ntpInfoSet = true;
     NtpInfo ntpInfo = new NtpInfo(this.getApplicationContext());
     ntpInfo.setTimeout(10000); // 10 seconds
     ntpInfo.setPollingInterval(43200000); // 12 hours
     ntpInfo.setPollingIntervalShorter(30000); // 30 seconds
     ntpInfo.setTimeErrorThreshold(1000); // 1 second
     ntpInfoSet = dateTimePolicy.setNtpInfo(ntpInfo);
     if (ntpInfoSet) {
         // operation was successfull
     } else {
         // operation failed
 } catch (SecurityException e) {
     Log.w(TAG, "SecurityException: " + e);

And indeed, the DateTimePolicy.NtpInfo reflects the updated values even upon application restart. However, /system/etc/gps.conf still looks like this:

What am I doing wrong?

Similar topics

No similar topics found.
Jenna S.Samsung SEAP Moderator
Nov 22, 2018
10:29 pm

Hello Marek,

You are implementing the setNTPinfo API correctly, and it does have an effect. This can been seen when you use the getNTPInfo method, as it should have the updated information.

Best regards,