mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-09 05:24:44 +01:00
revert earlier change not running update check timer on DEBUG builds
since they're now upgradable too.
This commit is contained in:
parent
6a36c1252d
commit
4b6ea57e70
1 changed files with 13 additions and 18 deletions
|
@ -93,27 +93,22 @@ public class UpdateCheckReceiver extends BroadcastReceiver {
|
||||||
|
|
||||||
public static void restartTimer( Context context )
|
public static void restartTimer( Context context )
|
||||||
{
|
{
|
||||||
if ( BuildConfig.DEBUG ) {
|
AlarmManager am =
|
||||||
DbgUtils.logf( "UpdateCheckReceiver.restartTimer(): dropping because"
|
(AlarmManager)context.getSystemService( Context.ALARM_SERVICE );
|
||||||
+ " debug builds can't be updated" );
|
|
||||||
} else {
|
|
||||||
AlarmManager am =
|
|
||||||
(AlarmManager)context.getSystemService( Context.ALARM_SERVICE );
|
|
||||||
|
|
||||||
Intent intent = new Intent( context, UpdateCheckReceiver.class );
|
Intent intent = new Intent( context, UpdateCheckReceiver.class );
|
||||||
PendingIntent pi = PendingIntent.getBroadcast( context, 0, intent, 0 );
|
PendingIntent pi = PendingIntent.getBroadcast( context, 0, intent, 0 );
|
||||||
am.cancel( pi );
|
am.cancel( pi );
|
||||||
|
|
||||||
long interval_millis = INTERVAL_ONEDAY;
|
long interval_millis = INTERVAL_ONEDAY;
|
||||||
if ( !devOK( context ) ) {
|
if ( !devOK( context ) ) {
|
||||||
interval_millis *= INTERVAL_NDAYS;
|
interval_millis *= INTERVAL_NDAYS;
|
||||||
}
|
|
||||||
interval_millis = (interval_millis / 2)
|
|
||||||
+ Math.abs(Utils.nextRandomInt() % interval_millis);
|
|
||||||
am.setInexactRepeating( AlarmManager.ELAPSED_REALTIME_WAKEUP,
|
|
||||||
SystemClock.elapsedRealtime() + interval_millis,
|
|
||||||
interval_millis, pi );
|
|
||||||
}
|
}
|
||||||
|
interval_millis = (interval_millis / 2)
|
||||||
|
+ Math.abs(Utils.nextRandomInt() % interval_millis);
|
||||||
|
am.setInexactRepeating( AlarmManager.ELAPSED_REALTIME_WAKEUP,
|
||||||
|
SystemClock.elapsedRealtime() + interval_millis,
|
||||||
|
interval_millis, pi );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Is app upgradeable OR have we installed any dicts?
|
// Is app upgradeable OR have we installed any dicts?
|
||||||
|
|
Loading…
Reference in a new issue