Skip to content

Commit

Permalink
Merge pull request flutter#2152 from mpcomplete/updater.on
Browse files Browse the repository at this point in the history
Turn on FLX updater.
  • Loading branch information
mpcomplete committed Dec 8, 2015
2 parents db57729 + 6a2f580 commit 4b6b031
Showing 1 changed file with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
public class UpdateService extends Service {
private static final String TAG = "UpdateService";
private static final int REQUEST_CODE = 0; // Not sure why this is needed.
private static final boolean ENABLED = false;
private static final boolean TESTING = false;

private long mNativePtr = 0;

Expand All @@ -40,23 +38,22 @@ public void onConnectionError(MojoException e) {}

@Override
public void notifyUpdateCheckComplete() {
if (sCurrentUpdateService != null)
sCurrentUpdateService.stopSelf();
if (sCurrentUpdateService != null)
sCurrentUpdateService.stopSelf();
}
}

public static void init(Context context) {
if (ENABLED || TESTING)
maybeScheduleUpdateCheck(context);
maybeScheduleUpdateCheck(context);
}

private static void maybeScheduleUpdateCheck(Context context) {
Intent alarm = new Intent(context, UpdateService.class);
PendingIntent existingIntent = PendingIntent.getService(
context, REQUEST_CODE, alarm, PendingIntent.FLAG_NO_CREATE);
if (existingIntent != null && !TESTING) {
Log.i(TAG, "Update alarm exists: " + PathUtils.getDataDirectory(context));
return;
if (existingIntent != null) {
Log.i(TAG, "Update alarm exists: " + PathUtils.getDataDirectory(context));
return;
}

PendingIntent pendingIntent = PendingIntent.getService(
Expand Down

0 comments on commit 4b6b031

Please sign in to comment.