| Chunk |
|---|
| Conflicting content |
|---|
}
/**
<<<<<<< HEAD
* Ensure the device stays awake until we connect with the next network
* @param forWhome The name of the network going down for logging purposes
* @return {@code true} on success, {@code false} on failure
* {@hide}
*/
public boolean requestNetworkTransitionWakelock(String forWhom) {
try {
mService.requestNetworkTransitionWakelock(forWhom);
return true;
} catch (RemoteException e) {
return false;
=======
* @param networkType The type of network you want to report on
* @param percentage The quality of the connection 0 is bad, 100 is good
* {@hide}
*/
public void reportInetCondition(int networkType, int percentage) {
try {
mService.reportInetCondition(networkType, percentage);
} catch (RemoteException e) {
>>>>>>> ec52c98d441aa592a203f547c0edec79c25bf28e
}
}
} |
| Solution content |
|---|
}
/**
* Ensure the device stays awake until we connect with the next network
* @param forWhome The name of the network going down for logging purposes
* @return {@code true} on success, {@code false} on failure
* {@hide}
*/
public boolean requestNetworkTransitionWakelock(String forWhom) {
try {
mService.requestNetworkTransitionWakelock(forWhom);
return true;
} catch (RemoteException e) {
return false;
}
}
/*
* @param networkType The type of network you want to report on
* @param percentage The quality of the connection 0 is bad, 100 is good
* {@hide}
*/
public void reportInetCondition(int networkType, int percentage) {
try {
mService.reportInetCondition(networkType, percentage);
} catch (RemoteException e) {
}
}
} |
| File |
|---|
| ConnectivityManager.java |
| Developer's decision |
|---|
| Manual |
| Kind of conflict |
|---|
| Catch clause |
| Comment |
| Method invocation |
| Method signature |
| Return statement |
| Try statement |
| Chunk |
|---|
| Conflicting content |
|---|
* to startMonitoring when the particular event occurs.
* -------------------------------------------------------------
*/
<<<<<<< HEAD
=======
public static final int EVENT_NOTIFICATION_CHANGED = 3;
public static final int EVENT_CONFIGURATION_CHANGED = 4;
public static final int EVENT_ROAMING_CHANGED = 5;
public static final int EVENT_NETWORK_SUBTYPE_CHANGED = 6;
public static final int EVENT_RESTORE_DEFAULT_NETWORK = 7;
/**
* arg1: network type
* arg2: condition (0 bad, 100 good)
*/
public static final int EVENT_INET_CONDITION_CHANGE = 8;
/**
* arg1: network type
*/
public static final int EVENT_INET_CONDITION_HOLD_END = 9;
public NetworkStateTracker(Context context,
Handler target,
int networkType,
int subType,
String typeName,
String subtypeName) {
super();
mContext = context;
mTarget = target;
mTeardownRequested = false;
this.mNetworkInfo = new NetworkInfo(networkType, subType, typeName, subtypeName);
}
public NetworkInfo getNetworkInfo() {
return mNetworkInfo;
}
>>>>>>> ec52c98d441aa592a203f547c0edec79c25bf28e
/**
* The network state has changed and the NetworkInfo object |
| Solution content |
|---|
* to startMonitoring when the particular event occurs.
* -------------------------------------------------------------
*/
/**
* The network state has changed and the NetworkInfo object |
| File |
|---|
| NetworkStateTracker.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Attribute |
| Comment |
| Method declaration |
| Chunk |
|---|
| Conflicting content |
|---|
FeatureUser u = (FeatureUser)msg.obj;
u.expire();
break;
<<<<<<< HEAD
case NetworkStateTracker.EVENT_CLEAR_NET_TRANSITION_WAKELOCK:
String causedBy = null;
synchronized (ConnectivityService.this) {
if (msg.arg1 == mNetTransitionWakeLockSerialNumber &&
mNetTransitionWakeLock.isHeld()) {
mNetTransitionWakeLock.release();
causedBy = mNetTransitionWakeLockCausedBy;
}
}
if (causedBy != null) {
Slog.d(TAG, "NetTransition Wakelock for " +
causedBy + " released by timeout");
}
=======
case NetworkStateTracker.EVENT_INET_CONDITION_CHANGE:
if (DBG) {
Slog.d(TAG, "Inet connectivity change, net=" +
msg.arg1 + ", condition=" + msg.arg2 +
",mActiveDefaultNetwork=" + mActiveDefaultNetwork);
}
if (mActiveDefaultNetwork == -1) {
if (DBG) Slog.d(TAG, "no active default network - aborting");
break;
}
if (mActiveDefaultNetwork != msg.arg1) {
if (DBG) Slog.d(TAG, "given net not default - aborting");
break;
}
mDefaultInetCondition = msg.arg2;
int delay;
if (mInetConditionChangeInFlight == false) {
if (DBG) Slog.d(TAG, "starting a change hold");
// setup a new hold to debounce this
if (mDefaultInetCondition > 50) {
delay = Settings.Secure.getInt(mContext.getContentResolver(),
Settings.Secure.INET_CONDITION_DEBOUNCE_UP_DELAY, 500);
} else {
delay = Settings.Secure.getInt(mContext.getContentResolver(),
Settings.Secure.INET_CONDITION_DEBOUNCE_DOWN_DELAY, 3000);
}
mInetConditionChangeInFlight = true;
sendMessageDelayed(obtainMessage(
NetworkStateTracker.EVENT_INET_CONDITION_HOLD_END,
mActiveDefaultNetwork, mDefaultConnectionSequence), delay);
} else {
// we've set the new condition, when this hold ends that will get
// picked up
if (DBG) Slog.d(TAG, "currently in hold - not setting new end evt");
}
break;
case NetworkStateTracker.EVENT_INET_CONDITION_HOLD_END:
if (DBG) {
Slog.d(TAG, "Inet hold end, net=" + msg.arg1 +
", condition =" + mDefaultInetCondition +
", published condition =" + mDefaultInetConditionPublished);
}
mInetConditionChangeInFlight = false;
if (mActiveDefaultNetwork == -1) {
if (DBG) Slog.d(TAG, "no active default network - aborting");
break;
}
if (mDefaultConnectionSequence != msg.arg2) {
if (DBG) Slog.d(TAG, "event hold for obsolete network - aborting");
break;
}
if (mDefaultInetConditionPublished == mDefaultInetCondition) {
if (DBG) Slog.d(TAG, "no change in condition - aborting");
break;
}
NetworkInfo networkInfo = mNetTrackers[mActiveDefaultNetwork].getNetworkInfo();
if (networkInfo.isConnected() == false) {
if (DBG) Slog.d(TAG, "default network not connected - aborting");
break;
}
mDefaultInetConditionPublished = mDefaultInetCondition;
sendConnectedBroadcast(networkInfo);
>>>>>>> ec52c98d441aa592a203f547c0edec79c25bf28e
break;
}
} |
| Solution content |
|---|
}
}
=======
FeatureUser u = (FeatureUser)msg.obj;
u.expire();
break;
<<<<<<< HEAD:services/java/com/android/server/ConnectivityService.java
case NetworkStateTracker.EVENT_CLEAR_NET_TRANSITION_WAKELOCK:
String causedBy = null;
synchronized (ConnectivityService.this) {
if (msg.arg1 == mNetTransitionWakeLockSerialNumber &&
mNetTransitionWakeLock.isHeld()) {
mNetTransitionWakeLock.release();
causedBy = mNetTransitionWakeLockCausedBy;
}
}
if (causedBy != null) {
Slog.d(TAG, "NetTransition Wakelock for " +
causedBy + " released by timeout");
case NetworkStateTracker.EVENT_INET_CONDITION_CHANGE:
if (DBG) {
Slog.d(TAG, "Inet connectivity change, net=" +
msg.arg1 + ", condition=" + msg.arg2 +
",mActiveDefaultNetwork=" + mActiveDefaultNetwork);
}
if (mActiveDefaultNetwork == -1) {
if (DBG) Slog.d(TAG, "no active default network - aborting");
break;
}
if (mActiveDefaultNetwork != msg.arg1) {
if (DBG) Slog.d(TAG, "given net not default - aborting");
break;
}
mDefaultInetCondition = msg.arg2;
int delay;
if (mInetConditionChangeInFlight == false) {
if (DBG) Slog.d(TAG, "starting a change hold");
// setup a new hold to debounce this
if (mDefaultInetCondition > 50) {
delay = Settings.Secure.getInt(mContext.getContentResolver(),
Settings.Secure.INET_CONDITION_DEBOUNCE_UP_DELAY, 500);
} else {
delay = Settings.Secure.getInt(mContext.getContentResolver(),
Settings.Secure.INET_CONDITION_DEBOUNCE_DOWN_DELAY, 3000);
}
mInetConditionChangeInFlight = true;
sendMessageDelayed(obtainMessage(
NetworkStateTracker.EVENT_INET_CONDITION_HOLD_END,
mActiveDefaultNetwork, mDefaultConnectionSequence), delay);
} else {
// we've set the new condition, when this hold ends that will get
// picked up
if (DBG) Slog.d(TAG, "currently in hold - not setting new end evt");
}
break;
case NetworkStateTracker.EVENT_INET_CONDITION_HOLD_END:
if (DBG) {
Slog.d(TAG, "Inet hold end, net=" + msg.arg1 +
", condition =" + mDefaultInetCondition +
", published condition =" + mDefaultInetConditionPublished);
}
mInetConditionChangeInFlight = false;
if (mActiveDefaultNetwork == -1) {
if (DBG) Slog.d(TAG, "no active default network - aborting");
break;
}
if (mDefaultConnectionSequence != msg.arg2) {
if (DBG) Slog.d(TAG, "event hold for obsolete network - aborting");
break;
}
if (mDefaultInetConditionPublished == mDefaultInetCondition) {
if (DBG) Slog.d(TAG, "no change in condition - aborting");
break;
NetworkInfo networkInfo = mNetTrackers[mActiveDefaultNetwork].getNetworkInfo();
if (networkInfo.isConnected() == false) {
if (DBG) Slog.d(TAG, "default network not connected - aborting");
break;
}
mDefaultInetConditionPublished = mDefaultInetCondition;
sendConnectedBroadcast(networkInfo);
>>>>>>> ec52c98d:services/java/com/android/server/ConnectivityService.java
break;
}
} |
| File |
|---|
| ConnectivityService.java |
| Developer's decision |
|---|
| Manual |
| Kind of conflict |
|---|
| Attribute |
| Break statement |
| Case statement |
| If statement |
| Method invocation |
| Synchronized statement |
| Variable |
| Chunk |
|---|
| Conflicting content |
|---|
return tetherEnabledInSettings && mTetheringConfigValid;
}
<<<<<<< HEAD
// An API NetworkStateTrackers can call when they lose their network.
// This will automatically be cleared after X seconds or a network becomes CONNECTED,
// whichever happens first. The timer is started by the first caller and not
// restarted by subsequent callers.
public void requestNetworkTransitionWakelock(String forWhom) {
enforceConnectivityInternalPermission();
synchronized (this) {
if (mNetTransitionWakeLock.isHeld()) return;
mNetTransitionWakeLockSerialNumber++;
mNetTransitionWakeLock.acquire();
mNetTransitionWakeLockCausedBy = forWhom;
}
mHandler.sendMessageDelayed(mHandler.obtainMessage(
NetworkStateTracker.EVENT_CLEAR_NET_TRANSITION_WAKELOCK,
mNetTransitionWakeLockSerialNumber, 0),
mNetTransitionWakeLockTimeout);
return;
=======
// 100 percent is full good, 0 is full bad.
public void reportInetCondition(int networkType, int percentage) {
if (DBG) Slog.d(TAG, "reportNetworkCondition(" + networkType + ", " + percentage + ")");
mContext.enforceCallingOrSelfPermission(
android.Manifest.permission.STATUS_BAR,
"ConnectivityService");
mHandler.sendMessage(mHandler.obtainMessage(
NetworkStateTracker.EVENT_INET_CONDITION_CHANGE, networkType, percentage));
>>>>>>> ec52c98d441aa592a203f547c0edec79c25bf28e
}
} |
| Solution content |
|---|
return tetherEnabledInSettings && mTetheringConfigValid;
}
// An API NetworkStateTrackers can call when they lose their network.
// This will automatically be cleared after X seconds or a network becomes CONNECTED,
// whichever happens first. The timer is started by the first caller and not
// restarted by subsequent callers.
public void requestNetworkTransitionWakelock(String forWhom) {
enforceConnectivityInternalPermission();
synchronized (this) {
if (mNetTransitionWakeLock.isHeld()) return;
mNetTransitionWakeLockSerialNumber++;
mNetTransitionWakeLock.acquire();
mNetTransitionWakeLockCausedBy = forWhom;
}
mHandler.sendMessageDelayed(mHandler.obtainMessage(
NetworkStateTracker.EVENT_CLEAR_NET_TRANSITION_WAKELOCK,
mNetTransitionWakeLockSerialNumber, 0),
mNetTransitionWakeLockTimeout);
return;
}
// 100 percent is full good, 0 is full bad.
public void reportInetCondition(int networkType, int percentage) {
if (DBG) Slog.d(TAG, "reportNetworkCondition(" + networkType + ", " + percentage + ")");
mContext.enforceCallingOrSelfPermission(
android.Manifest.permission.STATUS_BAR,
"ConnectivityService");
mHandler.sendMessage(mHandler.obtainMessage(
NetworkStateTracker.EVENT_INET_CONDITION_CHANGE, networkType, percentage));
}
} |
| File |
|---|
| ConnectivityService.java |
| Developer's decision |
|---|
| Concatenation |
| Kind of conflict |
|---|
| Comment |
| If statement |
| Method invocation |
| Method signature |
| Return statement |
| Synchronized statement |