Merge "Refactor Cell Location public API." into jb-mr1-dev
diff --git a/api/current.txt b/api/current.txt
index 8e0dff5..e72dd85 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -20637,66 +20637,65 @@
 
 package android.telephony {
 
-  public abstract class CellIdentity implements android.os.Parcelable {
+  public final class CellIdentityCdma implements android.os.Parcelable {
     method public int describeContents();
-    method public abstract int hashCode();
-    method public void writeToParcel(android.os.Parcel, int);
-    field public static final android.os.Parcelable.Creator CREATOR;
-  }
-
-  public final class CellIdentityCdma extends android.telephony.CellIdentity implements android.os.Parcelable {
     method public int getBasestationId();
     method public int getLatitude();
     method public int getLongitude();
     method public int getNetworkId();
     method public int getSystemId();
-    method public int hashCode();
+    method public void writeToParcel(android.os.Parcel, int);
     field public static final android.os.Parcelable.Creator CREATOR;
   }
 
-  public final class CellIdentityGsm extends android.telephony.CellIdentity implements android.os.Parcelable {
+  public final class CellIdentityGsm implements android.os.Parcelable {
+    method public int describeContents();
     method public int getCid();
     method public int getLac();
     method public int getMcc();
     method public int getMnc();
     method public int getPsc();
-    method public int hashCode();
+    method public void writeToParcel(android.os.Parcel, int);
     field public static final android.os.Parcelable.Creator CREATOR;
   }
 
-  public final class CellIdentityLte extends android.telephony.CellIdentity implements android.os.Parcelable {
+  public final class CellIdentityLte implements android.os.Parcelable {
+    method public int describeContents();
     method public int getCi();
     method public int getMcc();
     method public int getMnc();
     method public int getPci();
     method public int getTac();
-    method public int hashCode();
+    method public void writeToParcel(android.os.Parcel, int);
     field public static final android.os.Parcelable.Creator CREATOR;
   }
 
-  public class CellInfo implements android.os.Parcelable {
+  public abstract class CellInfo implements android.os.Parcelable {
     method public int describeContents();
     method public long getTimeStamp();
     method public boolean isRegistered();
-    method public void writeToParcel(android.os.Parcel, int);
+    method public abstract void writeToParcel(android.os.Parcel, int);
     field public static final android.os.Parcelable.Creator CREATOR;
   }
 
   public final class CellInfoCdma extends android.telephony.CellInfo implements android.os.Parcelable {
     method public android.telephony.CellIdentityCdma getCellIdentity();
     method public android.telephony.CellSignalStrengthCdma getCellSignalStrength();
+    method public void writeToParcel(android.os.Parcel, int);
     field public static final android.os.Parcelable.Creator CREATOR;
   }
 
   public final class CellInfoGsm extends android.telephony.CellInfo implements android.os.Parcelable {
     method public android.telephony.CellIdentityGsm getCellIdentity();
     method public android.telephony.CellSignalStrengthGsm getCellSignalStrength();
+    method public void writeToParcel(android.os.Parcel, int);
     field public static final android.os.Parcelable.Creator CREATOR;
   }
 
   public final class CellInfoLte extends android.telephony.CellInfo implements android.os.Parcelable {
     method public android.telephony.CellIdentityLte getCellIdentity();
     method public android.telephony.CellSignalStrengthLte getCellSignalStrength();
+    method public void writeToParcel(android.os.Parcel, int);
     field public static final android.os.Parcelable.Creator CREATOR;
   }
 
@@ -20706,18 +20705,16 @@
     method public static void requestLocationUpdate();
   }
 
-  public abstract class CellSignalStrength implements android.os.Parcelable {
-    method public int describeContents();
+  public abstract class CellSignalStrength {
     method public abstract boolean equals(java.lang.Object);
     method public abstract int getAsuLevel();
     method public abstract int getDbm();
     method public abstract int getLevel();
     method public abstract int hashCode();
-    method public abstract void writeToParcel(android.os.Parcel, int);
-    field public static final android.os.Parcelable.Creator CREATOR;
   }
 
-  public class CellSignalStrengthCdma extends android.telephony.CellSignalStrength implements android.os.Parcelable {
+  public final class CellSignalStrengthCdma extends android.telephony.CellSignalStrength implements android.os.Parcelable {
+    method public int describeContents();
     method public boolean equals(java.lang.Object);
     method public int getAsuLevel();
     method public int getCdmaDbm();
@@ -20734,7 +20731,8 @@
     field public static final android.os.Parcelable.Creator CREATOR;
   }
 
-  public class CellSignalStrengthGsm extends android.telephony.CellSignalStrength implements android.os.Parcelable {
+  public final class CellSignalStrengthGsm extends android.telephony.CellSignalStrength implements android.os.Parcelable {
+    method public int describeContents();
     method public boolean equals(java.lang.Object);
     method public int getAsuLevel();
     method public int getDbm();
@@ -20744,7 +20742,8 @@
     field public static final android.os.Parcelable.Creator CREATOR;
   }
 
-  public class CellSignalStrengthLte extends android.telephony.CellSignalStrength implements android.os.Parcelable {
+  public final class CellSignalStrengthLte extends android.telephony.CellSignalStrength implements android.os.Parcelable {
+    method public int describeContents();
     method public boolean equals(java.lang.Object);
     method public int getAsuLevel();
     method public int getDbm();
diff --git a/telephony/java/android/telephony/CellIdentity.java b/telephony/java/android/telephony/CellIdentity.java
deleted file mode 100644
index a3f7860..0000000
--- a/telephony/java/android/telephony/CellIdentity.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright (C) 2012 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 android.telephony;
-
-import android.os.Parcel;
-import android.os.Parcelable;
-
-/**
- * CellIdentity is immutable and represents ONE unique cell in the world
- * it contains all levels of info to identity country, carrier, etc.
- */
-public abstract class CellIdentity implements Parcelable {
-
-    // Type fields for parceling
-    /** @hide */
-    protected static final int TYPE_GSM = 1;
-    /** @hide */
-    protected static final int TYPE_CDMA = 2;
-    /** @hide */
-    protected static final int TYPE_LTE = 3;
-
-    /** @hide */
-    protected CellIdentity() {
-    }
-
-    /** @hide */
-    protected CellIdentity(Parcel in) {
-    }
-
-    /** @hide */
-    protected CellIdentity(CellIdentity cid) {
-    }
-
-    /**
-     * @return a copy of this object with package visibility.
-     */
-    abstract CellIdentity copy();
-
-    @Override
-    public abstract int hashCode();
-
-    @Override
-    public boolean equals(Object other) {
-        if (other == null) {
-            return false;
-        }
-        if (this == other) {
-            return true;
-        }
-        return (other instanceof CellIdentity);
-    }
-
-    @Override
-    public String toString() {
-        return "";
-    }
-
-    /** Implement the Parcelable interface */
-    @Override
-    public int describeContents() {
-        return 0;
-    }
-
-    /** Implement the Parcelable interface */
-    @Override
-    public void writeToParcel(Parcel dest, int flags) {
-    }
-
-    /** Implement the Parcelable interface */
-    public static final Creator<CellIdentity> CREATOR =
-            new Creator<CellIdentity>() {
-        @Override
-        public CellIdentity createFromParcel(Parcel in) {
-            int type = in.readInt();
-            switch (type) {
-                case TYPE_GSM: return CellIdentityGsm.createFromParcelBody(in);
-                case TYPE_CDMA: return CellIdentityCdma.createFromParcelBody(in);
-                case TYPE_LTE: return CellIdentityLte.createFromParcelBody(in);
-                default: throw new RuntimeException("Bad CellIdentity Parcel");
-            }
-        }
-
-        @Override
-        public CellIdentity[] newArray(int size) {
-            return new CellIdentity[size];
-        }
-    };
-}
diff --git a/telephony/java/android/telephony/CellIdentityCdma.java b/telephony/java/android/telephony/CellIdentityCdma.java
index fccf98c..9579b91 100644
--- a/telephony/java/android/telephony/CellIdentityCdma.java
+++ b/telephony/java/android/telephony/CellIdentityCdma.java
@@ -23,7 +23,7 @@
 /**
  * CellIdentity is to represent a unique CDMA cell
  */
-public final class CellIdentityCdma extends CellIdentity implements Parcelable {
+public final class CellIdentityCdma implements Parcelable {
 
     private static final String LOG_TAG = "CellSignalStrengthCdma";
     private static final boolean DBG = false;
@@ -81,7 +81,6 @@
     }
 
     private CellIdentityCdma(CellIdentityCdma cid) {
-        super(cid);
         mNetworkId = cid.mNetworkId;
         mSystemId = cid.mSystemId;
         mBasestationId = cid.mBasestationId;
@@ -89,7 +88,6 @@
         mLatitude = cid.mLatitude;
     }
 
-    @Override
     CellIdentityCdma copy() {
         return new CellIdentityCdma(this);
     }
@@ -185,8 +183,6 @@
     @Override
     public void writeToParcel(Parcel dest, int flags) {
         if (DBG) log("writeToParcel(Parcel, int): " + toString());
-        dest.writeInt(TYPE_CDMA);
-        super.writeToParcel(dest, flags);
         dest.writeInt(mNetworkId);
         dest.writeInt(mSystemId);
         dest.writeInt(mBasestationId);
@@ -196,7 +192,6 @@
 
     /** Construct from Parcel, type has already been processed */
     private CellIdentityCdma(Parcel in) {
-        super(in);
         mNetworkId = in.readInt();
         mSystemId = in.readInt();
         mBasestationId = in.readInt();
@@ -211,8 +206,7 @@
             new Creator<CellIdentityCdma>() {
         @Override
         public CellIdentityCdma createFromParcel(Parcel in) {
-            in.readInt(); // Skip past token, we know what it is
-            return createFromParcelBody(in);
+            return new CellIdentityCdma(in);
         }
 
         @Override
@@ -221,11 +215,6 @@
         }
     };
 
-    /** @hide */
-    static CellIdentityCdma createFromParcelBody(Parcel in) {
-        return new CellIdentityCdma(in);
-    }
-
     /**
      * log
      */
diff --git a/telephony/java/android/telephony/CellIdentityGsm.java b/telephony/java/android/telephony/CellIdentityGsm.java
index dead049..21cb790 100644
--- a/telephony/java/android/telephony/CellIdentityGsm.java
+++ b/telephony/java/android/telephony/CellIdentityGsm.java
@@ -23,7 +23,7 @@
 /**
  * CellIdentity to represent a unique GSM or UMTS cell
  */
-public final class CellIdentityGsm extends CellIdentity implements Parcelable {
+public final class CellIdentityGsm implements Parcelable {
 
     private static final String LOG_TAG = "CellIdentityGsm";
     private static final boolean DBG = false;
@@ -69,7 +69,6 @@
     }
 
     private CellIdentityGsm(CellIdentityGsm cid) {
-        super(cid);
         mMcc = cid.mMcc;
         mMnc = cid.mMnc;
         mLac = cid.mLac;
@@ -77,7 +76,6 @@
         mPsc = cid.mPsc;
     }
 
-    @Override
     CellIdentityGsm copy() {
        return new CellIdentityGsm(this);
     }
@@ -170,8 +168,6 @@
     @Override
     public void writeToParcel(Parcel dest, int flags) {
         if (DBG) log("writeToParcel(Parcel, int): " + toString());
-        dest.writeInt(TYPE_GSM);
-        super.writeToParcel(dest, flags);
         dest.writeInt(mMcc);
         dest.writeInt(mMnc);
         dest.writeInt(mLac);
@@ -181,7 +177,6 @@
 
     /** Construct from Parcel, type has already been processed */
     private CellIdentityGsm(Parcel in) {
-        super(in);
         mMcc = in.readInt();
         mMnc = in.readInt();
         mLac = in.readInt();
@@ -196,8 +191,7 @@
             new Creator<CellIdentityGsm>() {
         @Override
         public CellIdentityGsm createFromParcel(Parcel in) {
-            in.readInt(); // Skip past token, we know what it is
-            return createFromParcelBody(in);
+            return new CellIdentityGsm(in);
         }
 
         @Override
@@ -206,11 +200,6 @@
         }
     };
 
-    /** @hide */
-    static CellIdentityGsm createFromParcelBody(Parcel in) {
-        return new CellIdentityGsm(in);
-    }
-
     /**
      * log
      */
diff --git a/telephony/java/android/telephony/CellIdentityLte.java b/telephony/java/android/telephony/CellIdentityLte.java
index 832cbe1..ad822bb 100644
--- a/telephony/java/android/telephony/CellIdentityLte.java
+++ b/telephony/java/android/telephony/CellIdentityLte.java
@@ -23,7 +23,7 @@
 /**
  * CellIdentity is to represent a unique LTE cell
  */
-public final class CellIdentityLte extends CellIdentity implements Parcelable {
+public final class CellIdentityLte implements Parcelable {
 
     private static final String LOG_TAG = "CellIdentityLte";
     private static final boolean DBG = false;
@@ -69,7 +69,6 @@
     }
 
     private CellIdentityLte(CellIdentityLte cid) {
-        super(cid);
         mMcc = cid.mMcc;
         mMnc = cid.mMnc;
         mCi = cid.mCi;
@@ -77,7 +76,6 @@
         mTac = cid.mTac;
     }
 
-    @Override
     CellIdentityLte copy() {
         return new CellIdentityLte(this);
     }
@@ -165,8 +163,6 @@
     @Override
     public void writeToParcel(Parcel dest, int flags) {
         if (DBG) log("writeToParcel(Parcel, int): " + toString());
-        dest.writeInt(TYPE_LTE);
-        super.writeToParcel(dest, flags);
         dest.writeInt(mMcc);
         dest.writeInt(mMnc);
         dest.writeInt(mCi);
@@ -176,7 +172,6 @@
 
     /** Construct from Parcel, type has already been processed */
     private CellIdentityLte(Parcel in) {
-        super(in);
         mMcc = in.readInt();
         mMnc = in.readInt();
         mCi = in.readInt();
@@ -191,8 +186,7 @@
             new Creator<CellIdentityLte>() {
         @Override
         public CellIdentityLte createFromParcel(Parcel in) {
-            in.readInt(); // Skip past token, we know what it is
-            return createFromParcelBody(in);
+            return new CellIdentityLte(in);
         }
 
         @Override
@@ -201,11 +195,6 @@
         }
     };
 
-    /** @hide */
-    static CellIdentityLte createFromParcelBody(Parcel in) {
-        return new CellIdentityLte(in);
-    }
-
     /**
      * log
      */
diff --git a/telephony/java/android/telephony/CellInfo.java b/telephony/java/android/telephony/CellInfo.java
index 1946b5d..f367f99 100644
--- a/telephony/java/android/telephony/CellInfo.java
+++ b/telephony/java/android/telephony/CellInfo.java
@@ -22,7 +22,7 @@
 /**
  * Immutable cell information from a point in time.
  */
-public class CellInfo implements Parcelable {
+public abstract class CellInfo implements Parcelable {
 
     // Type fields for parceling
     /** @hide */
@@ -157,7 +157,9 @@
         return sb.toString();
     }
 
-    /** Implement the Parcelable interface */
+    /**
+     * Implement the Parcelable interface
+     */
     @Override
     public int describeContents() {
         return 0;
@@ -165,13 +167,25 @@
 
     /** Implement the Parcelable interface */
     @Override
-    public void writeToParcel(Parcel dest, int flags) {
+    public abstract void writeToParcel(Parcel dest, int flags);
+
+    /**
+     * Used by child classes for parceling.
+     *
+     * @hide
+     */
+    protected void writeToParcel(Parcel dest, int flags, int type) {
+        dest.writeInt(type);
         dest.writeInt(mRegistered ? 1 : 0);
         dest.writeInt(mTimeStampType);
         dest.writeLong(mTimeStamp);
     }
 
-    /** @hide */
+    /**
+     * Used by child classes for parceling
+     *
+     * @hide
+     */
     protected CellInfo(Parcel in) {
         mRegistered = (in.readInt() == 1) ? true : false;
         mTimeStampType = in.readInt();
diff --git a/telephony/java/android/telephony/CellInfoCdma.java b/telephony/java/android/telephony/CellInfoCdma.java
index 1c41ba4..ea48e2e 100644
--- a/telephony/java/android/telephony/CellInfoCdma.java
+++ b/telephony/java/android/telephony/CellInfoCdma.java
@@ -104,9 +104,7 @@
     /** Implement the Parcelable interface */
     @Override
     public void writeToParcel(Parcel dest, int flags) {
-        if (DBG) log("writeToParcel(Parcel, int): " + toString());
-        dest.writeInt(TYPE_LTE);
-        super.writeToParcel(dest, flags);
+        super.writeToParcel(dest, flags, TYPE_CDMA);
         mCellIdentityCdma.writeToParcel(dest, flags);
         mCellSignalStrengthCdma.writeToParcel(dest, flags);
     }
diff --git a/telephony/java/android/telephony/CellInfoGsm.java b/telephony/java/android/telephony/CellInfoGsm.java
index c644cb3..bd14d45 100644
--- a/telephony/java/android/telephony/CellInfoGsm.java
+++ b/telephony/java/android/telephony/CellInfoGsm.java
@@ -104,8 +104,7 @@
     /** Implement the Parcelable interface */
     @Override
     public void writeToParcel(Parcel dest, int flags) {
-        dest.writeInt(TYPE_LTE);
-        super.writeToParcel(dest, flags);
+        super.writeToParcel(dest, flags, TYPE_GSM);
         mCellIdentityGsm.writeToParcel(dest, flags);
         mCellSignalStrengthGsm.writeToParcel(dest, flags);
     }
diff --git a/telephony/java/android/telephony/CellInfoLte.java b/telephony/java/android/telephony/CellInfoLte.java
index 8921db2..2f81b65 100644
--- a/telephony/java/android/telephony/CellInfoLte.java
+++ b/telephony/java/android/telephony/CellInfoLte.java
@@ -26,7 +26,7 @@
 public final class CellInfoLte extends CellInfo implements Parcelable {
 
     private static final String LOG_TAG = "CellInfoLte";
-    private static final boolean DBG = false;
+    private static final boolean DBG = true;
 
     private CellIdentityLte mCellIdentityLte;
     private CellSignalStrengthLte mCellSignalStrengthLte;
@@ -46,18 +46,22 @@
     }
 
     public CellIdentityLte getCellIdentity() {
+        if (DBG) log("getCellIdentity: " + mCellIdentityLte);
         return mCellIdentityLte;
     }
     /** @hide */
     public void setCellIdentity(CellIdentityLte cid) {
+        if (DBG) log("setCellIdentity: " + cid);
         mCellIdentityLte = cid;
     }
 
     public CellSignalStrengthLte getCellSignalStrength() {
+        if (DBG) log("getCellSignalStrength: " + mCellSignalStrengthLte);
         return mCellSignalStrengthLte;
     }
     /** @hide */
     public void setCellSignalStrength(CellSignalStrengthLte css) {
+        if (DBG) log("setCellSignalStrength: " + css);
         mCellSignalStrengthLte = css;
     }
 
@@ -105,8 +109,7 @@
     @Override
     public void writeToParcel(Parcel dest, int flags) {
         if (DBG) log("writeToParcel(Parcel, int): " + toString());
-        dest.writeInt(TYPE_LTE);
-        super.writeToParcel(dest, flags);
+        super.writeToParcel(dest, flags, TYPE_LTE);
         mCellIdentityLte.writeToParcel(dest, flags);
         mCellSignalStrengthLte.writeToParcel(dest, flags);
     }
diff --git a/telephony/java/android/telephony/CellSignalStrength.java b/telephony/java/android/telephony/CellSignalStrength.java
index 581efc2..3b470fc 100644
--- a/telephony/java/android/telephony/CellSignalStrength.java
+++ b/telephony/java/android/telephony/CellSignalStrength.java
@@ -22,16 +22,7 @@
 /**
  * Abstract base class for cell phone signal strength related information.
  */
-public abstract class CellSignalStrength implements Parcelable {
-
-    // Type fields for parceling
-    /** @hide */
-    protected static final int TYPE_GSM = 1;
-    /** @hide */
-    protected static final int TYPE_CDMA = 2;
-    /** @hide */
-    protected static final int TYPE_LTE = 3;
-
+public abstract class CellSignalStrength {
 
     /** @hide */
     public static final int SIGNAL_STRENGTH_NONE_OR_UNKNOWN = 0;
@@ -85,34 +76,4 @@
 
     @Override
     public abstract boolean equals (Object o);
-
-    /** Implement the Parcelable interface */
-    @Override
-    public int describeContents() {
-        return 0;
-    }
-
-    /** Implement the Parcelable interface */
-    @Override
-    public abstract void writeToParcel(Parcel dest, int flags);
-
-    /** Implement the Parcelable interface */
-    public static final Creator<CellSignalStrength> CREATOR =
-            new Creator<CellSignalStrength>() {
-        @Override
-        public CellSignalStrength createFromParcel(Parcel in) {
-            int type = in.readInt();
-            switch (type) {
-                case TYPE_GSM: return CellSignalStrengthGsm.createFromParcelBody(in);
-                case TYPE_CDMA: return CellSignalStrengthCdma.createFromParcelBody(in);
-                case TYPE_LTE: return CellSignalStrengthLte.createFromParcelBody(in);
-                default: throw new RuntimeException("Bad CellSignalStrength Parcel");
-            }
-        }
-
-        @Override
-        public CellSignalStrength[] newArray(int size) {
-            return new CellSignalStrength[size];
-        }
-    };
 }
diff --git a/telephony/java/android/telephony/CellSignalStrengthCdma.java b/telephony/java/android/telephony/CellSignalStrengthCdma.java
index 3912629..660326c 100644
--- a/telephony/java/android/telephony/CellSignalStrengthCdma.java
+++ b/telephony/java/android/telephony/CellSignalStrengthCdma.java
@@ -23,7 +23,7 @@
 /**
  * LTE signal strength related information.
  */
-public class CellSignalStrengthCdma extends CellSignalStrength implements Parcelable {
+public final class CellSignalStrengthCdma extends CellSignalStrength implements Parcelable {
 
     private static final String LOG_TAG = "CellSignalStrengthCdma";
     private static final boolean DBG = false;
@@ -331,7 +331,6 @@
     @Override
     public void writeToParcel(Parcel dest, int flags) {
         if (DBG) log("writeToParcel(Parcel, int): " + toString());
-        dest.writeInt(CellSignalStrength.TYPE_CDMA);
         dest.writeInt(mCdmaDbm);
         dest.writeInt(mCdmaEcio);
         dest.writeInt(mEvdoDbm);
@@ -364,10 +363,7 @@
             new Parcelable.Creator<CellSignalStrengthCdma>() {
         @Override
         public CellSignalStrengthCdma createFromParcel(Parcel in) {
-            if (in.readInt() != CellSignalStrength.TYPE_CDMA) {
-                throw new RuntimeException("Expecting TYPE_CDMA");
-            }
-            return createFromParcelBody(in);
+            return new CellSignalStrengthCdma(in);
         }
 
         @Override
@@ -376,11 +372,6 @@
         }
     };
 
-    /** @hide */
-    public static CellSignalStrengthCdma createFromParcelBody(Parcel in) {
-        return new CellSignalStrengthCdma(in);
-    }
-
     /**
      * log
      */
diff --git a/telephony/java/android/telephony/CellSignalStrengthGsm.java b/telephony/java/android/telephony/CellSignalStrengthGsm.java
index 30b444b..4108f61 100644
--- a/telephony/java/android/telephony/CellSignalStrengthGsm.java
+++ b/telephony/java/android/telephony/CellSignalStrengthGsm.java
@@ -23,7 +23,7 @@
 /**
  * LTE signal strength related information.
  */
-public class CellSignalStrengthGsm extends CellSignalStrength implements Parcelable {
+public final class CellSignalStrengthGsm extends CellSignalStrength implements Parcelable {
 
     private static final String LOG_TAG = "CellSignalStrengthGsm";
     private static final boolean DBG = false;
@@ -190,7 +190,6 @@
     @Override
     public void writeToParcel(Parcel dest, int flags) {
         if (DBG) log("writeToParcel(Parcel, int): " + toString());
-        dest.writeInt(CellSignalStrength.TYPE_GSM);
         dest.writeInt(mSignalStrength);
         dest.writeInt(mBitErrorRate);
     }
@@ -217,10 +216,7 @@
             new Parcelable.Creator<CellSignalStrengthGsm>() {
         @Override
         public CellSignalStrengthGsm createFromParcel(Parcel in) {
-            if (in.readInt() != CellSignalStrength.TYPE_GSM) {
-                throw new RuntimeException("Expecting TYPE_GSM");
-            }
-            return createFromParcelBody(in);
+            return new CellSignalStrengthGsm(in);
         }
 
         @Override
@@ -229,11 +225,6 @@
         }
     };
 
-    /** @hide */
-    public static CellSignalStrengthGsm createFromParcelBody(Parcel in) {
-        return new CellSignalStrengthGsm(in);
-    }
-
     /**
      * log
      */
diff --git a/telephony/java/android/telephony/CellSignalStrengthLte.java b/telephony/java/android/telephony/CellSignalStrengthLte.java
index 7a4d626..925f4d4 100644
--- a/telephony/java/android/telephony/CellSignalStrengthLte.java
+++ b/telephony/java/android/telephony/CellSignalStrengthLte.java
@@ -23,7 +23,7 @@
 /**
  * LTE signal strength related information.
  */
-public class CellSignalStrengthLte extends CellSignalStrength implements Parcelable {
+public final class CellSignalStrengthLte extends CellSignalStrength implements Parcelable {
 
     private static final String LOG_TAG = "CellSignalStrengthLte";
     private static final boolean DBG = false;
@@ -246,7 +246,6 @@
     @Override
     public void writeToParcel(Parcel dest, int flags) {
         if (DBG) log("writeToParcel(Parcel, int): " + toString());
-        dest.writeInt(CellSignalStrength.TYPE_LTE);
         dest.writeInt(mSignalStrength);
         dest.writeInt(mRsrp);
         dest.writeInt(mRsrq);
@@ -281,10 +280,7 @@
             new Parcelable.Creator<CellSignalStrengthLte>() {
         @Override
         public CellSignalStrengthLte createFromParcel(Parcel in) {
-            if (in.readInt() != CellSignalStrength.TYPE_LTE) {
-                throw new RuntimeException("Expecting TYPE_LTE");
-            }
-            return createFromParcelBody(in);
+            return new CellSignalStrengthLte(in);
         }
 
         @Override
@@ -293,11 +289,6 @@
         }
     };
 
-    /** @hide */
-    public static CellSignalStrengthLte createFromParcelBody(Parcel in) {
-        return new CellSignalStrengthLte(in);
-    }
-
     /**
      * log
      */