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

Commit 7d0dbe69 authored by Brad Ebinger's avatar Brad Ebinger
Browse files

Actually check for READ_PHONE_STATE permission for Voicemail query

We were not checking READ_PHONE_STATE permission when callers
were querying for the number of voicemails the user had for a
subscription.

Removes old ITelephony#getVoiceMessageCount method from graylist
because it hasn't been used since kitkat and does not allow for
READ_PHONE_STATE permission checks.

Bug: 119884553
Test: manual
Change-Id: Ic6c29b123e192caf663d0e0c8da559116d1a78c9
parent 818a6e70
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -3209,7 +3209,6 @@ Lcom/android/internal/telephony/ITelephony;->getCallState()I
Lcom/android/internal/telephony/ITelephony;->getDataActivity()I
Lcom/android/internal/telephony/ITelephony;->getDataState()I
Lcom/android/internal/telephony/ITelephony;->getNetworkType()I
Lcom/android/internal/telephony/ITelephony;->getVoiceMessageCount()I
Lcom/android/internal/telephony/ITelephony;->handlePinMmi(Ljava/lang/String;)Z
Lcom/android/internal/telephony/ITelephony;->handlePinMmiForSubscriber(ILjava/lang/String;)Z
Lcom/android/internal/telephony/ITelephony;->hasIccCard()Z
+3 −2
Original line number Diff line number Diff line
@@ -4192,7 +4192,8 @@ public class TelephonyManager {
    }

    /**
     * Returns the voice mail count for a subscription. Return 0 if unavailable.
     * Returns the voice mail count for a subscription. Return 0 if unavailable or the caller does
     * not have the READ_PHONE_STATE permission.
     * @param subId whose voice message count is returned
     * @hide
     */
@@ -4203,7 +4204,7 @@ public class TelephonyManager {
            ITelephony telephony = getITelephony();
            if (telephony == null)
                return 0;
            return telephony.getVoiceMessageCountForSubscriber(subId);
            return telephony.getVoiceMessageCountForSubscriber(subId, getOpPackageName());
        } catch (RemoteException ex) {
            return 0;
        } catch (NullPointerException ex) {
+1 −6
Original line number Diff line number Diff line
@@ -392,17 +392,12 @@ interface ITelephony {
      */
    int getDataActivationState(int subId, String callingPackage);

    /**
      * Returns the unread count of voicemails
      */
    int getVoiceMessageCount();

    /**
     * Returns the unread count of voicemails for a subId.
     * @param subId user preferred subId.
     * Returns the unread count of voicemails
     */
    int getVoiceMessageCountForSubscriber(int subId);
    int getVoiceMessageCountForSubscriber(int subId, String callingPackage);

    /**
      * Returns true if current state supports both voice and data