Loading services/core/java/com/android/server/NetworkTimeUpdateService.java +27 −13 Original line number Diff line number Diff line Loading @@ -165,9 +165,14 @@ public class NetworkTimeUpdateService extends Binder { mContext.enforceCallingPermission( android.Manifest.permission.SET_TIME, "clear latest network time"); final long token = Binder.clearCallingIdentity(); try { mTime.clearCachedTimeResult(); mLocalLog.log("clearTimeForTests"); } finally { Binder.restoreCallingIdentity(token); } } /** Loading @@ -181,6 +186,8 @@ public class NetworkTimeUpdateService extends Binder { mContext.enforceCallingPermission( android.Manifest.permission.SET_TIME, "force network time refresh"); final long token = Binder.clearCallingIdentity(); try { boolean success = mTime.forceRefresh(); mLocalLog.log("forceRefreshForTests: success=" + success); Loading @@ -188,8 +195,10 @@ public class NetworkTimeUpdateService extends Binder { makeNetworkTimeSuggestion(mTime.getCachedTimeResult(), "Origin: NetworkTimeUpdateService: forceRefreshForTests"); } return success; } finally { Binder.restoreCallingIdentity(token); } } /** Loading @@ -201,10 +210,15 @@ public class NetworkTimeUpdateService extends Binder { mContext.enforceCallingPermission( android.Manifest.permission.SET_TIME, "set NTP server config for tests"); final long token = Binder.clearCallingIdentity(); try { mLocalLog.log("Setting server config for tests: hostname=" + hostname + ", port=" + port + ", timeout=" + timeout); mTime.setServerConfigForTests(hostname, port, timeout); } finally { Binder.restoreCallingIdentity(token); } } private void onPollNetworkTime(int event) { Loading Loading
services/core/java/com/android/server/NetworkTimeUpdateService.java +27 −13 Original line number Diff line number Diff line Loading @@ -165,9 +165,14 @@ public class NetworkTimeUpdateService extends Binder { mContext.enforceCallingPermission( android.Manifest.permission.SET_TIME, "clear latest network time"); final long token = Binder.clearCallingIdentity(); try { mTime.clearCachedTimeResult(); mLocalLog.log("clearTimeForTests"); } finally { Binder.restoreCallingIdentity(token); } } /** Loading @@ -181,6 +186,8 @@ public class NetworkTimeUpdateService extends Binder { mContext.enforceCallingPermission( android.Manifest.permission.SET_TIME, "force network time refresh"); final long token = Binder.clearCallingIdentity(); try { boolean success = mTime.forceRefresh(); mLocalLog.log("forceRefreshForTests: success=" + success); Loading @@ -188,8 +195,10 @@ public class NetworkTimeUpdateService extends Binder { makeNetworkTimeSuggestion(mTime.getCachedTimeResult(), "Origin: NetworkTimeUpdateService: forceRefreshForTests"); } return success; } finally { Binder.restoreCallingIdentity(token); } } /** Loading @@ -201,10 +210,15 @@ public class NetworkTimeUpdateService extends Binder { mContext.enforceCallingPermission( android.Manifest.permission.SET_TIME, "set NTP server config for tests"); final long token = Binder.clearCallingIdentity(); try { mLocalLog.log("Setting server config for tests: hostname=" + hostname + ", port=" + port + ", timeout=" + timeout); mTime.setServerConfigForTests(hostname, port, timeout); } finally { Binder.restoreCallingIdentity(token); } } private void onPollNetworkTime(int event) { Loading