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

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

Issue 2719493003: Add PhysicalWebBroadcastService (Closed)
Patch Set: Created 3 years, 10 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 import org.chromium.base.Log;
14
15 /**
16 * Broadcasts Physical Web URLs via BLE.
17 **/
18 // bluetooth.le.AdvertiseCallback and bluetooth.BluetoothAdapter require API lev el 21.
19 // This will only be run on M and above.
20 @TargetApi(Build.VERSION_CODES.LOLLIPOP)
21 public class PhysicalWebBroadcastService extends Service {
22 public static final String DISPLAY_URL_KEY = "display_url";
23
24 private static final String TAG = "PhysicalWeb";
cco3 2017/02/25 00:09:26 This tag isn't needed yet.
iankc 2017/03/02 18:53:31 Done.
25
26 @Override
cco3 2017/02/25 00:09:25 Remove this method
iankc 2017/03/02 18:53:31 Done.
27 public void onCreate() {
28 super.onCreate();
29 }
30
31 @Override
32 public int onStartCommand(Intent intent, int flags, int startId) {
33 String displayUrl = intent.getStringExtra(DISPLAY_URL_KEY);
34 if (displayUrl == null) {
cco3 2017/02/25 00:09:25 Add a note that this should never happen.
iankc 2017/03/02 18:53:31 Done.
35 stopSelf();
36 return START_STICKY;
37 }
38 return START_STICKY;
39 }
40
41 @Override
42 public void onDestroy() {
43 Log.v(TAG, "On Destroy");
cco3 2017/02/25 00:09:25 Remove this log
iankc 2017/03/02 18:53:31 Done.
44 super.onDestroy();
45 }
46
47 @Override
48 public IBinder onBind(Intent intent) {
49 return null;
50 }
51 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698