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

Unified Diff: net/android/java/src/org/chromium/net/NetworkChangeNotifierAutoDetect.java

Issue 2792583002: 📱 Simplify naming of generated java enums IntDefs (Closed)
Patch Set: rebase Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: net/android/java/src/org/chromium/net/NetworkChangeNotifierAutoDetect.java
diff --git a/net/android/java/src/org/chromium/net/NetworkChangeNotifierAutoDetect.java b/net/android/java/src/org/chromium/net/NetworkChangeNotifierAutoDetect.java
index 19a3e33512af38609d7f94b396a4edbd9c58afc2..daed21f0d0e875bdc58049cb3856ff7ceb2f3fed 100644
--- a/net/android/java/src/org/chromium/net/NetworkChangeNotifierAutoDetect.java
+++ b/net/android/java/src/org/chromium/net/NetworkChangeNotifierAutoDetect.java
@@ -33,7 +33,6 @@
import org.chromium.base.ThreadUtils;
import org.chromium.base.VisibleForTesting;
import org.chromium.base.metrics.RecordHistogram;
-import org.chromium.net.ConnectionType.ConnectionTypeEnum;
import java.io.IOException;
import java.util.Arrays;
@@ -207,7 +206,7 @@ private NetworkInfo getNetworkInfo(Network network) {
* Only callable on Lollipop and newer releases.
*/
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
- @ConnectionTypeEnum
+ @ConnectionType
int getConnectionType(Network network) {
NetworkInfo networkInfo = getNetworkInfo(network);
if (networkInfo != null && networkInfo.getType() == TYPE_VPN) {
@@ -480,7 +479,7 @@ public void onAvailable(Network network) {
mVpnInPlace = network;
}
final long netId = networkToNetId(network);
- @ConnectionTypeEnum
+ @ConnectionType
final int connectionType = mConnectivityManagerDelegate.getConnectionType(network);
ThreadUtils.postOnUiThread(new Runnable() {
@Override
@@ -549,7 +548,7 @@ public void run() {
getAllNetworksFiltered(mConnectivityManagerDelegate, network)) {
onAvailable(newNetwork);
}
- @ConnectionTypeEnum
+ @ConnectionType
final int newConnectionType = convertToConnectionType(getCurrentNetworkState());
ThreadUtils.postOnUiThread(new Runnable() {
@Override
@@ -610,7 +609,7 @@ protected void init(NetworkChangeNotifierAutoDetect notifier) {
private final MyNetworkCallback mNetworkCallback;
private final NetworkRequest mNetworkRequest;
private boolean mRegistered;
- @ConnectionTypeEnum
+ @ConnectionType
private int mConnectionType;
private String mWifiSSID;
private double mMaxBandwidthMbps;
@@ -637,7 +636,7 @@ protected void init(NetworkChangeNotifierAutoDetect notifier) {
/**
* Called when default network changes.
*/
- public void onConnectionTypeChanged(@ConnectionTypeEnum int newConnectionType);
+ public void onConnectionTypeChanged(@ConnectionType int newConnectionType);
/**
* Called when maximum bandwidth of default network changes.
*/
@@ -875,7 +874,7 @@ public long getDefaultNetId() {
/**
* Returns the connection type for the given NetworkState.
*/
- @ConnectionTypeEnum
+ @ConnectionType
public static int convertToConnectionType(NetworkState networkState) {
if (!networkState.isConnected()) {
return ConnectionType.CONNECTION_NONE;
@@ -887,7 +886,7 @@ public static int convertToConnectionType(NetworkState networkState) {
/**
* Returns the connection type for the given ConnectivityManager type and subtype.
*/
- @ConnectionTypeEnum
+ @ConnectionType
private static int convertToConnectionType(int type, int subtype) {
switch (type) {
case ConnectivityManager.TYPE_ETHERNET:
@@ -1008,7 +1007,7 @@ public void onReceive(Context context, Intent intent) {
}
private void connectionTypeChanged(NetworkState networkState) {
- @ConnectionTypeEnum
+ @ConnectionType
int newConnectionType = convertToConnectionType(networkState);
String newWifiSSID = networkState.getWifiSsid();
if (newConnectionType == mConnectionType && newWifiSSID.equals(mWifiSSID)) return;
« no previous file with comments | « components/offline_items_collection/core/android/java/src/org/chromium/components/offline_items_collection/OfflineItemBridge.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698