Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 02722fbd authored by Wink Saville's avatar Wink Saville
Browse files

Convert DataConnection to an HSM and rename PdpConnection to GsmDataConnection.

Change-Id: Ia834022d04e65c42d671f63b2fec46804fe8a562
parent 1d2f5c39
Loading
Loading
Loading
Loading
+590 −122

File changed.

Preview size limit exceeded, changes collapsed.

+0 −40
Original line number Diff line number Diff line
/*
 * Copyright (C) 2006 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.internal.telephony;

import android.os.Handler;
import android.os.Registrant;

/**
 * Base class representing the data link layer (eg, PPP).
 *
 * {@hide}
 */
public abstract class DataLink extends Handler implements DataLinkInterface {

    /** Registrant for link status change notifications. */
    protected Registrant mLinkChangeRegistrant;
    protected DataConnectionTracker dataConnection;

    protected DataLink(DataConnectionTracker dc) {
        dataConnection = dc;
    }

    public void setOnLinkChange(Handler h, int what, Object obj) {
        mLinkChangeRegistrant = new Registrant(h, what, obj);
    }
}
+0 −77
Original line number Diff line number Diff line
/*
 * Copyright (C) 2006 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.internal.telephony;

import android.database.Cursor;
import android.os.Handler;

/**
 * Data link interface.
 *
 * {@hide}
 */
public interface DataLinkInterface {
    /**
     * Link state enumeration.
     *
     */
    enum LinkState {
        LINK_UNKNOWN,
        LINK_UP,
        LINK_DOWN,
        LINK_EXITED
    }

    /** Normal exit */
    final static int EXIT_OK = 0;
    /** Open failed */
    final static int EXIT_OPEN_FAILED = 7;

    /**
     * Sets the handler for link state change events.
     *
     * @param h Handler
     * @param what User-defined message code
     * @param obj User object
     */
    void setOnLinkChange(Handler h, int what, Object obj);

    /**
     * Sets up the data link.
     */
    void connect();

    /**
     * Tears down the data link.
     */
    void disconnect();

    /**
     * Returns the exit code for a data link failure.
     *
     * @return exit code
     */
    int getLastLinkExitCode();

    /**
     * Sets password information that may be required by the data link
     * (eg, PAP secrets).
     *
     * @param cursor cursor to carriers table
     */
    void setPasswordInfo(Cursor cursor);
}
+3 −25
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ import android.telephony.SignalStrength;

import com.android.internal.telephony.DataConnection;
import com.android.internal.telephony.gsm.NetworkInfo;
import com.android.internal.telephony.gsm.PdpConnection;
import com.android.internal.telephony.gsm.GsmDataConnection;
import com.android.internal.telephony.test.SimulatedRadioControl;

import java.util.List;
@@ -1176,21 +1176,7 @@ public interface Phone {
    void invokeOemRilRequestStrings(String[] strings, Message response);

    /**
     * Get the current active PDP context list
     *
     * @deprecated
     * @param response <strong>On success</strong>, "response" bytes is
     * made available as:
     * (String[])(((AsyncResult)response.obj).result).
     * <strong>On failure</strong>,
     * (((AsyncResult)response.obj).result) == null and
     * (((AsyncResult)response.obj).exception) being an instance of
     * com.android.internal.telephony.gsm.CommandException
     */
    void getPdpContextList(Message response);

    /**
     * Get the current active Data Call list, substitutes getPdpContextList
     * Get the current active Data Call list
     *
     * @param response <strong>On success</strong>, "response" bytes is
     * made available as:
@@ -1202,14 +1188,6 @@ public interface Phone {
     */
    void getDataCallList(Message response);

    /**
     * Get current mutiple PDP link status
     *
     * @deprecated
     * @return list of pdp link connections
     */
    List<PdpConnection> getCurrentPdpList ();

    /**
     * Get current mutiple data connection status
     *
+1 −11
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ import android.text.TextUtils;
import android.util.Log;

import com.android.internal.R;
import com.android.internal.telephony.gsm.PdpConnection;
import com.android.internal.telephony.gsm.GsmDataConnection;
import com.android.internal.telephony.test.SimulatedRadioControl;

import java.util.List;
@@ -692,16 +692,6 @@ public abstract class PhoneBase extends Handler implements Phone {
        Log.e(LOG_TAG, "Error! This function should never be executed, inactive CDMAPhone.");
    }

    /**
     * This should only be called in GSM mode.
     * Only here for some backward compatibility
     * issues concerning the GSMPhone class.
     * @deprecated Always returns null.
     */
    public List<PdpConnection> getCurrentPdpList() {
        return null;
    }

    public void enableEnhancedVoicePrivacy(boolean enable, Message onComplete) {
        // This function should be overridden by the class CDMAPhone. Not implemented in GSMPhone.
        Log.e(LOG_TAG, "Error! This function should never be executed, inactive CDMAPhone.");
Loading