Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(961)

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebBroadcastService.java

Issue 2719493003: Add PhysicalWebBroadcastService (Closed)
Patch Set: Making Change for Previous land of ShareActivity Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 package org.chromium.chrome.browser.physicalweb;
6
7 import android.annotation.TargetApi;
8 import android.app.Service;
9 import android.content.Intent;
10 import android.os.Build;
11 import android.os.IBinder;
12
13 /**
14 * Broadcasts Physical Web URLs via BLE.
15 **/
16 // bluetooth.le.AdvertiseCallback and bluetooth.BluetoothAdapter require API lev el 21.
17 // This will only be run on M and above.
18 @TargetApi(Build.VERSION_CODES.LOLLIPOP)
19 public class PhysicalWebBroadcastService extends Service {
20 public static final String DISPLAY_URL_KEY = "display_url";
21
22 @Override
23 public int onStartCommand(Intent intent, int flags, int startId) {
24 String displayUrl = intent.getStringExtra(DISPLAY_URL_KEY);
25 // This should never happen.
26 if (displayUrl == null) {
27 stopSelf();
28 return START_STICKY;
29 }
30 return START_STICKY;
cco3 2017/03/02 23:46:07 go ahead and stopself() here and leave a TODO
iankc 2017/03/02 23:51:05 Done.
31 }
32
33 @Override
34 public void onDestroy() {
cco3 2017/03/02 23:46:07 Get rid of this
iankc 2017/03/02 23:51:05 Done.
35 super.onDestroy();
36 }
37
38 @Override
39 public IBinder onBind(Intent intent) {
40 return null;
41 }
42 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698