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

Commit 33567c5f authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge change 23271 into eclair

* changes:
  Cleanup egregious style issues.
parents 650cbfd3 00416365
Loading
Loading
Loading
Loading
+25 −39
Original line number Diff line number Diff line
@@ -28,20 +28,9 @@ import android.telephony.SignalStrength;
 * {@hide}
 */
public abstract class ServiceStateTracker extends Handler {

    /**
     *  The access technology currently in use:
     *  0 = unknown
     *  1 = GPRS only
     *  2 = EDGE
     *  3 = UMTS
     *  4 = IS95A
     *  5 = IS95B
     *  6 = 1xRTT
     *  7 = EvDo_0
     *  8 = EvDo_A
     *  9 = HSDPA
     *  10 = HSUPA
     *  11 = HSPA
     *  Access technology currently in use.
     */
    protected static final int DATA_ACCESS_UNKNOWN = 0;
    protected static final int DATA_ACCESS_GPRS = 1;
@@ -55,7 +44,6 @@ public abstract class ServiceStateTracker extends Handler {
    protected static final int DATA_ACCESS_HSDPA = 9;
    protected static final int DATA_ACCESS_HSUPA = 10;
    protected static final int DATA_ACCESS_HSPA = 11;
    //***** Instance Variables

    protected CommandsInterface cm;

@@ -64,33 +52,36 @@ public abstract class ServiceStateTracker extends Handler {

    public SignalStrength mSignalStrength;

    // Used as a unique identifier to track requests associated with a poll
    // and ignore stale responses.The value is a count-down of expected responses
    // in this pollingContext
    /**
     * A unique identifier to track requests associated with a poll
     * and ignore stale responses.  The value is a count-down of
     * expected responses in this pollingContext.
     */
    protected int[] pollingContext;
    protected boolean mDesiredPowerState;

    protected boolean dontPollSignalStrength = false; // Default is to poll strength
    // If we're getting unsolicited signal strength updates from the radio,
    // set value to true and don't bother polling any more
    /**
     * By default, strength polling is enabled.  However, if we're
     * getting unsolicited signal strength updates from the radio, set
     * value to true and don't bother polling any more.
     */
    protected boolean dontPollSignalStrength = false;

    protected RegistrantList networkAttachedRegistrants = new RegistrantList();
    protected RegistrantList roamingOnRegistrants = new RegistrantList();
    protected RegistrantList roamingOffRegistrants = new RegistrantList();

    //***** Constants

    protected  static final boolean DBG = true;

    // signal strength poll rate
    /** Signal strength poll rate. */
    protected static final int POLL_PERIOD_MILLIS = 20 * 1000;

    // waiting period before recheck gprs and voice registration
    /** Waiting period before recheck gprs and voice registration. */
    public static final int DEFAULT_GPRS_CHECK_PERIOD_MILLIS = 60 * 1000;

    public static final int DATA_STATE_POLL_SLEEP_MS = 100;

    //*****GSM events
    /** GSM events */
    protected static final int EVENT_RADIO_STATE_CHANGED               = 1;
    protected static final int EVENT_NETWORK_STATE_CHANGED             = 2;
    protected static final int EVENT_GET_SIGNAL_STRENGTH               = 3;
@@ -112,7 +103,7 @@ public abstract class ServiceStateTracker extends Handler {
    protected static final int EVENT_CHECK_REPORT_GPRS                 = 22;
    protected static final int EVENT_RESTRICTED_STATE_CHANGED          = 23;

    //*****CDMA events:
    /** CDMA events */
    protected static final int EVENT_POLL_STATE_REGISTRATION_CDMA      = 24;
    protected static final int EVENT_POLL_STATE_OPERATOR_CDMA          = 25;
    protected static final int EVENT_RUIM_READY                        = 26;
@@ -129,13 +120,14 @@ public abstract class ServiceStateTracker extends Handler {
    protected static final int EVENT_OTA_PROVISION_STATUS_CHANGE       = 37;
    protected static final int EVENT_SET_RADIO_POWER_OFF               = 38;

    //***** Time Zones
    protected static final String TIMEZONE_PROPERTY = "persist.sys.timezone";

    // List of ISO codes for countries that can have an offset of GMT+0
    // when not in daylight savings time.  This ignores some small places
    // such as the Canary Islands (Spain) and Danmarkshavn (Denmark).
    // The list must be sorted by code.
    /**
     * List of ISO codes for countries that can have an offset of
     * GMT+0 when not in daylight savings time.  This ignores some
     * small places such as the Canary Islands (Spain) and
     * Danmarkshavn (Denmark).  The list must be sorted by code.
    */
    protected static final String[] GMT_COUNTRY_CODES = {
        "bf", // Burkina Faso
        "ci", // Cote d'Ivoire
@@ -159,11 +151,10 @@ public abstract class ServiceStateTracker extends Handler {
        "uk", // U.K
    };

    //***** Registration denied reason
    /** Reason for registration denial. */
    protected static final String REGISTRATION_DENIED_GEN  = "General";
    protected static final String REGISTRATION_DENIED_AUTH = "Authentication Failure";

    //***** Constructors
    public ServiceStateTracker() {

    }
@@ -228,8 +219,6 @@ public abstract class ServiceStateTracker extends Handler {
                obtainMessage(EVENT_GET_PREFERRED_NETWORK_TYPE, onComplete));
    }


    //***** Called from Phone
    public void
    setRadioPower(boolean power) {
        mDesiredPowerState = power;
@@ -237,7 +226,6 @@ public abstract class ServiceStateTracker extends Handler {
        setPowerStateToDesired();
    }


    public void enableLocationUpdates() {
        cm.setLocationUpdates(true, obtainMessage(EVENT_LOCATION_UPDATES_ENABLED));
    }
@@ -246,17 +234,15 @@ public abstract class ServiceStateTracker extends Handler {
        cm.setLocationUpdates(false, null);
    }

    //***** Overridden from Handler
    public abstract void handleMessage(Message msg);

    //***** Protected abstract Methods
    protected abstract void handlePollStateResult(int what, AsyncResult ar);
    protected abstract void updateSpnDisplay();
    protected abstract void setPowerStateToDesired();

    /** Cancel a pending (if any) pollState() operation */
    protected void cancelPollState() {
        // This will effectively cancel the rest of the poll requests
        // This will effectively cancel the rest of the poll requests.
        pollingContext = new int[1];
    }
}
+70 −82

File changed.

Preview size limit exceeded, changes collapsed.

+71 −98

File changed.

Preview size limit exceeded, changes collapsed.