Lines Matching refs:intent

47      * Start action by sending intent to the service
51 final Intent intent = makeIntent(OP_START_ACTION);
54 intent.putExtra(EXTRA_ACTION_BUNDLE, actionBundle);
56 startServiceWithIntent(intent);
67 final Intent intent = PendingActionReceiver.makeIntent(OP_START_ACTION);
70 intent.putExtra(EXTRA_ACTION_BUNDLE, actionBundle);
72 PendingActionReceiver.scheduleAlarm(intent, requestCode, delayMs);
82 final Intent intent = makeIntent(OP_RECEIVE_BACKGROUND_RESPONSE);
86 intent.putExtra(EXTRA_ACTION_BUNDLE, actionBundle);
87 intent.putExtra(EXTRA_WORKER_RESPONSE, response);
89 startServiceWithIntent(intent);
98 final Intent intent = makeIntent(OP_RECEIVE_BACKGROUND_FAILURE);
102 intent.putExtra(EXTRA_ACTION_BUNDLE, actionBundle);
103 intent.putExtra(EXTRA_WORKER_EXCEPTION, exception);
105 startServiceWithIntent(intent);
133 * Allocate an intent with a specific opcode.
136 final Intent intent = new Intent(Factory.get().getApplicationContext(),
138 intent.putExtra(EXTRA_OP_CODE, opcode);
139 return intent;
149 * Allocate an intent with a specific opcode and alarm action.
152 final Intent intent = new Intent(Factory.get().getApplicationContext(),
154 intent.setAction(ACTION);
155 intent.putExtra(EXTRA_OP_CODE, opcode);
156 return intent;
159 public static void scheduleAlarm(final Intent intent, final int requestCode,
163 context, requestCode, intent, PendingIntent.FLAG_CANCEL_CURRENT);
180 public void onReceive(final Context context, final Intent intent) {
181 ActionServiceImpl.startServiceWithIntent(intent);
186 * Creates a pending intent that will trigger a data model action when the intent is
191 final Intent intent = PendingActionReceiver.makeIntent(OP_START_ACTION);
194 intent.putExtra(EXTRA_ACTION_BUNDLE, actionBundle);
196 intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
198 return PendingIntent.getBroadcast(context, requestCode, intent,
223 * Queue intent to the ActionService after acquiring wake lock
225 private static void startServiceWithIntent(final Intent intent) {
227 final int opcode = intent.getIntExtra(EXTRA_OP_CODE, 0);
232 sWakeLock.acquire(context, intent, opcode);
233 intent.setClass(context, ActionServiceImpl.class);
235 // TODO: Note that intent will be quietly discarded if it exceeds available rpc
239 if (context.startService(intent) == null) {
241 "ActionService.startServiceWithIntent: failed to start service for intent "
242 + intent);
243 sWakeLock.release(intent, opcode);
251 protected void onHandleIntent(final Intent intent) {
252 if (intent == null) {
254 LogUtil.w(TAG, "ActionService.onHandleIntent: Called with null intent");
257 final int opcode = intent.getIntExtra(EXTRA_OP_CODE, 0);
258 sWakeLock.ensure(intent, opcode);
262 final Bundle actionBundle = intent.getBundleExtra(EXTRA_ACTION_BUNDLE);
273 final Bundle response = intent.getBundleExtra(EXTRA_WORKER_RESPONSE);
291 sWakeLock.release(intent, opcode);