Projects >> platform_frameworks_base >>f333123d50776507891b90a6eda4a3b8fa305bb6

Chunk
Conflicting content
 */
public interface NetworkStateTracker {

<<<<<<< HEAD
    /**
     * -------------------------------------------------------------
     * Event Interface back to ConnectivityService.
     *
     * The events that are to be sent back to the Handler passed
     * to startMonitoring when the particular event occurs.
     * -------------------------------------------------------------
     */

    /**
     * The network state has changed and the NetworkInfo object
     * contains the new state.
     *
     * msg.what = EVENT_STATE_CHANGED
     * msg.obj = NetworkInfo object
     */
    public static final int EVENT_STATE_CHANGED = 1;
=======
    // Share the event space with ConnectivityService (which we can't see, but
    // must send events to).  If you change these, change ConnectivityService
    // too.
    private static final int MIN_NETWORK_STATE_TRACKER_EVENT = 1;
    private static final int MAX_NETWORK_STATE_TRACKER_EVENT = 100;

    public static final int EVENT_STATE_CHANGED = 1;
    public static final int EVENT_SCAN_RESULTS_AVAILABLE = 2;
    /**
     * arg1: 1 to show, 0 to hide
     * arg2: ID of the notification
     * obj: Notification (if showing)
     */
    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 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;
    }
>>>>>>> 2d457a32a653ad06487cf0fef9ef400f3055099a

    /**
     * msg.what = EVENT_CONFIGURATION_CHANGED
Solution content
 */
public interface NetworkStateTracker {

    /**
     * -------------------------------------------------------------
     * Event Interface back to ConnectivityService.
     *
     * The events that are to be sent back to the Handler passed
     * to startMonitoring when the particular event occurs.
     * -------------------------------------------------------------
     */

    // Share the event space with ConnectivityService (which we can't see, but
    // must send events to).  If you change these, change ConnectivityService
    // too.
    static final int MIN_NETWORK_STATE_TRACKER_EVENT = 1;
    static final int MAX_NETWORK_STATE_TRACKER_EVENT = 100;

    /**
     * The network state has changed and the NetworkInfo object
     * contains the new state.
     *
     * msg.what = EVENT_STATE_CHANGED
     * msg.obj = NetworkInfo object
     */
    public static final int EVENT_STATE_CHANGED = 1;

    /**
     * msg.what = EVENT_CONFIGURATION_CHANGED
File
NetworkStateTracker.java
Developer's decision
Manual
Kind of conflict
Attribute
Comment
Method declaration
Chunk
Conflicting content
=======
                network.reconnect();
                return Phone.APN_REQUEST_STARTED;
            } else {
<<<<<<< HEAD
                return -1;
                synchronized(this) {
                    mFeatureUsers.add(f);
                }
                mHandler.sendMessageDelayed(mHandler.obtainMessage(EVENT_RESTORE_DEFAULT_NETWORK,
                        f), getRestoreDefaultNetworkDelay());

                return network.startUsingNetworkFeature(feature,
                        getCallingPid(), getCallingUid());
>>>>>>> 2d457a32a653ad06487cf0fef9ef400f3055099a
            }
        }
        return Phone.APN_TYPE_NOT_AVAILABLE;
Solution content
                network.reconnect();
                return Phone.APN_REQUEST_STARTED;
            } else {
                return -1;
            }
        }
        return Phone.APN_TYPE_NOT_AVAILABLE;
File
ConnectivityService.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Return statement
Synchronized statement
Chunk
Conflicting content
                {
                    type = info.getType();
                    handleDnsConfigurationChange(type);
                    break;
<<<<<<< HEAD
                case NetworkStateTracker.EVENT_RESTORE_DEFAULT_NETWORK:
                    FeatureUser u = (FeatureUser)msg.obj;
                    u.expire();
                    break;
                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");
                    }
                    break;
                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");
                    }
=======

                case NetworkStateTracker.EVENT_ROAMING_CHANGED:
                    // fill me in
                    break;

                case NetworkStateTracker.EVENT_NETWORK_SUBTYPE_CHANGED:
                    // fill me in
                    break;
                case EVENT_RESTORE_DEFAULT_NETWORK:
                    FeatureUser u = (FeatureUser)msg.obj;
                    u.expire();
                    break;
                case EVENT_INET_CONDITION_CHANGE:
                    int netType = msg.arg1;
                    int condition = msg.arg2;
                    handleInetConditionChange(netType, condition);
>>>>>>> 2d457a32a653ad06487cf0fef9ef400f3055099a
                    break;
                }
                case EVENT_INET_CONDITION_HOLD_END:
Solution content
                    type = info.getType();
                    handleDnsConfigurationChange(type);
                    break;
                case 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");
                    }
                    break;
                case EVENT_RESTORE_DEFAULT_NETWORK:
                    FeatureUser u = (FeatureUser)msg.obj;
                    u.expire();
                    break;
                case EVENT_INET_CONDITION_CHANGE:
                {
                    int netType = msg.arg1;
                    int condition = msg.arg2;
                    handleInetConditionChange(netType, condition);
                    break;
                }
                case EVENT_INET_CONDITION_HOLD_END:
File
ConnectivityService.java
Developer's decision
Manual
Kind of conflict
Attribute
Break statement
Case statement
Cast expression
Comment
If statement
Method invocation
Synchronized statement
Variable