Projects >> android-frameworks-base-with-screenshot-tweaks >>271397cfb2b79d1346568209b37b1f57707f924a

Chunk
Conflicting content
            for (int checkType=0; checkType <= ConnectivityManager.MAX_NETWORK_TYPE; checkType++) {
                if (checkType == prevNetType) continue;
                if (mNetAttributes[checkType] == null) continue;
<<<<<<< HEAD
                if (!mNetAttributes[checkType].isDefault()) continue;

// Enabling the isAvailable() optimization caused mobile to not get
// selected if it was in the middle of error handling. Specifically
// a moble connection that took 30 seconds to complete the DEACTIVATE_DATA_CALL
// would not be available and we wouldn't get connected to anything.
// So removing the isAvailable() optimization below for now. TODO: This
// optimization should work and we need to investigate why it doesn't work.
// This could be related to how DEACTIVATE_DATA_CALL is reporting its
// complete before it is really complete.
//                if (!mNetTrackers[checkType].isAvailable()) continue;

//                if (currentPriority >= mNetAttributes[checkType].mPriority) continue;

                NetworkStateTracker checkTracker = mNetTrackers[checkType];
                NetworkInfo checkInfo = checkTracker.getNetworkInfo();
                if (!checkInfo.isConnectedOrConnecting() || checkTracker.isTeardownRequested()) {
                    checkInfo.setFailover(true);
                    checkTracker.reconnect();
                }
                if (DBG) log("Attempting to switch to " + checkInfo.getTypeName());
=======
                if (mNetAttributes[checkType].isDefault() == false) continue;
                if (mNetAttributes[checkType].mRadio == ConnectivityManager.TYPE_MOBILE &&
                        noMobileData) {
                    Slog.e(TAG, "not failing over to mobile type " + checkType +
                            " because Mobile Data Disabled");
                    continue;
                }
                NetworkStateTracker tracker = mNetTrackers[checkType];
                NetworkInfo info = tracker.getNetworkInfo();
                if (!info.isConnectedOrConnecting() ||
                        tracker.isTeardownRequested()) {
                    info.setFailover(true);
                    tracker.reconnect();
                }
                if (DBG) Slog.d(TAG, "Attempting to switch to " + info.getTypeName());

                // figure out if this is the highest priority network
                // so we send an appropriate return value
                if (checkType == mNetworkPreference) {
                    newType = checkType;
                }
                if (mNetAttributes[checkType].mPriority > newPriority &&
                        newType != mNetworkPreference) {
                    newType = checkType;
                    newPriority = mNetAttributes[checkType].mPriority;
                }
>>>>>>> de27b519588ed46c0ba601a489c01d26ec31757d
            }
        }
    }
Solution content
            for (int checkType=0; checkType <= ConnectivityManager.MAX_NETWORK_TYPE; checkType++) {
                if (checkType == prevNetType) continue;
                if (mNetAttributes[checkType] == null) continue;
                if (!mNetAttributes[checkType].isDefault()) continue;

// Enabling the isAvailable() optimization caused mobile to not get
// selected if it was in the middle of error handling. Specifically
// a moble connection that took 30 seconds to complete the DEACTIVATE_DATA_CALL
// would not be available and we wouldn't get connected to anything.
// So removing the isAvailable() optimization below for now. TODO: This
// optimization should work and we need to investigate why it doesn't work.
// This could be related to how DEACTIVATE_DATA_CALL is reporting its
// complete before it is really complete.
//                if (!mNetTrackers[checkType].isAvailable()) continue;


//                if (currentPriority >= mNetAttributes[checkType].mPriority) continue;
                NetworkStateTracker checkTracker = mNetTrackers[checkType];
                NetworkInfo checkInfo = checkTracker.getNetworkInfo();
                if (!checkInfo.isConnectedOrConnecting() || checkTracker.isTeardownRequested()) {
                    checkInfo.setFailover(true);
                    checkTracker.reconnect();
                }
                if (DBG) log("Attempting to switch to " + checkInfo.getTypeName());
            }
        }
    }
File
ConnectivityService.java
Developer's decision
Version 1
Kind of conflict
Array access
Comment
If statement
Method invocation
Variable