1.解决时间回退未立刻发生请求问题
This commit is contained in:
@@ -167,6 +167,10 @@ public class SystemService extends Service implements AppnetCallback, NetStateCh
|
|||||||
handler.sendEmptyMessageDelayed(WHAT_PERIODIC_REQUEST, 60 * 60 * 1000);
|
handler.sendEmptyMessageDelayed(WHAT_PERIODIC_REQUEST, 60 * 60 * 1000);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if(currentTime<lastSuccessTime){
|
||||||
|
handler.sendEmptyMessage(WHAT_PERIODIC_REQUEST);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
long nextRequestTime = lastSuccessTime + REQUEST_INTERVAL;
|
long nextRequestTime = lastSuccessTime + REQUEST_INTERVAL;
|
||||||
long delay = Math.max(0, nextRequestTime - currentTime);
|
long delay = Math.max(0, nextRequestTime - currentTime);
|
||||||
|
|||||||
Reference in New Issue
Block a user