OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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.content.browser; | 5 package org.chromium.content.browser; |
6 | 6 |
7 import android.Manifest; | 7 import android.Manifest; |
8 import android.content.Context; | 8 import android.content.Context; |
9 import android.content.pm.PackageManager; | 9 import android.content.pm.PackageManager; |
10 import android.os.Process; | 10 import android.os.Process; |
(...skipping 23 matching lines...) Expand all Loading... |
34 * This class lives on the main thread. | 34 * This class lives on the main thread. |
35 */ | 35 */ |
36 @JNINamespace("content") | 36 @JNINamespace("content") |
37 class BackgroundSyncNetworkObserver implements NetworkChangeNotifierAutoDetect.O
bserver { | 37 class BackgroundSyncNetworkObserver implements NetworkChangeNotifierAutoDetect.O
bserver { |
38 private static final String TAG = "cr_BgSyncNetObserver"; | 38 private static final String TAG = "cr_BgSyncNetObserver"; |
39 | 39 |
40 private NetworkChangeNotifierAutoDetect mNotifier; | 40 private NetworkChangeNotifierAutoDetect mNotifier; |
41 private Context mContext; | 41 private Context mContext; |
42 | 42 |
43 // The singleton instance. | 43 // The singleton instance. |
44 private static BackgroundSyncNetworkObserver sInstance = null; | 44 private static BackgroundSyncNetworkObserver sInstance; |
45 | 45 |
46 // List of native observers. These are each called when the network state ch
anges. | 46 // List of native observers. These are each called when the network state ch
anges. |
47 private List<Long> mNativePtrs; | 47 private List<Long> mNativePtrs; |
48 | 48 |
49 private BackgroundSyncNetworkObserver(Context ctx) { | 49 private BackgroundSyncNetworkObserver(Context ctx) { |
50 ThreadUtils.assertOnUiThread(); | 50 ThreadUtils.assertOnUiThread(); |
51 mContext = ctx; | 51 mContext = ctx; |
52 mNativePtrs = new ArrayList<Long>(); | 52 mNativePtrs = new ArrayList<Long>(); |
53 } | 53 } |
54 | 54 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 @Override | 115 @Override |
116 public void onNetworkSoonToDisconnect(long netId) {} | 116 public void onNetworkSoonToDisconnect(long netId) {} |
117 @Override | 117 @Override |
118 public void onNetworkDisconnect(long netId) {} | 118 public void onNetworkDisconnect(long netId) {} |
119 @Override | 119 @Override |
120 public void purgeActiveNetworkList(long[] activeNetIds) {} | 120 public void purgeActiveNetworkList(long[] activeNetIds) {} |
121 | 121 |
122 @NativeClassQualifiedName("BackgroundSyncNetworkObserverAndroid::Observer") | 122 @NativeClassQualifiedName("BackgroundSyncNetworkObserverAndroid::Observer") |
123 private native void nativeNotifyConnectionTypeChanged(long nativePtr, int ne
wConnectionType); | 123 private native void nativeNotifyConnectionTypeChanged(long nativePtr, int ne
wConnectionType); |
124 } | 124 } |
OLD | NEW |