Loading services/core/java/com/android/server/timedetector/NetworkTimeUpdateService.java +25 −11 Original line number Diff line number Diff line Loading @@ -172,9 +172,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 @@ -188,6 +193,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 @@ -195,8 +202,10 @@ public class NetworkTimeUpdateService extends Binder { makeNetworkTimeSuggestion(mTime.getCachedTimeResult(), "Origin: NetworkTimeUpdateService: forceRefreshForTests"); } return success; } finally { Binder.restoreCallingIdentity(token); } } /** Loading @@ -207,8 +216,13 @@ 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: ntpConnectionInfo=" + ntpConfig); mTime.setServerConfigForTests(ntpConfig); } finally { Binder.restoreCallingIdentity(token); } } private void onPollNetworkTime(int event) { Loading Loading
services/core/java/com/android/server/timedetector/NetworkTimeUpdateService.java +25 −11 Original line number Diff line number Diff line Loading @@ -172,9 +172,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 @@ -188,6 +193,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 @@ -195,8 +202,10 @@ public class NetworkTimeUpdateService extends Binder { makeNetworkTimeSuggestion(mTime.getCachedTimeResult(), "Origin: NetworkTimeUpdateService: forceRefreshForTests"); } return success; } finally { Binder.restoreCallingIdentity(token); } } /** Loading @@ -207,8 +216,13 @@ 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: ntpConnectionInfo=" + ntpConfig); mTime.setServerConfigForTests(ntpConfig); } finally { Binder.restoreCallingIdentity(token); } } private void onPollNetworkTime(int event) { Loading