Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 27a88a3e authored by Fyodor Kupolov's avatar Fyodor Kupolov Committed by Android (Google) Code Review
Browse files

Merge "Additional OP_READ_PHONE_STATE AppOps checks for telephony" into mnc-dev

parents a106554c 735e61b3
Loading
Loading
Loading
Loading
+12 −12
Original line number Original line Diff line number Diff line
@@ -667,7 +667,7 @@ public class TelephonyManager {
            IPhoneSubInfo info = getSubscriberInfo();
            IPhoneSubInfo info = getSubscriberInfo();
            if (info == null)
            if (info == null)
                return null;
                return null;
            return info.getDeviceSvnUsingSubId(subId[0]);
            return info.getDeviceSvnUsingSubId(subId[0], mContext.getOpPackageName());
        } catch (RemoteException ex) {
        } catch (RemoteException ex) {
            return null;
            return null;
        } catch (NullPointerException ex) {
        } catch (NullPointerException ex) {
@@ -744,7 +744,7 @@ public class TelephonyManager {
            IPhoneSubInfo info = getSubscriberInfo();
            IPhoneSubInfo info = getSubscriberInfo();
            if (info == null)
            if (info == null)
                return null;
                return null;
            return info.getImeiForSubscriber(subId[0]);
            return info.getImeiForSubscriber(subId[0], mContext.getOpPackageName());
        } catch (RemoteException ex) {
        } catch (RemoteException ex) {
            return null;
            return null;
        } catch (NullPointerException ex) {
        } catch (NullPointerException ex) {
@@ -773,7 +773,7 @@ public class TelephonyManager {
            IPhoneSubInfo info = getSubscriberInfo();
            IPhoneSubInfo info = getSubscriberInfo();
            if (info == null)
            if (info == null)
                return null;
                return null;
            String nai = info.getNaiForSubscriber(subId[0]);
            String nai = info.getNaiForSubscriber(subId[0], mContext.getOpPackageName());
            if (Log.isLoggable(TAG, Log.VERBOSE)) {
            if (Log.isLoggable(TAG, Log.VERBOSE)) {
                Rlog.v(TAG, "Nai = " + nai);
                Rlog.v(TAG, "Nai = " + nai);
            }
            }
@@ -1856,7 +1856,7 @@ public class TelephonyManager {
            IPhoneSubInfo info = getSubscriberInfo();
            IPhoneSubInfo info = getSubscriberInfo();
            if (info == null)
            if (info == null)
                return null;
                return null;
            return info.getIccSerialNumberForSubscriber(subId);
            return info.getIccSerialNumberForSubscriber(subId, mContext.getOpPackageName());
        } catch (RemoteException ex) {
        } catch (RemoteException ex) {
            return null;
            return null;
        } catch (NullPointerException ex) {
        } catch (NullPointerException ex) {
@@ -1938,7 +1938,7 @@ public class TelephonyManager {
            IPhoneSubInfo info = getSubscriberInfo();
            IPhoneSubInfo info = getSubscriberInfo();
            if (info == null)
            if (info == null)
                return null;
                return null;
            return info.getSubscriberIdForSubscriber(subId);
            return info.getSubscriberIdForSubscriber(subId, mContext.getOpPackageName());
        } catch (RemoteException ex) {
        } catch (RemoteException ex) {
            return null;
            return null;
        } catch (NullPointerException ex) {
        } catch (NullPointerException ex) {
@@ -1959,7 +1959,7 @@ public class TelephonyManager {
            IPhoneSubInfo info = getSubscriberInfo();
            IPhoneSubInfo info = getSubscriberInfo();
            if (info == null)
            if (info == null)
                return null;
                return null;
            return info.getGroupIdLevel1();
            return info.getGroupIdLevel1(mContext.getOpPackageName());
        } catch (RemoteException ex) {
        } catch (RemoteException ex) {
            return null;
            return null;
        } catch (NullPointerException ex) {
        } catch (NullPointerException ex) {
@@ -1983,7 +1983,7 @@ public class TelephonyManager {
            IPhoneSubInfo info = getSubscriberInfo();
            IPhoneSubInfo info = getSubscriberInfo();
            if (info == null)
            if (info == null)
                return null;
                return null;
            return info.getGroupIdLevel1ForSubscriber(subId);
            return info.getGroupIdLevel1ForSubscriber(subId, mContext.getOpPackageName());
        } catch (RemoteException ex) {
        } catch (RemoteException ex) {
            return null;
            return null;
        } catch (NullPointerException ex) {
        } catch (NullPointerException ex) {
@@ -2029,7 +2029,7 @@ public class TelephonyManager {
            IPhoneSubInfo info = getSubscriberInfo();
            IPhoneSubInfo info = getSubscriberInfo();
            if (info == null)
            if (info == null)
                return null;
                return null;
            return info.getLine1NumberForSubscriber(subId);
            return info.getLine1NumberForSubscriber(subId, mContext.getOpPackageName());
        } catch (RemoteException ex) {
        } catch (RemoteException ex) {
            return null;
            return null;
        } catch (NullPointerException ex) {
        } catch (NullPointerException ex) {
@@ -2122,7 +2122,7 @@ public class TelephonyManager {
            IPhoneSubInfo info = getSubscriberInfo();
            IPhoneSubInfo info = getSubscriberInfo();
            if (info == null)
            if (info == null)
                return null;
                return null;
            return info.getLine1AlphaTagForSubscriber(subId);
            return info.getLine1AlphaTagForSubscriber(subId, mContext.getOpPackageName());
        } catch (RemoteException ex) {
        } catch (RemoteException ex) {
            return null;
            return null;
        } catch (NullPointerException ex) {
        } catch (NullPointerException ex) {
@@ -2178,7 +2178,7 @@ public class TelephonyManager {
            IPhoneSubInfo info = getSubscriberInfo();
            IPhoneSubInfo info = getSubscriberInfo();
            if (info == null)
            if (info == null)
                return null;
                return null;
            return info.getMsisdnForSubscriber(subId);
            return info.getMsisdnForSubscriber(subId, mContext.getOpPackageName());
        } catch (RemoteException ex) {
        } catch (RemoteException ex) {
            return null;
            return null;
        } catch (NullPointerException ex) {
        } catch (NullPointerException ex) {
@@ -2211,7 +2211,7 @@ public class TelephonyManager {
            IPhoneSubInfo info = getSubscriberInfo();
            IPhoneSubInfo info = getSubscriberInfo();
            if (info == null)
            if (info == null)
                return null;
                return null;
            return info.getVoiceMailNumberForSubscriber(subId);
            return info.getVoiceMailNumberForSubscriber(subId, mContext.getOpPackageName());
        } catch (RemoteException ex) {
        } catch (RemoteException ex) {
            return null;
            return null;
        } catch (NullPointerException ex) {
        } catch (NullPointerException ex) {
@@ -2350,7 +2350,7 @@ public class TelephonyManager {
            IPhoneSubInfo info = getSubscriberInfo();
            IPhoneSubInfo info = getSubscriberInfo();
            if (info == null)
            if (info == null)
                return null;
                return null;
            return info.getVoiceMailAlphaTagForSubscriber(subId);
            return info.getVoiceMailAlphaTagForSubscriber(subId, mContext.getOpPackageName());
        } catch (RemoteException ex) {
        } catch (RemoteException ex) {
            return null;
            return null;
        } catch (NullPointerException ex) {
        } catch (NullPointerException ex) {
+21 −21
Original line number Original line Diff line number Diff line
@@ -25,12 +25,12 @@ interface IPhoneSubInfo {
    /**
    /**
     * Retrieves the unique device ID, e.g., IMEI for GSM phones.
     * Retrieves the unique device ID, e.g., IMEI for GSM phones.
     */
     */
    String getDeviceId();
    String getDeviceId(String callingPackage);


     /**
     /**
     * Retrieves the unique Network Access ID
     * Retrieves the unique Network Access ID
     */
     */
    String getNaiForSubscriber(int subId);
    String getNaiForSubscriber(int subId, String callingPackage);


    /**
    /**
     * Retrieves the unique device ID of a phone for the device, e.g., IMEI
     * Retrieves the unique device ID of a phone for the device, e.g., IMEI
@@ -41,91 +41,91 @@ interface IPhoneSubInfo {
    /**
    /**
     * Retrieves the IMEI.
     * Retrieves the IMEI.
     */
     */
    String getImeiForSubscriber(int subId);
    String getImeiForSubscriber(int subId, String callingPackage);


    /**
    /**
     * Retrieves the software version number for the device, e.g., IMEI/SV
     * Retrieves the software version number for the device, e.g., IMEI/SV
     * for GSM phones.
     * for GSM phones.
     */
     */
    String getDeviceSvn();
    String getDeviceSvn(String callingPackage);


    /**
    /**
     * Retrieves the software version number of a subId for the device, e.g., IMEI/SV
     * Retrieves the software version number of a subId for the device, e.g., IMEI/SV
     * for GSM phones.
     * for GSM phones.
     */
     */
    String getDeviceSvnUsingSubId(int subId);
    String getDeviceSvnUsingSubId(int subId, String callingPackage);


    /**
    /**
     * Retrieves the unique sbuscriber ID, e.g., IMSI for GSM phones.
     * Retrieves the unique sbuscriber ID, e.g., IMSI for GSM phones.
     */
     */
    String getSubscriberId();
    String getSubscriberId(String callingPackage);


    /**
    /**
     * Retrieves the unique subscriber ID of a given subId, e.g., IMSI for GSM phones.
     * Retrieves the unique subscriber ID of a given subId, e.g., IMSI for GSM phones.
     */
     */
    String getSubscriberIdForSubscriber(int subId);
    String getSubscriberIdForSubscriber(int subId, String callingPackage);


    /**
    /**
     * Retrieves the Group Identifier Level1 for GSM phones.
     * Retrieves the Group Identifier Level1 for GSM phones.
     */
     */
    String getGroupIdLevel1();
    String getGroupIdLevel1(String callingPackage);


    /**
    /**
     * Retrieves the Group Identifier Level1 for GSM phones of a subId.
     * Retrieves the Group Identifier Level1 for GSM phones of a subId.
     */
     */
    String getGroupIdLevel1ForSubscriber(int subId);
    String getGroupIdLevel1ForSubscriber(int subId, String callingPackage);


    /**
    /**
     * Retrieves the serial number of the ICC, if applicable.
     * Retrieves the serial number of the ICC, if applicable.
     */
     */
    String getIccSerialNumber();
    String getIccSerialNumber(String callingPackage);


    /**
    /**
     * Retrieves the serial number of a given subId.
     * Retrieves the serial number of a given subId.
     */
     */
    String getIccSerialNumberForSubscriber(int subId);
    String getIccSerialNumberForSubscriber(int subId, String callingPackage);


    /**
    /**
     * Retrieves the phone number string for line 1.
     * Retrieves the phone number string for line 1.
     */
     */
    String getLine1Number();
    String getLine1Number(String callingPackage);


    /**
    /**
     * Retrieves the phone number string for line 1 of a subcription.
     * Retrieves the phone number string for line 1 of a subcription.
     */
     */
    String getLine1NumberForSubscriber(int subId);
    String getLine1NumberForSubscriber(int subId, String callingPackage);




    /**
    /**
     * Retrieves the alpha identifier for line 1.
     * Retrieves the alpha identifier for line 1.
     */
     */
    String getLine1AlphaTag();
    String getLine1AlphaTag(String callingPackage);


    /**
    /**
     * Retrieves the alpha identifier for line 1 of a subId.
     * Retrieves the alpha identifier for line 1 of a subId.
     */
     */
    String getLine1AlphaTagForSubscriber(int subId);
    String getLine1AlphaTagForSubscriber(int subId, String callingPackage);




    /**
    /**
     * Retrieves MSISDN Number.
     * Retrieves MSISDN Number.
     */
     */
    String getMsisdn();
    String getMsisdn(String callingPackage);


    /**
    /**
     * Retrieves the Msisdn of a subId.
     * Retrieves the Msisdn of a subId.
     */
     */
    String getMsisdnForSubscriber(int subId);
    String getMsisdnForSubscriber(int subId, String callingPackage);


    /**
    /**
     * Retrieves the voice mail number.
     * Retrieves the voice mail number.
     */
     */
    String getVoiceMailNumber();
    String getVoiceMailNumber(String callingPackage);


    /**
    /**
     * Retrieves the voice mail number of a given subId.
     * Retrieves the voice mail number of a given subId.
     */
     */
    String getVoiceMailNumberForSubscriber(int subId);
    String getVoiceMailNumberForSubscriber(int subId, String callingPackage);


    /**
    /**
     * Retrieves the complete voice mail number.
     * Retrieves the complete voice mail number.
@@ -140,13 +140,13 @@ interface IPhoneSubInfo {
    /**
    /**
     * Retrieves the alpha identifier associated with the voice mail number.
     * Retrieves the alpha identifier associated with the voice mail number.
     */
     */
    String getVoiceMailAlphaTag();
    String getVoiceMailAlphaTag(String callingPackage);


    /**
    /**
     * Retrieves the alpha identifier associated with the voice mail number
     * Retrieves the alpha identifier associated with the voice mail number
     * of a subId.
     * of a subId.
     */
     */
    String getVoiceMailAlphaTagForSubscriber(int subId);
    String getVoiceMailAlphaTagForSubscriber(int subId, String callingPackage);


    /**
    /**
     * Returns the IMS private user identity (IMPI) that was loaded from the ISIM.
     * Returns the IMS private user identity (IMPI) that was loaded from the ISIM.