diff options
author | John Wang <johnwang@google.com> | 2011-06-07 15:37:09 -0700 |
---|---|---|
committer | John Wang <johnwang@google.com> | 2011-06-07 15:37:09 -0700 |
commit | e19736f0520689747b9e703a40b5f574bd9a7fce (patch) | |
tree | f86cf0e8c42e9d5cbd34a84be97dda270c68d6b6 /telephony | |
parent | 0f7b3f8ba5c2f0b8f96e072bd866c9fb374ebdeb (diff) | |
download | frameworks_base-e19736f0520689747b9e703a40b5f574bd9a7fce.zip frameworks_base-e19736f0520689747b9e703a40b5f574bd9a7fce.tar.gz frameworks_base-e19736f0520689747b9e703a40b5f574bd9a7fce.tar.bz2 |
Make getDeviceId return null for Non-phone device.
For non-phone device, i.e. tablet doesn't have voice capability,
getDeviceId returns null while getPhoneType returns PHONE_TYPE_NONE.
This behavior is suggested by developer scheme
http://android-developers.blogspot.com/2011/03/identifying-app-installations.html
and enforced by CTS testGetDeviceId.
bug:4464907
Change-Id: Iaa3832b7323a50deccd438cb884c8e776a7a9640
Diffstat (limited to 'telephony')
-rw-r--r-- | telephony/java/android/telephony/TelephonyManager.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 8732e21..7aa9a25 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -191,6 +191,10 @@ public class TelephonyManager { * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} */ public String getDeviceId() { + if (!isVoiceCapable()) { + return null; + } + try { return getSubscriberInfo().getDeviceId(); } catch (RemoteException ex) { |