diff options
author | Wink Saville <wink@google.com> | 2012-07-17 11:14:28 -0700 |
---|---|---|
committer | Wink Saville <wink@google.com> | 2012-07-18 11:45:31 -0700 |
commit | ef1d4bff9bbf7d967dbcace73f08910e14e367d0 (patch) | |
tree | 4629096d476757e3ec2f0c4879cdedb5de6d1a15 /src/java/com/android/internal/telephony/PhoneBase.java | |
parent | 013125a96b1e6f46eed507c65bce65ebfec60b6d (diff) | |
download | frameworks_opt_telephony-ef1d4bff9bbf7d967dbcace73f08910e14e367d0.zip frameworks_opt_telephony-ef1d4bff9bbf7d967dbcace73f08910e14e367d0.tar.gz frameworks_opt_telephony-ef1d4bff9bbf7d967dbcace73f08910e14e367d0.tar.bz2 |
Revise CellInfo API's
Change-Id: I35bc22caf4a6a2255f2ce122690823f8d602b359
Diffstat (limited to 'src/java/com/android/internal/telephony/PhoneBase.java')
-rw-r--r-- | src/java/com/android/internal/telephony/PhoneBase.java | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/src/java/com/android/internal/telephony/PhoneBase.java b/src/java/com/android/internal/telephony/PhoneBase.java index b55240a..6613dee 100644 --- a/src/java/com/android/internal/telephony/PhoneBase.java +++ b/src/java/com/android/internal/telephony/PhoneBase.java @@ -32,7 +32,9 @@ import android.os.RegistrantList; import android.os.SystemProperties; import android.preference.PreferenceManager; import android.provider.Settings; +import android.telephony.CellInfo; import android.telephony.ServiceState; +import android.telephony.SignalStrength; import android.text.TextUtils; import android.util.Log; @@ -44,6 +46,7 @@ import com.android.internal.telephony.gsm.SIMRecords; import java.io.FileDescriptor; import java.io.PrintWriter; +import java.util.List; import java.util.Locale; import java.util.concurrent.atomic.AtomicReference; @@ -189,9 +192,10 @@ public abstract class PhoneBase extends Handler implements Phone { /** * Constructs a PhoneBase in normal (non-unit test) mode. * - * @param context Context object from hosting application * @param notifier An instance of DefaultPhoneNotifier, + * @param context Context object from hosting application * unless unit testing. + * @param ci the CommandsInterface */ protected PhoneBase(PhoneNotifier notifier, Context context, CommandsInterface ci) { this(notifier, context, ci, false); @@ -200,9 +204,10 @@ public abstract class PhoneBase extends Handler implements Phone { /** * Constructs a PhoneBase in normal (non-unit test) mode. * - * @param context Context object from hosting application * @param notifier An instance of DefaultPhoneNotifier, + * @param context Context object from hosting application * unless unit testing. + * @param ci is CommandsInterface * @param unitTestMode when true, prevents notifications * of state change events */ @@ -675,6 +680,14 @@ public abstract class PhoneBase extends Handler implements Phone { return mIccRecords.getRecordsLoaded(); } + /** + * @return all available cell information or null if none. + */ + @Override + public List<CellInfo> getAllCellInfo() { + return getServiceStateTracker().getAllCellInfo(); + } + @Override public boolean getMessageWaitingIndicator() { return mIccRecords.getVoiceMessageWaiting(); @@ -693,6 +706,19 @@ public abstract class PhoneBase extends Handler implements Phone { } /** + * Get the signal strength + */ + @Override + public SignalStrength getSignalStrength() { + ServiceStateTracker sst = getServiceStateTracker(); + if (sst == null) { + return new SignalStrength(); + } else { + return sst.getSignalStrength(); + } + } + + /** * Set the status of the CDMA roaming preference */ public void setCdmaRoamingPreference(int cdmaRoamingType, Message response) { @@ -792,6 +818,14 @@ public abstract class PhoneBase extends Handler implements Phone { mNotifier.notifyOtaspChanged(this, otaspMode); } + public void notifySignalStrength() { + mNotifier.notifySignalStrength(this); + } + + public void notifyCellInfo(List<CellInfo> cellInfo) { + mNotifier.notifyCellInfo(this, cellInfo); + } + /** * @return true if a mobile originating emergency call is active */ |