diff options
Diffstat (limited to 'telephony/java')
7 files changed, 88 insertions, 10 deletions
diff --git a/telephony/java/android/telephony/CellInfoLte.java b/telephony/java/android/telephony/CellInfoLte.java index 2f81b65..b0eb8f4 100644 --- a/telephony/java/android/telephony/CellInfoLte.java +++ b/telephony/java/android/telephony/CellInfoLte.java @@ -26,7 +26,7 @@ import android.util.Log; public final class CellInfoLte extends CellInfo implements Parcelable { private static final String LOG_TAG = "CellInfoLte"; - private static final boolean DBG = true; + private static final boolean DBG = false; private CellIdentityLte mCellIdentityLte; private CellSignalStrengthLte mCellSignalStrengthLte; diff --git a/telephony/java/android/telephony/NeighboringCellInfo.java b/telephony/java/android/telephony/NeighboringCellInfo.java index 0f9a3b9..51e1e95 100644 --- a/telephony/java/android/telephony/NeighboringCellInfo.java +++ b/telephony/java/android/telephony/NeighboringCellInfo.java @@ -25,8 +25,7 @@ import static android.telephony.TelephonyManager.NETWORK_TYPE_UMTS; import static android.telephony.TelephonyManager.NETWORK_TYPE_HSDPA; import static android.telephony.TelephonyManager.NETWORK_TYPE_HSUPA; import static android.telephony.TelephonyManager.NETWORK_TYPE_HSPA; - - +import static android.telephony.TelephonyManager.NETWORK_TYPE_HSPAP; /** * Represents the neighboring cell information, including @@ -108,7 +107,8 @@ public class NeighboringCellInfo implements Parcelable * {@link TelephonyManager#NETWORK_TYPE_UMTS TelephonyManager.NETWORK_TYPE_UMTS}, * {@link TelephonyManager#NETWORK_TYPE_HSDPA TelephonyManager.NETWORK_TYPE_HSDPA}, * {@link TelephonyManager#NETWORK_TYPE_HSUPA TelephonyManager.NETWORK_TYPE_HSUPA}, - * and {@link TelephonyManager#NETWORK_TYPE_HSPA TelephonyManager.NETWORK_TYPE_HSPA}. + * {@link TelephonyManager#NETWORK_TYPE_HSPA TelephonyManager.NETWORK_TYPE_HSPA}, + * and {@link TelephonyManager#NETWORK_TYPE_HSPAP TelephonyManager.NETWORK_TYPE_HSPAP}. */ public NeighboringCellInfo(int rssi, String location, int radioType) { // set default value @@ -143,6 +143,7 @@ public class NeighboringCellInfo implements Parcelable case NETWORK_TYPE_HSDPA: case NETWORK_TYPE_HSUPA: case NETWORK_TYPE_HSPA: + case NETWORK_TYPE_HSPAP: mNetworkType = radioType; mPsc = Integer.valueOf(location, 16); break; @@ -218,7 +219,8 @@ public class NeighboringCellInfo implements Parcelable * Return {@link TelephonyManager#NETWORK_TYPE_UMTS TelephonyManager.NETWORK_TYPE_UMTS}, * {@link TelephonyManager#NETWORK_TYPE_HSDPA TelephonyManager.NETWORK_TYPE_HSDPA}, * {@link TelephonyManager#NETWORK_TYPE_HSUPA TelephonyManager.NETWORK_TYPE_HSUPA}, - * or {@link TelephonyManager#NETWORK_TYPE_HSPA TelephonyManager.NETWORK_TYPE_HSPA} + * {@link TelephonyManager#NETWORK_TYPE_HSPA TelephonyManager.NETWORK_TYPE_HSPA}, + * or {@link TelephonyManager#NETWORK_TYPE_HSPAP TelephonyManager.NETWORK_TYPE_HSPAP} * means that Neighboring Cell information is stored for UMTS network, in * which {@link NeighboringCellInfo#getPsc NeighboringCellInfo.getPsc} * should be called to access location. diff --git a/telephony/java/android/telephony/SignalStrength.java b/telephony/java/android/telephony/SignalStrength.java index f998935..c063290 100644 --- a/telephony/java/android/telephony/SignalStrength.java +++ b/telephony/java/android/telephony/SignalStrength.java @@ -19,6 +19,7 @@ package android.telephony; import android.os.Bundle; import android.os.Parcel; import android.os.Parcelable; +import android.os.SystemProperties; import android.util.Log; /** @@ -342,7 +343,7 @@ public class SignalStrength implements Parcelable { mLteSignalStrength = (mLteSignalStrength >= 0) ? mLteSignalStrength : 99; mLteRsrp = ((mLteRsrp >= 44) && (mLteRsrp <= 140)) ? -mLteRsrp : SignalStrength.INVALID; mLteRsrq = ((mLteRsrq >= 3) && (mLteRsrq <= 20)) ? -mLteRsrq : SignalStrength.INVALID; - mLteRssnr = ((mLteRssnr >= -200) && (mLteRssnr <= 300)) ? mLteRssnr + mLteRssnr = ((mLteRssnr >= -200) && (mLteRssnr <= 300) && !(mLteRsrq == SignalStrength.INVALID && mLteRssnr == -1)) ? mLteRssnr : SignalStrength.INVALID; // Cqi no change if (DBG) log("Signal after validate=" + this); @@ -435,6 +436,16 @@ public class SignalStrength implements Parcelable { return mLteCqi; } + /** @hide */ + public boolean needsOldRilFeature(String feature) { + String[] features = SystemProperties.get("ro.telephony.ril.v3", "").split(","); + for (String found: features) { + if (found.equals(feature)) + return true; + } + return false; + } + /** * Get signal level as an int from 0..4 * @@ -444,8 +455,9 @@ public class SignalStrength implements Parcelable { int level; if (isGsm) { + boolean oldRil = needsOldRilFeature("signalstrength"); level = getLteLevel(); - if (level == SIGNAL_STRENGTH_NONE_OR_UNKNOWN) { + if (level == SIGNAL_STRENGTH_NONE_OR_UNKNOWN || oldRil) { level = getGsmLevel(); } } else { @@ -474,7 +486,8 @@ public class SignalStrength implements Parcelable { public int getAsuLevel() { int asuLevel; if (isGsm) { - if (getLteLevel() == SIGNAL_STRENGTH_NONE_OR_UNKNOWN) { + boolean oldRil = needsOldRilFeature("signalstrength"); + if (getLteLevel() == SIGNAL_STRENGTH_NONE_OR_UNKNOWN || oldRil) { asuLevel = getGsmAsuLevel(); } else { asuLevel = getLteAsuLevel(); @@ -506,7 +519,8 @@ public class SignalStrength implements Parcelable { int dBm; if(isGsm()) { - if (getLteLevel() == SIGNAL_STRENGTH_NONE_OR_UNKNOWN) { + boolean oldRil = needsOldRilFeature("signalstrength"); + if (getLteLevel() == SIGNAL_STRENGTH_NONE_OR_UNKNOWN || oldRil) { dBm = getGsmDbm(); } else { dBm = getLteDbm(); diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 2fa41e7..2f80d39 100755 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -377,6 +377,8 @@ public class TelephonyManager { case RILConstants.NETWORK_MODE_GSM_ONLY: case RILConstants.NETWORK_MODE_WCDMA_ONLY: case RILConstants.NETWORK_MODE_GSM_UMTS: + case RILConstants.NETWORK_MODE_LTE_GSM_WCDMA: + case RILConstants.NETWORK_MODE_LTE_WCDMA: return PhoneConstants.PHONE_TYPE_GSM; // Use CDMA Phone for the global mode including CDMA @@ -473,6 +475,15 @@ public class TelephonyManager { return retVal; } + /** + * Return if the current radio is LTE on GSM + * @hide + */ + public static int getLteOnGsmModeStatic() { + return SystemProperties.getInt(TelephonyProperties.PROPERTY_LTE_ON_GSM_DEVICE, + 0); + } + // // // Current Network @@ -596,6 +607,17 @@ public class TelephonyManager { } } + /** + * {@hide} + */ + public void toggleLTE(boolean on) { + try { + getITelephony().toggleLTE(on); + } catch (RemoteException e) { + //Silently fail + } + } + /** Unknown network class. {@hide} */ public static final int NETWORK_CLASS_UNKNOWN = 0; /** Class of broadly defined "2G" networks. {@hide} */ @@ -825,6 +847,21 @@ public class TelephonyManager { } } + /** + * Return if the current radio is LTE on GSM + * @hide + */ + public int getLteOnGsmMode() { + try { + return getITelephony().getLteOnGsmMode(); + } catch (RemoteException ex) { + return 0; + } catch (NullPointerException ex) { + // This could happen before phone restarts due to crashing + return 0; + } + } + // // // Subscriber Info diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl index 12a7286..9d1cc1d 100644 --- a/telephony/java/com/android/internal/telephony/ITelephony.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl @@ -45,6 +45,12 @@ interface ITelephony { void call(String number); /** + * Toggle between 3G and LTE (NT_MODE_CDMA, NT_MODE_GLOBAL) + * @param boolean to turn on and off LTE + */ + void toggleLTE(boolean on); + + /** * If there is currently a call in progress, show the call screen. * The DTMF dialpad may or may not be visible initially, depending on * whether it was up when the user last exited the InCallScreen. @@ -284,5 +290,7 @@ interface ITelephony { * Returns the all observed cell information of the device. */ List<CellInfo> getAllCellInfo(); + + int getLteOnGsmMode(); } diff --git a/telephony/java/com/android/internal/telephony/RILConstants.java b/telephony/java/com/android/internal/telephony/RILConstants.java index f501b21..d93da8f 100644 --- a/telephony/java/com/android/internal/telephony/RILConstants.java +++ b/telephony/java/com/android/internal/telephony/RILConstants.java @@ -72,7 +72,7 @@ public interface RILConstants { int NETWORK_MODE_LTE_GSM_WCDMA = 9; /* LTE, GSM/WCDMA */ int NETWORK_MODE_LTE_CMDA_EVDO_GSM_WCDMA = 10; /* LTE, CDMA, EvDo, GSM/WCDMA */ int NETWORK_MODE_LTE_ONLY = 11; /* LTE Only mode. */ - + int NETWORK_MODE_LTE_WCDMA = 12; /* LTE/WCDMA */ int PREFERRED_NETWORK_MODE = NETWORK_MODE_WCDMA_PREF; int CDMA_CELL_BROADCAST_SMS_DISABLED = 1; @@ -297,4 +297,5 @@ cat include/telephony/ril.h | \ int RIL_UNSOL_EXIT_EMERGENCY_CALLBACK_MODE = 1033; int RIL_UNSOL_RIL_CONNECTED = 1034; int RIL_UNSOL_VOICE_RADIO_TECH_CHANGED = 1035; + int RIL_UNSOL_STK_SEND_SMS_RESULT = 11002; /* Samsung STK */ } diff --git a/telephony/java/com/android/internal/telephony/TelephonyProperties.java b/telephony/java/com/android/internal/telephony/TelephonyProperties.java index f95e081..99c718f 100644 --- a/telephony/java/com/android/internal/telephony/TelephonyProperties.java +++ b/telephony/java/com/android/internal/telephony/TelephonyProperties.java @@ -88,6 +88,11 @@ public interface TelephonyProperties */ static final String PROPERTY_LTE_ON_CDMA_DEVICE = "telephony.lteOnCdmaDevice"; + /** + * {@see BaseCommands#getLteOnGsmMode()} + */ + static final String PROPERTY_LTE_ON_GSM_DEVICE = "telephony.lteOnGsmDevice"; + static final String CURRENT_ACTIVE_PHONE = "gsm.current.phone-type"; //****** SIM Card @@ -187,4 +192,15 @@ public interface TelephonyProperties * Ignore RIL_UNSOL_NITZ_TIME_RECEIVED completely, used for debugging/testing. */ static final String PROPERTY_IGNORE_NITZ = "telephony.test.ignore.nitz"; + + /** + * Set to true to indicates support for simultaneous voice and data. + */ + static final String PROPERTY_SVDATA = "ro.config.svlte1x"; + + /** + * Property to control alpha ID display for proactive commands + * Type: boolean ( true = alpha display enabled, false = alpha display disabled) + */ + static final String PROPERTY_ALPHA_USRCNF = "persist.atel.noalpha.usrcnf"; } |