OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.components.background_task_scheduler; | 5 package org.chromium.components.background_task_scheduler; |
6 | 6 |
7 import com.google.android.gms.gcm.GcmNetworkManager; | 7 import com.google.android.gms.gcm.GcmNetworkManager; |
8 import com.google.android.gms.gcm.GcmTaskService; | 8 import com.google.android.gms.gcm.GcmTaskService; |
9 import com.google.android.gms.gcm.TaskParams; | 9 import com.google.android.gms.gcm.TaskParams; |
10 | 10 |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 ContextUtils.getApplicationContext(), taskParams)); | 117 ContextUtils.getApplicationContext(), taskParams)); |
118 } | 118 } |
119 }); | 119 }); |
120 | 120 |
121 if (taskNeedsRescheduling.get()) return GcmNetworkManager.RESULT_RESCHED
ULE; | 121 if (taskNeedsRescheduling.get()) return GcmNetworkManager.RESULT_RESCHED
ULE; |
122 | 122 |
123 return GcmNetworkManager.RESULT_SUCCESS; | 123 return GcmNetworkManager.RESULT_SUCCESS; |
124 } | 124 } |
125 | 125 |
126 @Override | 126 @Override |
127 public void onInitializeTasks() {} | 127 public void onInitializeTasks() { |
| 128 BackgroundTaskSchedulerFactory.getScheduler().reschedule( |
| 129 ContextUtils.getApplicationContext()); |
| 130 } |
128 } | 131 } |
OLD | NEW |