10 lines
403 B
Java
10 lines
403 B
Java
|
|
package cn.ucvl.zhaodisplay;
|
||
|
|
|
||
|
|
/** Shared scheduling rule, independent of Android for deterministic testing. */
|
||
|
|
final class LocationCadence {
|
||
|
|
static int seconds(int value){return value==10||value==60||value==300?value:300;}
|
||
|
|
static boolean due(long now,long lastAttempt,int interval,boolean firstFix){
|
||
|
|
return lastAttempt==0||now-lastAttempt>=1000L*(firstFix?10:seconds(interval));
|
||
|
|
}
|
||
|
|
}
|