Do not merge. Return null id 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
This commit is contained in:
@@ -192,6 +192,10 @@ public class TelephonyManager {
|
|||||||
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
|
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
|
||||||
*/
|
*/
|
||||||
public String getDeviceId() {
|
public String getDeviceId() {
|
||||||
|
if (!isVoiceCapable()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return getSubscriberInfo().getDeviceId();
|
return getSubscriberInfo().getDeviceId();
|
||||||
} catch (RemoteException ex) {
|
} catch (RemoteException ex) {
|
||||||
|
|||||||
Reference in New Issue
Block a user