From afa16001a8b97c298c89a3c9e24cce6608660f83 Mon Sep 17 00:00:00 2001 From: Robert Greenwalt Date: Fri, 4 Dec 2015 11:51:49 -0800 Subject: [PATCH] Check permissions on getDeviceId. This needs the package name passed in, so the aidl changes. bug:25778215 Change-Id: I9e5ff24c630e11a047f884e52b0b39f870c18e1d --- telephony/java/android/telephony/TelephonyManager.java | 4 ++-- .../java/com/android/internal/telephony/IPhoneSubInfo.aidl | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 3b281e222bd80..0b5aaa3b273b2 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -766,7 +766,7 @@ public class TelephonyManager { IPhoneSubInfo info = getSubscriberInfo(); if (info == null) return null; - return info.getDeviceIdForPhone(slotId); + return info.getDeviceIdForPhone(slotId, mContext.getOpPackageName()); } catch (RemoteException ex) { return null; } catch (NullPointerException ex) { @@ -4865,4 +4865,4 @@ public class TelephonyManager { } return null; } -} \ No newline at end of file +} diff --git a/telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl b/telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl index ed85392dd4d75..dc2b297f6dbe5 100644 --- a/telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl +++ b/telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl @@ -36,7 +36,7 @@ interface IPhoneSubInfo { * Retrieves the unique device ID of a phone for the device, e.g., IMEI * for GSM phones. */ - String getDeviceIdForPhone(int phoneId); + String getDeviceIdForPhone(int phoneId, String callingPackage); /** * Retrieves the IMEI.