Minor fixes: Add a missing "break" and some cosmetic fixes.

Change-Id: Ie614a7b47185fd511fdc3f064620e46ab7d6d8f8
This commit is contained in:
Sreeram Ramachandran
2013-08-27 11:41:19 -07:00
parent 79d505d075
commit 1b5a3acb8b

View File

@@ -182,7 +182,7 @@ public class ConnectivityService extends IConnectivityManager.Stub {
private static final String ACTION_PKT_CNT_SAMPLE_INTERVAL_ELAPSED = private static final String ACTION_PKT_CNT_SAMPLE_INTERVAL_ELAPSED =
"android.net.ConnectivityService.action.PKT_CNT_SAMPLE_INTERVAL_ELAPSED"; "android.net.ConnectivityService.action.PKT_CNT_SAMPLE_INTERVAL_ELAPSED";
private static final int SAMPLE_INTERVAL_ELAPSED_REQURST_CODE = 0; private static final int SAMPLE_INTERVAL_ELAPSED_REQUEST_CODE = 0;
private PendingIntent mSampleIntervalElapsedIntent; private PendingIntent mSampleIntervalElapsedIntent;
@@ -665,7 +665,7 @@ public class ConnectivityService extends IConnectivityManager.Stub {
// start network sampling .. // start network sampling ..
Intent intent = new Intent(ACTION_PKT_CNT_SAMPLE_INTERVAL_ELAPSED, null); Intent intent = new Intent(ACTION_PKT_CNT_SAMPLE_INTERVAL_ELAPSED, null);
mSampleIntervalElapsedIntent = PendingIntent.getBroadcast(mContext, mSampleIntervalElapsedIntent = PendingIntent.getBroadcast(mContext,
SAMPLE_INTERVAL_ELAPSED_REQURST_CODE, intent, 0); SAMPLE_INTERVAL_ELAPSED_REQUEST_CODE, intent, 0);
mAlarmManager = (AlarmManager)mContext.getSystemService(Context.ALARM_SERVICE); mAlarmManager = (AlarmManager)mContext.getSystemService(Context.ALARM_SERVICE);
setAlarm(DEFAULT_START_SAMPLING_INTERVAL_IN_SECONDS * 1000, mSampleIntervalElapsedIntent); setAlarm(DEFAULT_START_SAMPLING_INTERVAL_IN_SECONDS * 1000, mSampleIntervalElapsedIntent);
@@ -2924,7 +2924,7 @@ public class ConnectivityService extends IConnectivityManager.Stub {
public void handleMessage(Message msg) { public void handleMessage(Message msg) {
NetworkInfo info; NetworkInfo info;
switch (msg.what) { switch (msg.what) {
case EVENT_CLEAR_NET_TRANSITION_WAKELOCK: case EVENT_CLEAR_NET_TRANSITION_WAKELOCK: {
String causedBy = null; String causedBy = null;
synchronized (ConnectivityService.this) { synchronized (ConnectivityService.this) {
if (msg.arg1 == mNetTransitionWakeLockSerialNumber && if (msg.arg1 == mNetTransitionWakeLockSerialNumber &&
@@ -2937,49 +2937,44 @@ public class ConnectivityService extends IConnectivityManager.Stub {
log("NetTransition Wakelock for " + causedBy + " released by timeout"); log("NetTransition Wakelock for " + causedBy + " released by timeout");
} }
break; break;
case EVENT_RESTORE_DEFAULT_NETWORK: }
case EVENT_RESTORE_DEFAULT_NETWORK: {
FeatureUser u = (FeatureUser)msg.obj; FeatureUser u = (FeatureUser)msg.obj;
u.expire(); u.expire();
break; break;
case EVENT_INET_CONDITION_CHANGE: }
{ case EVENT_INET_CONDITION_CHANGE: {
int netType = msg.arg1; int netType = msg.arg1;
int condition = msg.arg2; int condition = msg.arg2;
handleInetConditionChange(netType, condition); handleInetConditionChange(netType, condition);
break; break;
} }
case EVENT_INET_CONDITION_HOLD_END: case EVENT_INET_CONDITION_HOLD_END: {
{
int netType = msg.arg1; int netType = msg.arg1;
int sequence = msg.arg2; int sequence = msg.arg2;
handleInetConditionHoldEnd(netType, sequence); handleInetConditionHoldEnd(netType, sequence);
break; break;
} }
case EVENT_SET_NETWORK_PREFERENCE: case EVENT_SET_NETWORK_PREFERENCE: {
{
int preference = msg.arg1; int preference = msg.arg1;
handleSetNetworkPreference(preference); handleSetNetworkPreference(preference);
break; break;
} }
case EVENT_SET_MOBILE_DATA: case EVENT_SET_MOBILE_DATA: {
{
boolean enabled = (msg.arg1 == ENABLED); boolean enabled = (msg.arg1 == ENABLED);
handleSetMobileData(enabled); handleSetMobileData(enabled);
break; break;
} }
case EVENT_APPLY_GLOBAL_HTTP_PROXY: case EVENT_APPLY_GLOBAL_HTTP_PROXY: {
{
handleDeprecatedGlobalHttpProxy(); handleDeprecatedGlobalHttpProxy();
break; break;
} }
case EVENT_SET_DEPENDENCY_MET: case EVENT_SET_DEPENDENCY_MET: {
{
boolean met = (msg.arg1 == ENABLED); boolean met = (msg.arg1 == ENABLED);
handleSetDependencyMet(msg.arg2, met); handleSetDependencyMet(msg.arg2, met);
break; break;
} }
case EVENT_SEND_STICKY_BROADCAST_INTENT: case EVENT_SEND_STICKY_BROADCAST_INTENT: {
{
Intent intent = (Intent)msg.obj; Intent intent = (Intent)msg.obj;
sendStickyBroadcast(intent); sendStickyBroadcast(intent);
break; break;
@@ -3008,13 +3003,15 @@ public class ConnectivityService extends IConnectivityManager.Stub {
log("EVENT_ENABLE_FAIL_FAST_MOBILE_DATA: stale arg1:" + msg.arg1 log("EVENT_ENABLE_FAIL_FAST_MOBILE_DATA: stale arg1:" + msg.arg1
+ " != tag:" + tag); + " != tag:" + tag);
} }
break;
} }
case EVENT_SAMPLE_INTERVAL_ELAPSED: case EVENT_SAMPLE_INTERVAL_ELAPSED: {
handleNetworkSamplingTimeout(); handleNetworkSamplingTimeout();
break; break;
} }
} }
} }
}
// javadoc from interface // javadoc from interface
public int tether(String iface) { public int tether(String iface) {