Remove wake lock checks from TimeDetectorStrategy

Remove wake lock checks from TimeDetectorStrategyCallbackImpl since
they're no longer valid in all cases. Originally the code that performed
time calcs were the only callers but that first changed in commit
312da9b9fc and since then calls have been added to dumpsys too.

Bug: 140712361
Bug: 147585410
Test: boot
Change-Id: I725699d81815eedc570d648dde7ed425009fb3bd
This commit is contained in:
Neil Fuller
2020-01-13 20:28:15 +00:00
parent 49c903a0d2
commit b85d31d459
3 changed files with 2 additions and 5 deletions

View File

@@ -61,10 +61,10 @@ public interface TimeDetectorStrategy {
/** Acquire a suitable wake lock. Must be followed by {@link #releaseWakeLock()} */
void acquireWakeLock();
/** Returns the elapsedRealtimeMillis clock value. The WakeLock must be held. */
/** Returns the elapsedRealtimeMillis clock value. */
long elapsedRealtimeMillis();
/** Returns the system clock value. The WakeLock must be held. */
/** Returns the system clock value. */
long systemClockMillis();
/** Sets the device system clock. The WakeLock must be held. */

View File

@@ -88,13 +88,11 @@ public final class TimeDetectorStrategyCallbackImpl implements TimeDetectorStrat
@Override
public long elapsedRealtimeMillis() {
checkWakeLockHeld();
return SystemClock.elapsedRealtime();
}
@Override
public long systemClockMillis() {
checkWakeLockHeld();
return System.currentTimeMillis();
}

View File

@@ -651,7 +651,6 @@ public class TimeDetectorStrategyImplTest {
@Override
public long systemClockMillis() {
assertWakeLockAcquired();
return mSystemClockMillis;
}