Add calling package parameter to IRcs methods

This will be used for permission handling in the IRcs service.

Test: Existing tests pass, both unit and RcsCtsTestCases
Change-Id: I7f2183cd2f764b8293d29dc2c278479e06d9d8a2
Merged-In: I7f2183cd2f764b8293d29dc2c278479e06d9d8a2
Bug: 123699565
(cherry picked from commit 995c9ad44d8daa34e56eb30bade92f372f1e3394)
diff --git a/telephony/java/android/telephony/ims/Rcs1To1Thread.java b/telephony/java/android/telephony/ims/Rcs1To1Thread.java
index 39e9789b..e90548a 100644
--- a/telephony/java/android/telephony/ims/Rcs1To1Thread.java
+++ b/telephony/java/android/telephony/ims/Rcs1To1Thread.java
@@ -56,7 +56,9 @@
      */
     @WorkerThread
     public long getFallbackThreadId() throws RcsMessageStoreException {
-        return mRcsControllerCall.call(iRcs -> iRcs.get1To1ThreadFallbackThreadId(mThreadId));
+        return mRcsControllerCall.call(
+                (iRcs, callingPackage) -> iRcs.get1To1ThreadFallbackThreadId(mThreadId,
+                        callingPackage));
     }
 
     /**
@@ -70,7 +72,8 @@
     @WorkerThread
     public void setFallbackThreadId(long fallbackThreadId) throws RcsMessageStoreException {
         mRcsControllerCall.callWithNoReturn(
-                iRcs -> iRcs.set1To1ThreadFallbackThreadId(mThreadId, fallbackThreadId));
+                (iRcs, callingPackage) -> iRcs.set1To1ThreadFallbackThreadId(mThreadId,
+                        fallbackThreadId, callingPackage));
     }
 
     /**
@@ -82,6 +85,8 @@
     public RcsParticipant getRecipient() throws RcsMessageStoreException {
         return new RcsParticipant(
                 mRcsControllerCall,
-                mRcsControllerCall.call(iRcs -> iRcs.get1To1ThreadOtherParticipantId(mThreadId)));
+                mRcsControllerCall.call(
+                        (iRcs, callingPackage) -> iRcs.get1To1ThreadOtherParticipantId(mThreadId,
+                                callingPackage)));
     }
 }
diff --git a/telephony/java/android/telephony/ims/RcsControllerCall.java b/telephony/java/android/telephony/ims/RcsControllerCall.java
index 3bd441e..a2d68ad 100644
--- a/telephony/java/android/telephony/ims/RcsControllerCall.java
+++ b/telephony/java/android/telephony/ims/RcsControllerCall.java
@@ -40,7 +40,7 @@
         }
 
         try {
-            return serviceCall.methodOnIRcs(iRcs);
+            return serviceCall.methodOnIRcs(iRcs, mContext.getOpPackageName());
         } catch (RemoteException exception) {
             throw new RcsMessageStoreException(exception.getMessage());
         }
@@ -48,17 +48,17 @@
 
     void callWithNoReturn(RcsServiceCallWithNoReturn serviceCall)
             throws RcsMessageStoreException {
-        call(iRcs -> {
-            serviceCall.methodOnIRcs(iRcs);
+        call((iRcs, callingPackage) -> {
+            serviceCall.methodOnIRcs(iRcs, callingPackage);
             return null;
         });
     }
 
     interface RcsServiceCall<R> {
-        R methodOnIRcs(IRcs iRcs) throws RemoteException;
+        R methodOnIRcs(IRcs iRcs, String callingPackage) throws RemoteException;
     }
 
     interface RcsServiceCallWithNoReturn {
-        void methodOnIRcs(IRcs iRcs) throws RemoteException;
+        void methodOnIRcs(IRcs iRcs, String callingPackage) throws RemoteException;
     }
 }
diff --git a/telephony/java/android/telephony/ims/RcsFileTransferPart.java b/telephony/java/android/telephony/ims/RcsFileTransferPart.java
index 9926658..ef66a76 100644
--- a/telephony/java/android/telephony/ims/RcsFileTransferPart.java
+++ b/telephony/java/android/telephony/ims/RcsFileTransferPart.java
@@ -137,7 +137,9 @@
      */
     @WorkerThread
     public void setFileTransferSessionId(String sessionId) throws RcsMessageStoreException {
-        mRcsControllerCall.callWithNoReturn(iRcs -> iRcs.setFileTransferSessionId(mId, sessionId));
+        mRcsControllerCall.callWithNoReturn(
+                (iRcs, callingPackage) -> iRcs.setFileTransferSessionId(mId, sessionId,
+                        callingPackage));
     }
 
     /**
@@ -146,7 +148,8 @@
      */
     @WorkerThread
     public String getFileTransferSessionId() throws RcsMessageStoreException {
-        return mRcsControllerCall.call(iRcs -> iRcs.getFileTransferSessionId(mId));
+        return mRcsControllerCall.call(
+                (iRcs, callingPackage) -> iRcs.getFileTransferSessionId(mId, callingPackage));
     }
 
     /**
@@ -159,7 +162,8 @@
     @WorkerThread
     public void setContentUri(Uri contentUri) throws RcsMessageStoreException {
         mRcsControllerCall.callWithNoReturn(
-                iRcs -> iRcs.setFileTransferContentUri(mId, contentUri));
+                (iRcs, callingPackage) -> iRcs.setFileTransferContentUri(mId, contentUri,
+                        callingPackage));
     }
 
     /**
@@ -169,7 +173,8 @@
     @Nullable
     @WorkerThread
     public Uri getContentUri() throws RcsMessageStoreException {
-        return mRcsControllerCall.call(iRcs -> iRcs.getFileTransferContentUri(mId));
+        return mRcsControllerCall.call(
+                (iRcs, callingPackage) -> iRcs.getFileTransferContentUri(mId, callingPackage));
     }
 
     /**
@@ -182,7 +187,8 @@
     @WorkerThread
     public void setContentMimeType(String contentMimeType) throws RcsMessageStoreException {
         mRcsControllerCall.callWithNoReturn(
-                iRcs -> iRcs.setFileTransferContentType(mId, contentMimeType));
+                (iRcs, callingPackage) -> iRcs.setFileTransferContentType(mId, contentMimeType,
+                        callingPackage));
     }
 
     /**
@@ -192,7 +198,8 @@
     @WorkerThread
     @Nullable
     public String getContentMimeType() throws RcsMessageStoreException {
-        return mRcsControllerCall.call(iRcs -> iRcs.getFileTransferContentType(mId));
+        return mRcsControllerCall.call(
+                (iRcs, callingPackage) -> iRcs.getFileTransferContentType(mId, callingPackage));
     }
 
     /**
@@ -204,7 +211,8 @@
     @WorkerThread
     public void setFileSize(long contentLength) throws RcsMessageStoreException {
         mRcsControllerCall.callWithNoReturn(
-                iRcs -> iRcs.setFileTransferFileSize(mId, contentLength));
+                (iRcs, callingPackage) -> iRcs.setFileTransferFileSize(mId, contentLength,
+                        callingPackage));
     }
 
     /**
@@ -213,7 +221,8 @@
      */
     @WorkerThread
     public long getFileSize() throws RcsMessageStoreException {
-        return mRcsControllerCall.call(iRcs -> iRcs.getFileTransferFileSize(mId));
+        return mRcsControllerCall.call(
+                (iRcs, callingPackage) -> iRcs.getFileTransferFileSize(mId, callingPackage));
     }
 
     /**
@@ -227,7 +236,8 @@
     @WorkerThread
     public void setTransferOffset(long transferOffset) throws RcsMessageStoreException {
         mRcsControllerCall.callWithNoReturn(
-                iRcs -> iRcs.setFileTransferTransferOffset(mId, transferOffset));
+                (iRcs, callingPackage) -> iRcs.setFileTransferTransferOffset(mId, transferOffset,
+                        callingPackage));
     }
 
     /**
@@ -236,7 +246,8 @@
      */
     @WorkerThread
     public long getTransferOffset() throws RcsMessageStoreException {
-        return mRcsControllerCall.call(iRcs -> iRcs.getFileTransferTransferOffset(mId));
+        return mRcsControllerCall.call(
+                (iRcs, callingPackage) -> iRcs.getFileTransferTransferOffset(mId, callingPackage));
     }
 
     /**
@@ -248,7 +259,8 @@
     @WorkerThread
     public void setFileTransferStatus(@RcsFileTransferStatus int status)
             throws RcsMessageStoreException {
-        mRcsControllerCall.callWithNoReturn(iRcs -> iRcs.setFileTransferStatus(mId, status));
+        mRcsControllerCall.callWithNoReturn(
+                (iRcs, callingPackage) -> iRcs.setFileTransferStatus(mId, status, callingPackage));
     }
 
     /**
@@ -257,7 +269,8 @@
      */
     @WorkerThread
     public @RcsFileTransferStatus int getFileTransferStatus() throws RcsMessageStoreException {
-        return mRcsControllerCall.call(iRcs -> iRcs.getFileTransferStatus(mId));
+        return mRcsControllerCall.call(
+                (iRcs, callingPackage) -> iRcs.getFileTransferStatus(mId, callingPackage));
     }
 
     /**
@@ -266,7 +279,8 @@
      */
     @WorkerThread
     public int getWidth() throws RcsMessageStoreException {
-        return mRcsControllerCall.call(iRcs -> iRcs.getFileTransferWidth(mId));
+        return mRcsControllerCall.call(
+                (iRcs, callingPackage) -> iRcs.getFileTransferWidth(mId, callingPackage));
     }
 
     /**
@@ -277,7 +291,8 @@
      */
     @WorkerThread
     public void setWidth(int width) throws RcsMessageStoreException {
-        mRcsControllerCall.callWithNoReturn(iRcs -> iRcs.setFileTransferWidth(mId, width));
+        mRcsControllerCall.callWithNoReturn(
+                (iRcs, callingPackage) -> iRcs.setFileTransferWidth(mId, width, callingPackage));
     }
 
     /**
@@ -286,7 +301,8 @@
      */
     @WorkerThread
     public int getHeight() throws RcsMessageStoreException {
-        return mRcsControllerCall.call(iRcs -> iRcs.getFileTransferHeight(mId));
+        return mRcsControllerCall.call(
+                (iRcs, callingPackage) -> iRcs.getFileTransferHeight(mId, callingPackage));
     }
 
     /**
@@ -297,7 +313,8 @@
      */
     @WorkerThread
     public void setHeight(int height) throws RcsMessageStoreException {
-        mRcsControllerCall.callWithNoReturn(iRcs -> iRcs.setFileTransferHeight(mId, height));
+        mRcsControllerCall.callWithNoReturn(
+                (iRcs, callingPackage) -> iRcs.setFileTransferHeight(mId, height, callingPackage));
     }
 
     /**
@@ -306,7 +323,8 @@
      */
     @WorkerThread
     public long getLength() throws RcsMessageStoreException {
-        return mRcsControllerCall.call(iRcs -> iRcs.getFileTransferLength(mId));
+        return mRcsControllerCall.call(
+                (iRcs, callingPackage) -> iRcs.getFileTransferLength(mId, callingPackage));
     }
 
     /**
@@ -317,7 +335,8 @@
      */
     @WorkerThread
     public void setLength(long length) throws RcsMessageStoreException {
-        mRcsControllerCall.callWithNoReturn(iRcs -> iRcs.setFileTransferLength(mId, length));
+        mRcsControllerCall.callWithNoReturn(
+                (iRcs, callingPackage) -> iRcs.setFileTransferLength(mId, length, callingPackage));
     }
 
     /**
@@ -327,7 +346,8 @@
      */
     @WorkerThread
     public Uri getPreviewUri() throws RcsMessageStoreException {
-        return mRcsControllerCall.call(iRcs -> iRcs.getFileTransferPreviewUri(mId));
+        return mRcsControllerCall.call(
+                (iRcs, callingPackage) -> iRcs.getFileTransferPreviewUri(mId, callingPackage));
     }
 
     /**
@@ -339,7 +359,8 @@
     @WorkerThread
     public void setPreviewUri(Uri previewUri) throws RcsMessageStoreException {
         mRcsControllerCall.callWithNoReturn(
-                iRcs -> iRcs.setFileTransferPreviewUri(mId, previewUri));
+                (iRcs, callingPackage) -> iRcs.setFileTransferPreviewUri(mId, previewUri,
+                        callingPackage));
     }
 
     /**
@@ -348,7 +369,8 @@
      */
     @WorkerThread
     public String getPreviewMimeType() throws RcsMessageStoreException {
-        return mRcsControllerCall.call(iRcs -> iRcs.getFileTransferPreviewType(mId));
+        return mRcsControllerCall.call(
+                (iRcs, callingPackage) -> iRcs.getFileTransferPreviewType(mId, callingPackage));
     }
 
     /**
@@ -360,6 +382,7 @@
     @WorkerThread
     public void setPreviewMimeType(String previewMimeType) throws RcsMessageStoreException {
         mRcsControllerCall.callWithNoReturn(
-                iRcs -> iRcs.setFileTransferPreviewType(mId, previewMimeType));
+                (iRcs, callingPackage) -> iRcs.setFileTransferPreviewType(mId, previewMimeType,
+                        callingPackage));
     }
 }
diff --git a/telephony/java/android/telephony/ims/RcsGroupThread.java b/telephony/java/android/telephony/ims/RcsGroupThread.java
index 0482f57..30abcb4 100644
--- a/telephony/java/android/telephony/ims/RcsGroupThread.java
+++ b/telephony/java/android/telephony/ims/RcsGroupThread.java
@@ -58,7 +58,8 @@
     @Nullable
     @WorkerThread
     public String getGroupName() throws RcsMessageStoreException {
-        return mRcsControllerCall.call(iRcs -> iRcs.getGroupThreadName(mThreadId));
+        return mRcsControllerCall.call(
+                (iRcs, callingPackage) -> iRcs.getGroupThreadName(mThreadId, callingPackage));
     }
 
     /**
@@ -69,7 +70,9 @@
      */
     @WorkerThread
     public void setGroupName(String groupName) throws RcsMessageStoreException {
-        mRcsControllerCall.callWithNoReturn(iRcs -> iRcs.setGroupThreadName(mThreadId, groupName));
+        mRcsControllerCall.callWithNoReturn(
+                (iRcs, callingPackage) -> iRcs.setGroupThreadName(mThreadId, groupName,
+                        callingPackage));
     }
 
     /**
@@ -79,7 +82,8 @@
      */
     @Nullable
     public Uri getGroupIcon() throws RcsMessageStoreException {
-        return mRcsControllerCall.call(iRcs -> iRcs.getGroupThreadIcon(mThreadId));
+        return mRcsControllerCall.call(
+                (iRcs, callingPackage) -> iRcs.getGroupThreadIcon(mThreadId, callingPackage));
     }
 
     /**
@@ -90,7 +94,9 @@
      */
     @WorkerThread
     public void setGroupIcon(@Nullable Uri groupIcon) throws RcsMessageStoreException {
-        mRcsControllerCall.callWithNoReturn(iRcs -> iRcs.setGroupThreadIcon(mThreadId, groupIcon));
+        mRcsControllerCall.callWithNoReturn(
+                (iRcs, callingPackage) -> iRcs.setGroupThreadIcon(mThreadId, groupIcon,
+                        callingPackage));
     }
 
     /**
@@ -102,7 +108,9 @@
     public RcsParticipant getOwner() throws RcsMessageStoreException {
         return new RcsParticipant(
                 mRcsControllerCall,
-                mRcsControllerCall.call(iRcs -> iRcs.getGroupThreadOwner(mThreadId)));
+                mRcsControllerCall.call(
+                        (iRcs, callingPackage) -> iRcs.getGroupThreadOwner(mThreadId,
+                                callingPackage)));
     }
 
     /**
@@ -116,7 +124,8 @@
     @WorkerThread
     public void setOwner(@Nullable RcsParticipant participant) throws RcsMessageStoreException {
         mRcsControllerCall.callWithNoReturn(
-                iRcs -> iRcs.setGroupThreadOwner(mThreadId, participant.getId()));
+                (iRcs, callingPackage) -> iRcs.setGroupThreadOwner(mThreadId, participant.getId(),
+                        callingPackage));
     }
 
     /**
@@ -135,7 +144,8 @@
         }
 
         mRcsControllerCall.callWithNoReturn(
-                iRcs -> iRcs.addParticipantToGroupThread(mThreadId, participant.getId()));
+                (iRcs, callingPackage) -> iRcs.addParticipantToGroupThread(mThreadId,
+                        participant.getId(), callingPackage));
     }
 
     /**
@@ -152,7 +162,8 @@
         }
 
         mRcsControllerCall.callWithNoReturn(
-                iRcs -> iRcs.removeParticipantFromGroupThread(mThreadId, participant.getId()));
+                (iRcs, callingPackage) -> iRcs.removeParticipantFromGroupThread(mThreadId,
+                        participant.getId(), callingPackage));
     }
 
     /**
@@ -173,7 +184,8 @@
         RcsParticipantQueryResult queryResult = new RcsParticipantQueryResult(
                 mRcsControllerCall,
                 mRcsControllerCall.call(
-                        iRcs -> iRcs.getParticipants(queryParameters)));
+                        (iRcs, callingPackage) -> iRcs.getParticipants(queryParameters,
+                                callingPackage)));
 
         List<RcsParticipant> participantList = queryResult.getParticipants();
         Set<RcsParticipant> participantSet = new LinkedHashSet<>(participantList);
@@ -189,7 +201,9 @@
     @Nullable
     @WorkerThread
     public Uri getConferenceUri() throws RcsMessageStoreException {
-        return mRcsControllerCall.call(iRcs -> iRcs.getGroupThreadConferenceUri(mThreadId));
+        return mRcsControllerCall.call(
+                (iRcs, callingPackage) -> iRcs.getGroupThreadConferenceUri(mThreadId,
+                        callingPackage));
     }
 
     /**
@@ -203,6 +217,7 @@
     @WorkerThread
     public void setConferenceUri(Uri conferenceUri) throws RcsMessageStoreException {
         mRcsControllerCall.callWithNoReturn(
-                iRcs -> iRcs.setGroupThreadConferenceUri(mThreadId, conferenceUri));
+                (iRcs, callingPackage) -> iRcs.setGroupThreadConferenceUri(mThreadId, conferenceUri,
+                        callingPackage));
     }
 }
diff --git a/telephony/java/android/telephony/ims/RcsGroupThreadIconChangedEvent.java b/telephony/java/android/telephony/ims/RcsGroupThreadIconChangedEvent.java
index d17401f..23e39ff 100644
--- a/telephony/java/android/telephony/ims/RcsGroupThreadIconChangedEvent.java
+++ b/telephony/java/android/telephony/ims/RcsGroupThreadIconChangedEvent.java
@@ -64,8 +64,8 @@
     @Override
     void persist(RcsControllerCall rcsControllerCall) throws RcsMessageStoreException {
         // TODO ensure failure throws
-        rcsControllerCall.call(iRcs -> iRcs.createGroupThreadIconChangedEvent(
+        rcsControllerCall.call((iRcs, callingPackage) -> iRcs.createGroupThreadIconChangedEvent(
                 getTimestamp(), getRcsGroupThread().getThreadId(),
-                getOriginatingParticipant().getId(), mNewIcon));
+                getOriginatingParticipant().getId(), mNewIcon, callingPackage));
     }
 }
diff --git a/telephony/java/android/telephony/ims/RcsGroupThreadNameChangedEvent.java b/telephony/java/android/telephony/ims/RcsGroupThreadNameChangedEvent.java
index 8430dc4..a6a0867 100644
--- a/telephony/java/android/telephony/ims/RcsGroupThreadNameChangedEvent.java
+++ b/telephony/java/android/telephony/ims/RcsGroupThreadNameChangedEvent.java
@@ -61,8 +61,8 @@
      */
     @Override
     void persist(RcsControllerCall rcsControllerCall) throws RcsMessageStoreException {
-        rcsControllerCall.call(iRcs -> iRcs.createGroupThreadNameChangedEvent(
+        rcsControllerCall.call((iRcs, callingPackage) -> iRcs.createGroupThreadNameChangedEvent(
                 getTimestamp(), getRcsGroupThread().getThreadId(),
-                getOriginatingParticipant().getId(), mNewName));
+                getOriginatingParticipant().getId(), mNewName, callingPackage));
     }
 }
diff --git a/telephony/java/android/telephony/ims/RcsGroupThreadParticipantJoinedEvent.java b/telephony/java/android/telephony/ims/RcsGroupThreadParticipantJoinedEvent.java
index 2cdf960a..694c7de 100644
--- a/telephony/java/android/telephony/ims/RcsGroupThreadParticipantJoinedEvent.java
+++ b/telephony/java/android/telephony/ims/RcsGroupThreadParticipantJoinedEvent.java
@@ -30,13 +30,14 @@
      * Creates a new {@link RcsGroupThreadParticipantJoinedEvent}. This event is not persisted into
      * storage until {@link RcsMessageStore#persistRcsEvent(RcsEvent)} is called.
      *
-     * @param timestamp The timestamp of when this event happened, in milliseconds passed after
-     *                  midnight, January 1st, 1970 UTC
-     * @param rcsGroupThread The {@link RcsGroupThread} that this event happened on
+     * @param timestamp              The timestamp of when this event happened, in milliseconds
+     *                               passed after
+     *                               midnight, January 1st, 1970 UTC
+     * @param rcsGroupThread         The {@link RcsGroupThread} that this event happened on
      * @param originatingParticipant The {@link RcsParticipant} that added or invited the new
      *                               {@link RcsParticipant} into the {@link RcsGroupThread}
-     * @param joinedParticipant The new {@link RcsParticipant} that joined the
-     *                          {@link RcsGroupThread}
+     * @param joinedParticipant      The new {@link RcsParticipant} that joined the
+     *                               {@link RcsGroupThread}
      * @see RcsMessageStore#persistRcsEvent(RcsEvent)
      */
     public RcsGroupThreadParticipantJoinedEvent(long timestamp,
@@ -61,8 +62,9 @@
     @Override
     void persist(RcsControllerCall rcsControllerCall) throws RcsMessageStoreException {
         rcsControllerCall.call(
-                iRcs -> iRcs.createGroupThreadParticipantJoinedEvent(getTimestamp(),
+                (iRcs, callingPackage) -> iRcs.createGroupThreadParticipantJoinedEvent(
+                        getTimestamp(),
                         getRcsGroupThread().getThreadId(), getOriginatingParticipant().getId(),
-                        getJoinedParticipant().getId()));
+                        getJoinedParticipant().getId(), callingPackage));
     }
 }
diff --git a/telephony/java/android/telephony/ims/RcsGroupThreadParticipantLeftEvent.java b/telephony/java/android/telephony/ims/RcsGroupThreadParticipantLeftEvent.java
index 22d48fc..fec4354 100644
--- a/telephony/java/android/telephony/ims/RcsGroupThreadParticipantLeftEvent.java
+++ b/telephony/java/android/telephony/ims/RcsGroupThreadParticipantLeftEvent.java
@@ -60,8 +60,8 @@
     @Override
     void persist(RcsControllerCall rcsControllerCall) throws RcsMessageStoreException {
         rcsControllerCall.call(
-                iRcs -> iRcs.createGroupThreadParticipantLeftEvent(getTimestamp(),
+                (iRcs, callingPackage) -> iRcs.createGroupThreadParticipantLeftEvent(getTimestamp(),
                         getRcsGroupThread().getThreadId(), getOriginatingParticipant().getId(),
-                        getLeavingParticipant().getId()));
+                        getLeavingParticipant().getId(), callingPackage));
     }
 }
diff --git a/telephony/java/android/telephony/ims/RcsIncomingMessage.java b/telephony/java/android/telephony/ims/RcsIncomingMessage.java
index 87ddbbf..2810a49 100644
--- a/telephony/java/android/telephony/ims/RcsIncomingMessage.java
+++ b/telephony/java/android/telephony/ims/RcsIncomingMessage.java
@@ -40,7 +40,8 @@
     @WorkerThread
     public void setArrivalTimestamp(long arrivalTimestamp) throws RcsMessageStoreException {
         mRcsControllerCall.callWithNoReturn(
-                iRcs -> iRcs.setMessageArrivalTimestamp(mId, true, arrivalTimestamp));
+                (iRcs, callingPackage) -> iRcs.setMessageArrivalTimestamp(mId, true,
+                        arrivalTimestamp, callingPackage));
     }
 
     /**
@@ -50,7 +51,9 @@
      */
     @WorkerThread
     public long getArrivalTimestamp() throws RcsMessageStoreException {
-        return mRcsControllerCall.call(iRcs -> iRcs.getMessageArrivalTimestamp(mId, true));
+        return mRcsControllerCall.call(
+                (iRcs, callingPackage) -> iRcs.getMessageArrivalTimestamp(mId, true,
+                        callingPackage));
     }
 
     /**
@@ -63,7 +66,8 @@
     @WorkerThread
     public void setSeenTimestamp(long notifiedTimestamp) throws RcsMessageStoreException {
         mRcsControllerCall.callWithNoReturn(
-                iRcs -> iRcs.setMessageSeenTimestamp(mId, true, notifiedTimestamp));
+                (iRcs, callingPackage) -> iRcs.setMessageSeenTimestamp(mId, true, notifiedTimestamp,
+                        callingPackage));
     }
 
     /**
@@ -73,7 +77,8 @@
      */
     @WorkerThread
     public long getSeenTimestamp() throws RcsMessageStoreException {
-        return mRcsControllerCall.call(iRcs -> iRcs.getMessageSeenTimestamp(mId, true));
+        return mRcsControllerCall.call(
+                (iRcs, callingPackage) -> iRcs.getMessageSeenTimestamp(mId, true, callingPackage));
     }
 
     /**
@@ -84,7 +89,8 @@
     public RcsParticipant getSenderParticipant() throws RcsMessageStoreException {
         return new RcsParticipant(
                 mRcsControllerCall,
-                mRcsControllerCall.call(iRcs -> iRcs.getSenderParticipant(mId)));
+                mRcsControllerCall.call(
+                        (iRcs, callingPackage) -> iRcs.getSenderParticipant(mId, callingPackage)));
     }
 
     /**
diff --git a/telephony/java/android/telephony/ims/RcsMessage.java b/telephony/java/android/telephony/ims/RcsMessage.java
index 1c466b9..4601bfd 100644
--- a/telephony/java/android/telephony/ims/RcsMessage.java
+++ b/telephony/java/android/telephony/ims/RcsMessage.java
@@ -121,7 +121,8 @@
      * @see android.telephony.SubscriptionInfo#getSubscriptionId
      */
     public int getSubscriptionId() throws RcsMessageStoreException {
-        return mRcsControllerCall.call(iRcs -> iRcs.getMessageSubId(mId, isIncoming()));
+        return mRcsControllerCall.call(
+                (iRcs, callingPackage) -> iRcs.getMessageSubId(mId, isIncoming(), callingPackage));
     }
 
     /**
@@ -134,7 +135,9 @@
      */
     @WorkerThread
     public void setSubscriptionId(int subId) throws RcsMessageStoreException {
-        mRcsControllerCall.callWithNoReturn(iRcs -> iRcs.setMessageSubId(mId, isIncoming(), subId));
+        mRcsControllerCall.callWithNoReturn(
+                (iRcs, callingPackage) -> iRcs.setMessageSubId(mId, isIncoming(), subId,
+                        callingPackage));
     }
 
     /**
@@ -146,7 +149,8 @@
     @WorkerThread
     public void setStatus(@RcsMessageStatus int rcsMessageStatus) throws RcsMessageStoreException {
         mRcsControllerCall.callWithNoReturn(
-                iRcs -> iRcs.setMessageStatus(mId, isIncoming(), rcsMessageStatus));
+                (iRcs, callingPackage) -> iRcs.setMessageStatus(mId, isIncoming(), rcsMessageStatus,
+                        callingPackage));
     }
 
     /**
@@ -156,7 +160,8 @@
      */
     @WorkerThread
     public @RcsMessageStatus int getStatus() throws RcsMessageStoreException {
-        return mRcsControllerCall.call(iRcs -> iRcs.getMessageStatus(mId, isIncoming()));
+        return mRcsControllerCall.call(
+                (iRcs, callingPackage) -> iRcs.getMessageStatus(mId, isIncoming(), callingPackage));
     }
 
     /**
@@ -170,7 +175,8 @@
     @WorkerThread
     public void setOriginationTimestamp(long timestamp) throws RcsMessageStoreException {
         mRcsControllerCall.callWithNoReturn(
-                iRcs -> iRcs.setMessageOriginationTimestamp(mId, isIncoming(), timestamp));
+                (iRcs, callingPackage) -> iRcs.setMessageOriginationTimestamp(mId, isIncoming(),
+                        timestamp, callingPackage));
     }
 
     /**
@@ -182,7 +188,8 @@
     @WorkerThread
     public long getOriginationTimestamp() throws RcsMessageStoreException {
         return mRcsControllerCall.call(
-                iRcs -> iRcs.getMessageOriginationTimestamp(mId, isIncoming()));
+                (iRcs, callingPackage) -> iRcs.getMessageOriginationTimestamp(mId, isIncoming(),
+                        callingPackage));
     }
 
     /**
@@ -196,7 +203,8 @@
     @WorkerThread
     public void setRcsMessageId(String rcsMessageGlobalId) throws RcsMessageStoreException {
         mRcsControllerCall.callWithNoReturn(
-                iRcs -> iRcs.setGlobalMessageIdForMessage(mId, isIncoming(), rcsMessageGlobalId));
+                (iRcs, callingPackage) -> iRcs.setGlobalMessageIdForMessage(mId, isIncoming(),
+                        rcsMessageGlobalId, callingPackage));
     }
 
     /**
@@ -207,7 +215,8 @@
     @WorkerThread
     public String getRcsMessageId() throws RcsMessageStoreException {
         return mRcsControllerCall.call(
-                iRcs -> iRcs.getGlobalMessageIdForMessage(mId, isIncoming()));
+                (iRcs, callingPackage) -> iRcs.getGlobalMessageIdForMessage(mId, isIncoming(),
+                        callingPackage));
     }
 
     /**
@@ -216,7 +225,9 @@
      */
     @WorkerThread
     public String getText() throws RcsMessageStoreException {
-        return mRcsControllerCall.call(iRcs -> iRcs.getTextForMessage(mId, isIncoming()));
+        return mRcsControllerCall.call(
+                (iRcs, callingPackage) -> iRcs.getTextForMessage(mId, isIncoming(),
+                        callingPackage));
     }
 
     /**
@@ -228,18 +239,20 @@
     @WorkerThread
     public void setText(String text) throws RcsMessageStoreException {
         mRcsControllerCall.callWithNoReturn(
-                iRcs -> iRcs.setTextForMessage(mId, isIncoming(), text));
+                (iRcs, callingPackage) -> iRcs.setTextForMessage(mId, isIncoming(), text,
+                        callingPackage));
     }
 
     /**
      * @return Returns the associated latitude for this message, or
      * {@link RcsMessage#LOCATION_NOT_SET} if it does not contain a location.
-     *
      * @throws RcsMessageStoreException if the value could not be read from the storage
      */
     @WorkerThread
     public double getLatitude() throws RcsMessageStoreException {
-        return mRcsControllerCall.call(iRcs -> iRcs.getLatitudeForMessage(mId, isIncoming()));
+        return mRcsControllerCall.call(
+                (iRcs, callingPackage) -> iRcs.getLatitudeForMessage(mId, isIncoming(),
+                        callingPackage));
     }
 
     /**
@@ -251,18 +264,20 @@
     @WorkerThread
     public void setLatitude(double latitude) throws RcsMessageStoreException {
         mRcsControllerCall.callWithNoReturn(
-                iRcs -> iRcs.setLatitudeForMessage(mId, isIncoming(), latitude));
+                (iRcs, callingPackage) -> iRcs.setLatitudeForMessage(mId, isIncoming(), latitude,
+                        callingPackage));
     }
 
     /**
      * @return Returns the associated longitude for this message, or
      * {@link RcsMessage#LOCATION_NOT_SET} if it does not contain a location.
-     *
      * @throws RcsMessageStoreException if the value could not be read from the storage
      */
     @WorkerThread
     public double getLongitude() throws RcsMessageStoreException {
-        return mRcsControllerCall.call(iRcs -> iRcs.getLongitudeForMessage(mId, isIncoming()));
+        return mRcsControllerCall.call(
+                (iRcs, callingPackage) -> iRcs.getLongitudeForMessage(mId, isIncoming(),
+                        callingPackage));
     }
 
     /**
@@ -274,7 +289,8 @@
     @WorkerThread
     public void setLongitude(double longitude) throws RcsMessageStoreException {
         mRcsControllerCall.callWithNoReturn(
-                iRcs -> iRcs.setLongitudeForMessage(mId, isIncoming(), longitude));
+                (iRcs, callingPackage) -> iRcs.setLongitudeForMessage(mId, isIncoming(), longitude,
+                        callingPackage));
     }
 
     /**
@@ -291,7 +307,8 @@
             RcsFileTransferCreationParams fileTransferCreationParameters)
             throws RcsMessageStoreException {
         return new RcsFileTransferPart(mRcsControllerCall, mRcsControllerCall.call(
-                iRcs -> iRcs.storeFileTransfer(mId, isIncoming(), fileTransferCreationParameters)));
+                (iRcs, callingPackage) -> iRcs.storeFileTransfer(mId, isIncoming(),
+                        fileTransferCreationParameters, callingPackage)));
     }
 
     /**
@@ -305,7 +322,8 @@
         Set<RcsFileTransferPart> fileTransferParts = new HashSet<>();
 
         int[] fileTransferIds = mRcsControllerCall.call(
-                iRcs -> iRcs.getFileTransfersAttachedToMessage(mId, isIncoming()));
+                (iRcs, callingPackage) -> iRcs.getFileTransfersAttachedToMessage(mId, isIncoming(),
+                        callingPackage));
 
         for (int fileTransfer : fileTransferIds) {
             fileTransferParts.add(new RcsFileTransferPart(mRcsControllerCall, fileTransfer));
@@ -328,7 +346,8 @@
         }
 
         mRcsControllerCall.callWithNoReturn(
-                iRcs -> iRcs.deleteFileTransfer(fileTransferPart.getId()));
+                (iRcs, callingPackage) -> iRcs.deleteFileTransfer(fileTransferPart.getId(),
+                        callingPackage));
     }
 
     /**
diff --git a/telephony/java/android/telephony/ims/RcsMessageStore.java b/telephony/java/android/telephony/ims/RcsMessageStore.java
index 20b47c0..d112798 100644
--- a/telephony/java/android/telephony/ims/RcsMessageStore.java
+++ b/telephony/java/android/telephony/ims/RcsMessageStore.java
@@ -49,7 +49,9 @@
     public RcsThreadQueryResult getRcsThreads(@Nullable RcsThreadQueryParams queryParameters)
             throws RcsMessageStoreException {
         return new RcsThreadQueryResult(mRcsControllerCall,
-                mRcsControllerCall.call(iRcs -> iRcs.getRcsThreads(queryParameters)));
+                mRcsControllerCall.call(
+                        (iRcs, callingPackage) -> iRcs.getRcsThreads(queryParameters,
+                                callingPackage)));
     }
 
     /**
@@ -64,7 +66,9 @@
     public RcsThreadQueryResult getRcsThreads(@NonNull RcsQueryContinuationToken continuationToken)
             throws RcsMessageStoreException {
         return new RcsThreadQueryResult(mRcsControllerCall,
-                mRcsControllerCall.call(iRcs -> iRcs.getRcsThreadsWithToken(continuationToken)));
+                mRcsControllerCall.call(
+                        (iRcs, callingPackage) -> iRcs.getRcsThreadsWithToken(continuationToken,
+                                callingPackage)));
     }
 
     /**
@@ -80,7 +84,9 @@
             @Nullable RcsParticipantQueryParams queryParameters)
             throws RcsMessageStoreException {
         return new RcsParticipantQueryResult(mRcsControllerCall,
-                mRcsControllerCall.call(iRcs -> iRcs.getParticipants(queryParameters)));
+                mRcsControllerCall.call(
+                        (iRcs, callingPackage) -> iRcs.getParticipants(queryParameters,
+                                callingPackage)));
     }
 
     /**
@@ -97,7 +103,9 @@
             @NonNull RcsQueryContinuationToken continuationToken)
             throws RcsMessageStoreException {
         return new RcsParticipantQueryResult(mRcsControllerCall,
-                mRcsControllerCall.call(iRcs -> iRcs.getParticipantsWithToken(continuationToken)));
+                mRcsControllerCall.call(
+                        (iRcs, callingPackage) -> iRcs.getParticipantsWithToken(continuationToken,
+                                callingPackage)));
     }
 
     /**
@@ -112,7 +120,8 @@
     public RcsMessageQueryResult getRcsMessages(
             @Nullable RcsMessageQueryParams queryParams) throws RcsMessageStoreException {
         return new RcsMessageQueryResult(mRcsControllerCall,
-                mRcsControllerCall.call(iRcs -> iRcs.getMessages(queryParams)));
+                mRcsControllerCall.call(
+                        (iRcs, callingPackage) -> iRcs.getMessages(queryParams, callingPackage)));
     }
 
     /**
@@ -127,7 +136,9 @@
     public RcsMessageQueryResult getRcsMessages(
             @NonNull RcsQueryContinuationToken continuationToken) throws RcsMessageStoreException {
         return new RcsMessageQueryResult(mRcsControllerCall,
-                mRcsControllerCall.call(iRcs -> iRcs.getMessagesWithToken(continuationToken)));
+                mRcsControllerCall.call(
+                        (iRcs, callingPackage) -> iRcs.getMessagesWithToken(continuationToken,
+                                callingPackage)));
     }
 
     /**
@@ -141,7 +152,8 @@
     @NonNull
     public RcsEventQueryResult getRcsEvents(
             @Nullable RcsEventQueryParams queryParams) throws RcsMessageStoreException {
-        return mRcsControllerCall.call(iRcs -> iRcs.getEvents(queryParams))
+        return mRcsControllerCall.call(
+                (iRcs, callingPackage) -> iRcs.getEvents(queryParams, callingPackage))
                 .getRcsEventQueryResult(mRcsControllerCall);
     }
 
@@ -156,7 +168,9 @@
     @NonNull
     public RcsEventQueryResult getRcsEvents(
             @NonNull RcsQueryContinuationToken continuationToken) throws RcsMessageStoreException {
-        return mRcsControllerCall.call(iRcs -> iRcs.getEventsWithToken(continuationToken))
+        return mRcsControllerCall.call(
+                (iRcs, callingPackage) -> iRcs.getEventsWithToken(continuationToken,
+                        callingPackage))
                 .getRcsEventQueryResult(mRcsControllerCall);
     }
 
@@ -190,7 +204,9 @@
             throws RcsMessageStoreException {
         return new Rcs1To1Thread(
                 mRcsControllerCall,
-                mRcsControllerCall.call(iRcs -> iRcs.createRcs1To1Thread(recipient.getId())));
+                mRcsControllerCall.call(
+                        (iRcs, callingPackage) -> iRcs.createRcs1To1Thread(recipient.getId(),
+                                callingPackage)));
     }
 
     /**
@@ -214,7 +230,8 @@
         int[] finalRecipientIds = recipientIds;
 
         int threadId = mRcsControllerCall.call(
-                iRcs -> iRcs.createGroupThread(finalRecipientIds, groupName, groupIcon));
+                (iRcs, callingPackage) -> iRcs.createGroupThread(finalRecipientIds, groupName,
+                        groupIcon, callingPackage));
 
         return new RcsGroupThread(mRcsControllerCall, threadId);
     }
@@ -232,7 +249,8 @@
         }
 
         boolean isDeleteSucceeded = mRcsControllerCall.call(
-                iRcs -> iRcs.deleteThread(thread.getThreadId(), thread.getThreadType()));
+                (iRcs, callingPackage) -> iRcs.deleteThread(thread.getThreadId(),
+                        thread.getThreadType(), callingPackage));
 
         if (!isDeleteSucceeded) {
             throw new RcsMessageStoreException("Could not delete RcsThread");
@@ -251,6 +269,7 @@
     public RcsParticipant createRcsParticipant(String canonicalAddress, @Nullable String alias)
             throws RcsMessageStoreException {
         return new RcsParticipant(mRcsControllerCall, mRcsControllerCall.call(
-                iRcs -> iRcs.createRcsParticipant(canonicalAddress, alias)));
+                (iRcs, callingPackage) -> iRcs.createRcsParticipant(canonicalAddress, alias,
+                        callingPackage)));
     }
 }
diff --git a/telephony/java/android/telephony/ims/RcsOutgoingMessage.java b/telephony/java/android/telephony/ims/RcsOutgoingMessage.java
index e81231b..7080ec6 100644
--- a/telephony/java/android/telephony/ims/RcsOutgoingMessage.java
+++ b/telephony/java/android/telephony/ims/RcsOutgoingMessage.java
@@ -46,7 +46,7 @@
         List<RcsOutgoingMessageDelivery> messageDeliveries = new ArrayList<>();
 
         deliveryParticipants = mRcsControllerCall.call(
-                iRcs -> iRcs.getMessageRecipients(mId));
+                (iRcs, callingPackage) -> iRcs.getMessageRecipients(mId, callingPackage));
 
         if (deliveryParticipants != null) {
             for (Integer deliveryParticipant : deliveryParticipants) {
diff --git a/telephony/java/android/telephony/ims/RcsOutgoingMessageDelivery.java b/telephony/java/android/telephony/ims/RcsOutgoingMessageDelivery.java
index af9a84b..df4a3e4 100644
--- a/telephony/java/android/telephony/ims/RcsOutgoingMessageDelivery.java
+++ b/telephony/java/android/telephony/ims/RcsOutgoingMessageDelivery.java
@@ -52,8 +52,9 @@
      */
     @WorkerThread
     public void setDeliveredTimestamp(long deliveredTimestamp) throws RcsMessageStoreException {
-        mRcsControllerCall.callWithNoReturn(iRcs -> iRcs.setOutgoingDeliveryDeliveredTimestamp(
-                mRcsOutgoingMessageId, mRecipientId, deliveredTimestamp));
+        mRcsControllerCall.callWithNoReturn(
+                (iRcs, callingPackage) -> iRcs.setOutgoingDeliveryDeliveredTimestamp(
+                        mRcsOutgoingMessageId, mRecipientId, deliveredTimestamp, callingPackage));
     }
 
     /**
@@ -64,8 +65,9 @@
      */
     @WorkerThread
     public long getDeliveredTimestamp() throws RcsMessageStoreException {
-        return mRcsControllerCall.call(iRcs -> iRcs.getOutgoingDeliveryDeliveredTimestamp(
-                mRcsOutgoingMessageId, mRecipientId));
+        return mRcsControllerCall.call(
+                (iRcs, callingPackage) -> iRcs.getOutgoingDeliveryDeliveredTimestamp(
+                        mRcsOutgoingMessageId, mRecipientId, callingPackage));
     }
 
     /**
@@ -77,8 +79,9 @@
      */
     @WorkerThread
     public void setSeenTimestamp(long seenTimestamp) throws RcsMessageStoreException {
-        mRcsControllerCall.callWithNoReturn(iRcs -> iRcs.setOutgoingDeliverySeenTimestamp(
-                mRcsOutgoingMessageId, mRecipientId, seenTimestamp));
+        mRcsControllerCall.callWithNoReturn(
+                (iRcs, callingPackage) -> iRcs.setOutgoingDeliverySeenTimestamp(
+                        mRcsOutgoingMessageId, mRecipientId, seenTimestamp, callingPackage));
     }
 
     /**
@@ -90,7 +93,8 @@
     @WorkerThread
     public long getSeenTimestamp() throws RcsMessageStoreException {
         return mRcsControllerCall.call(
-                iRcs -> iRcs.getOutgoingDeliverySeenTimestamp(mRcsOutgoingMessageId, mRecipientId));
+                (iRcs, callingPackage) -> iRcs.getOutgoingDeliverySeenTimestamp(
+                        mRcsOutgoingMessageId, mRecipientId, callingPackage));
     }
 
     /**
@@ -102,8 +106,9 @@
      */
     @WorkerThread
     public void setStatus(@RcsMessage.RcsMessageStatus int status) throws RcsMessageStoreException {
-        mRcsControllerCall.callWithNoReturn(iRcs -> iRcs.setOutgoingDeliveryStatus(
-                mRcsOutgoingMessageId, mRecipientId, status));
+        mRcsControllerCall.callWithNoReturn(
+                (iRcs, callingPackage) -> iRcs.setOutgoingDeliveryStatus(
+                        mRcsOutgoingMessageId, mRecipientId, status, callingPackage));
     }
 
     /**
@@ -113,7 +118,8 @@
     @WorkerThread
     public @RcsMessage.RcsMessageStatus int getStatus() throws RcsMessageStoreException {
         return mRcsControllerCall.call(
-                iRcs -> iRcs.getOutgoingDeliveryStatus(mRcsOutgoingMessageId, mRecipientId));
+                (iRcs, callingPackage) -> iRcs.getOutgoingDeliveryStatus(mRcsOutgoingMessageId,
+                        mRecipientId, callingPackage));
     }
 
     /**
diff --git a/telephony/java/android/telephony/ims/RcsParticipant.java b/telephony/java/android/telephony/ims/RcsParticipant.java
index 9ea55ba..8512e96 100644
--- a/telephony/java/android/telephony/ims/RcsParticipant.java
+++ b/telephony/java/android/telephony/ims/RcsParticipant.java
@@ -47,7 +47,9 @@
     @Nullable
     @WorkerThread
     public String getCanonicalAddress() throws RcsMessageStoreException {
-        return mRcsControllerCall.call(iRcs -> iRcs.getRcsParticipantCanonicalAddress(mId));
+        return mRcsControllerCall.call(
+                (iRcs, callingPackage) -> iRcs.getRcsParticipantCanonicalAddress(mId,
+                        callingPackage));
     }
 
     /**
@@ -59,7 +61,8 @@
     @Nullable
     @WorkerThread
     public String getAlias() throws RcsMessageStoreException {
-        return mRcsControllerCall.call(iRcs -> iRcs.getRcsParticipantAlias(mId));
+        return mRcsControllerCall.call(
+                (iRcs, callingPackage) -> iRcs.getRcsParticipantAlias(mId, callingPackage));
     }
 
     /**
@@ -72,7 +75,8 @@
      */
     @WorkerThread
     public void setAlias(String alias) throws RcsMessageStoreException {
-        mRcsControllerCall.callWithNoReturn(iRcs -> iRcs.setRcsParticipantAlias(mId, alias));
+        mRcsControllerCall.callWithNoReturn(
+                (iRcs, callingPackage) -> iRcs.setRcsParticipantAlias(mId, alias, callingPackage));
     }
 
     /**
@@ -84,7 +88,8 @@
     @Nullable
     @WorkerThread
     public String getContactId() throws RcsMessageStoreException {
-        return mRcsControllerCall.call(iRcs -> iRcs.getRcsParticipantContactId(mId));
+        return mRcsControllerCall.call(
+                (iRcs, callingPackage) -> iRcs.getRcsParticipantContactId(mId, callingPackage));
     }
 
     /**
@@ -98,7 +103,8 @@
     @WorkerThread
     public void setContactId(String contactId) throws RcsMessageStoreException {
         mRcsControllerCall.callWithNoReturn(
-                iRcs -> iRcs.setRcsParticipantContactId(mId, contactId));
+                (iRcs, callingPackage) -> iRcs.setRcsParticipantContactId(mId, contactId,
+                        callingPackage));
     }
 
     @Override
diff --git a/telephony/java/android/telephony/ims/RcsParticipantAliasChangedEvent.java b/telephony/java/android/telephony/ims/RcsParticipantAliasChangedEvent.java
index 8d2e8f2..865bc05 100644
--- a/telephony/java/android/telephony/ims/RcsParticipantAliasChangedEvent.java
+++ b/telephony/java/android/telephony/ims/RcsParticipantAliasChangedEvent.java
@@ -70,7 +70,7 @@
      */
     @Override
     void persist(RcsControllerCall rcsControllerCall) throws RcsMessageStoreException {
-        rcsControllerCall.call(iRcs -> iRcs.createParticipantAliasChangedEvent(
-                getTimestamp(), getParticipant().getId(), getNewAlias()));
+        rcsControllerCall.call((iRcs, callingPackage) -> iRcs.createParticipantAliasChangedEvent(
+                getTimestamp(), getParticipant().getId(), getNewAlias(), callingPackage));
     }
 }
diff --git a/telephony/java/android/telephony/ims/RcsThread.java b/telephony/java/android/telephony/ims/RcsThread.java
index 638b12a..efb2cca 100644
--- a/telephony/java/android/telephony/ims/RcsThread.java
+++ b/telephony/java/android/telephony/ims/RcsThread.java
@@ -58,7 +58,8 @@
     @WorkerThread
     @NonNull
     public RcsMessageSnippet getSnippet() throws RcsMessageStoreException {
-        return mRcsControllerCall.call(iRcs -> iRcs.getMessageSnippet(mThreadId));
+        return mRcsControllerCall.call(
+                (iRcs, callingPackage) -> iRcs.getMessageSnippet(mThreadId, callingPackage));
     }
 
     /**
@@ -72,7 +73,8 @@
             @NonNull RcsIncomingMessageCreationParams rcsIncomingMessageCreationParams)
             throws RcsMessageStoreException {
         int messageId = mRcsControllerCall.call(
-                iRcs -> iRcs.addIncomingMessage(mThreadId, rcsIncomingMessageCreationParams));
+                (iRcs, callingPackage) -> iRcs.addIncomingMessage(mThreadId,
+                        rcsIncomingMessageCreationParams, callingPackage));
         return new RcsIncomingMessage(mRcsControllerCall, messageId);
     }
 
@@ -86,8 +88,8 @@
     public RcsOutgoingMessage addOutgoingMessage(
             @NonNull RcsOutgoingMessageCreationParams rcsOutgoingMessageCreationParams)
             throws RcsMessageStoreException {
-        int messageId = mRcsControllerCall.call(iRcs -> iRcs.addOutgoingMessage(
-                mThreadId, rcsOutgoingMessageCreationParams));
+        int messageId = mRcsControllerCall.call((iRcs, callingPackage) -> iRcs.addOutgoingMessage(
+                mThreadId, rcsOutgoingMessageCreationParams, callingPackage));
 
         return new RcsOutgoingMessage(mRcsControllerCall, messageId);
     }
@@ -101,8 +103,9 @@
     @WorkerThread
     public void deleteMessage(@NonNull RcsMessage rcsMessage) throws RcsMessageStoreException {
         mRcsControllerCall.callWithNoReturn(
-                iRcs -> iRcs.deleteMessage(rcsMessage.getId(), rcsMessage.isIncoming(), mThreadId,
-                        isGroup()));
+                (iRcs, callingPackage) -> iRcs.deleteMessage(rcsMessage.getId(),
+                        rcsMessage.isIncoming(), mThreadId,
+                        isGroup(), callingPackage));
     }
 
     /**
@@ -119,7 +122,8 @@
         RcsMessageQueryParams queryParams =
                 new RcsMessageQueryParams.Builder().setThread(this).build();
         return new RcsMessageQueryResult(mRcsControllerCall,
-                mRcsControllerCall.call(iRcs -> iRcs.getMessages(queryParams)));
+                mRcsControllerCall.call(
+                        (iRcs, callingPackage) -> iRcs.getMessages(queryParams, callingPackage)));
     }
 
     /**
diff --git a/telephony/java/android/telephony/ims/aidl/IRcs.aidl b/telephony/java/android/telephony/ims/aidl/IRcs.aidl
index 6eb966a..9ee15da 100644
--- a/telephony/java/android/telephony/ims/aidl/IRcs.aidl
+++ b/telephony/java/android/telephony/ims/aidl/IRcs.aidl
@@ -39,34 +39,34 @@
     /////////////////////////
     // RcsMessageStore APIs
     /////////////////////////
-    RcsThreadQueryResultParcelable getRcsThreads(in RcsThreadQueryParams queryParams);
+    RcsThreadQueryResultParcelable getRcsThreads(in RcsThreadQueryParams queryParams, String callingPackage);
 
     RcsThreadQueryResultParcelable getRcsThreadsWithToken(
-        in RcsQueryContinuationToken continuationToken);
+        in RcsQueryContinuationToken continuationToken, String callingPackage);
 
-    RcsParticipantQueryResultParcelable getParticipants(in RcsParticipantQueryParams queryParams);
+    RcsParticipantQueryResultParcelable getParticipants(in RcsParticipantQueryParams queryParams, String callingPackage);
 
     RcsParticipantQueryResultParcelable getParticipantsWithToken(
-        in RcsQueryContinuationToken continuationToken);
+        in RcsQueryContinuationToken continuationToken, String callingPackage);
 
-    RcsMessageQueryResultParcelable getMessages(in RcsMessageQueryParams queryParams);
+    RcsMessageQueryResultParcelable getMessages(in RcsMessageQueryParams queryParams, String callingPackage);
 
     RcsMessageQueryResultParcelable getMessagesWithToken(
-        in RcsQueryContinuationToken continuationToken);
+        in RcsQueryContinuationToken continuationToken, String callingPackage);
 
-    RcsEventQueryResultDescriptor getEvents(in RcsEventQueryParams queryParams);
+    RcsEventQueryResultDescriptor getEvents(in RcsEventQueryParams queryParams, String callingPackage);
 
     RcsEventQueryResultDescriptor getEventsWithToken(
-        in RcsQueryContinuationToken continuationToken);
+        in RcsQueryContinuationToken continuationToken, String callingPackage);
 
     // returns true if the thread was successfully deleted
-    boolean deleteThread(int threadId, int threadType);
+    boolean deleteThread(int threadId, int threadType, String callingPackage);
 
     // Creates an Rcs1To1Thread and returns its row ID
-    int createRcs1To1Thread(int participantId);
+    int createRcs1To1Thread(int participantId, String callingPackage);
 
     // Creates an RcsGroupThread and returns its row ID
-    int createGroupThread(in int[] participantIds, String groupName, in Uri groupIcon);
+    int createGroupThread(in int[] participantIds, String groupName, in Uri groupIcon, String callingPackage);
 
     /////////////////////////
     // RcsThread APIs
@@ -74,128 +74,128 @@
 
     // Creates a new RcsIncomingMessage on the given thread and returns its row ID
     int addIncomingMessage(int rcsThreadId,
-            in RcsIncomingMessageCreationParams rcsIncomingMessageCreationParams);
+            in RcsIncomingMessageCreationParams rcsIncomingMessageCreationParams, String callingPackage);
 
     // Creates a new RcsOutgoingMessage on the given thread and returns its row ID
     int addOutgoingMessage(int rcsThreadId,
-            in RcsOutgoingMessageCreationParams rcsOutgoingMessageCreationParams);
+            in RcsOutgoingMessageCreationParams rcsOutgoingMessageCreationParams, String callingPackage);
 
     // TODO: modify RcsProvider URI's to allow deleting a message without specifying its thread
-    void deleteMessage(int rcsMessageId, boolean isIncoming, int rcsThreadId, boolean isGroup);
+    void deleteMessage(int rcsMessageId, boolean isIncoming, int rcsThreadId, boolean isGroup, String callingPackage);
 
-    RcsMessageSnippet getMessageSnippet(int rcsThreadId);
+    RcsMessageSnippet getMessageSnippet(int rcsThreadId, String callingPackage);
 
     /////////////////////////
     // Rcs1To1Thread APIs
     /////////////////////////
-    void set1To1ThreadFallbackThreadId(int rcsThreadId, long fallbackId);
+    void set1To1ThreadFallbackThreadId(int rcsThreadId, long fallbackId, String callingPackage);
 
-    long get1To1ThreadFallbackThreadId(int rcsThreadId);
+    long get1To1ThreadFallbackThreadId(int rcsThreadId, String callingPackage);
 
-    int get1To1ThreadOtherParticipantId(int rcsThreadId);
+    int get1To1ThreadOtherParticipantId(int rcsThreadId, String callingPackage);
 
     /////////////////////////
     // RcsGroupThread APIs
     /////////////////////////
-    void setGroupThreadName(int rcsThreadId, String groupName);
+    void setGroupThreadName(int rcsThreadId, String groupName, String callingPackage);
 
-    String getGroupThreadName(int rcsThreadId);
+    String getGroupThreadName(int rcsThreadId, String callingPackage);
 
-    void setGroupThreadIcon(int rcsThreadId, in Uri groupIcon);
+    void setGroupThreadIcon(int rcsThreadId, in Uri groupIcon, String callingPackage);
 
-    Uri getGroupThreadIcon(int rcsThreadId);
+    Uri getGroupThreadIcon(int rcsThreadId, String callingPackage);
 
-    void setGroupThreadOwner(int rcsThreadId, int participantId);
+    void setGroupThreadOwner(int rcsThreadId, int participantId, String callingPackage);
 
-    int getGroupThreadOwner(int rcsThreadId);
+    int getGroupThreadOwner(int rcsThreadId, String callingPackage);
 
-    void setGroupThreadConferenceUri(int rcsThreadId, in Uri conferenceUri);
+    void setGroupThreadConferenceUri(int rcsThreadId, in Uri conferenceUri, String callingPackage);
 
-    Uri getGroupThreadConferenceUri(int rcsThreadId);
+    Uri getGroupThreadConferenceUri(int rcsThreadId, String callingPackage);
 
-    void addParticipantToGroupThread(int rcsThreadId, int participantId);
+    void addParticipantToGroupThread(int rcsThreadId, int participantId, String callingPackage);
 
-    void removeParticipantFromGroupThread(int rcsThreadId, int participantId);
+    void removeParticipantFromGroupThread(int rcsThreadId, int participantId, String callingPackage);
 
     /////////////////////////
     // RcsParticipant APIs
     /////////////////////////
 
     // Creates a new RcsParticipant and returns its rowId
-    int createRcsParticipant(String canonicalAddress, String alias);
+    int createRcsParticipant(String canonicalAddress, String alias, String callingPackage);
 
-    String getRcsParticipantCanonicalAddress(int participantId);
+    String getRcsParticipantCanonicalAddress(int participantId, String callingPackage);
 
-    String getRcsParticipantAlias(int participantId);
+    String getRcsParticipantAlias(int participantId, String callingPackage);
 
-    void setRcsParticipantAlias(int id, String alias);
+    void setRcsParticipantAlias(int id, String alias, String callingPackage);
 
-    String getRcsParticipantContactId(int participantId);
+    String getRcsParticipantContactId(int participantId, String callingPackage);
 
-    void setRcsParticipantContactId(int participantId, String contactId);
+    void setRcsParticipantContactId(int participantId, String contactId, String callingPackage);
 
     /////////////////////////
     // RcsMessage APIs
     /////////////////////////
-    void setMessageSubId(int messageId, boolean isIncoming, int subId);
+    void setMessageSubId(int messageId, boolean isIncoming, int subId, String callingPackage);
 
-    int getMessageSubId(int messageId, boolean isIncoming);
+    int getMessageSubId(int messageId, boolean isIncoming, String callingPackage);
 
-    void setMessageStatus(int messageId, boolean isIncoming, int status);
+    void setMessageStatus(int messageId, boolean isIncoming, int status, String callingPackage);
 
-    int getMessageStatus(int messageId, boolean isIncoming);
+    int getMessageStatus(int messageId, boolean isIncoming, String callingPackage);
 
-    void setMessageOriginationTimestamp(int messageId, boolean isIncoming, long originationTimestamp);
+    void setMessageOriginationTimestamp(int messageId, boolean isIncoming, long originationTimestamp, String callingPackage);
 
-    long getMessageOriginationTimestamp(int messageId, boolean isIncoming);
+    long getMessageOriginationTimestamp(int messageId, boolean isIncoming, String callingPackage);
 
-    void setGlobalMessageIdForMessage(int messageId, boolean isIncoming, String globalId);
+    void setGlobalMessageIdForMessage(int messageId, boolean isIncoming, String globalId, String callingPackage);
 
-    String getGlobalMessageIdForMessage(int messageId, boolean isIncoming);
+    String getGlobalMessageIdForMessage(int messageId, boolean isIncoming, String callingPackage);
 
-    void setMessageArrivalTimestamp(int messageId, boolean isIncoming, long arrivalTimestamp);
+    void setMessageArrivalTimestamp(int messageId, boolean isIncoming, long arrivalTimestamp, String callingPackage);
 
-    long getMessageArrivalTimestamp(int messageId, boolean isIncoming);
+    long getMessageArrivalTimestamp(int messageId, boolean isIncoming, String callingPackage);
 
-    void setMessageSeenTimestamp(int messageId, boolean isIncoming, long seenTimestamp);
+    void setMessageSeenTimestamp(int messageId, boolean isIncoming, long seenTimestamp, String callingPackage);
 
-    long getMessageSeenTimestamp(int messageId, boolean isIncoming);
+    long getMessageSeenTimestamp(int messageId, boolean isIncoming, String callingPackage);
 
-    void setTextForMessage(int messageId, boolean isIncoming, String text);
+    void setTextForMessage(int messageId, boolean isIncoming, String text, String callingPackage);
 
-    String getTextForMessage(int messageId, boolean isIncoming);
+    String getTextForMessage(int messageId, boolean isIncoming, String callingPackage);
 
-    void setLatitudeForMessage(int messageId, boolean isIncoming, double latitude);
+    void setLatitudeForMessage(int messageId, boolean isIncoming, double latitude, String callingPackage);
 
-    double getLatitudeForMessage(int messageId, boolean isIncoming);
+    double getLatitudeForMessage(int messageId, boolean isIncoming, String callingPackage);
 
-    void setLongitudeForMessage(int messageId, boolean isIncoming, double longitude);
+    void setLongitudeForMessage(int messageId, boolean isIncoming, double longitude, String callingPackage);
 
-    double getLongitudeForMessage(int messageId, boolean isIncoming);
+    double getLongitudeForMessage(int messageId, boolean isIncoming, String callingPackage);
 
     // Returns the ID's of the file transfers attached to the given message
-    int[] getFileTransfersAttachedToMessage(int messageId, boolean isIncoming);
+    int[] getFileTransfersAttachedToMessage(int messageId, boolean isIncoming, String callingPackage);
 
-    int getSenderParticipant(int messageId);
+    int getSenderParticipant(int messageId, String callingPackage);
 
     /////////////////////////
     // RcsOutgoingMessageDelivery APIs
     /////////////////////////
 
     // Returns the participant ID's that this message is intended to be delivered to
-    int[] getMessageRecipients(int messageId);
+    int[] getMessageRecipients(int messageId, String callingPackage);
 
-    long getOutgoingDeliveryDeliveredTimestamp(int messageId, int participantId);
+    long getOutgoingDeliveryDeliveredTimestamp(int messageId, int participantId, String callingPackage);
 
-    void setOutgoingDeliveryDeliveredTimestamp(int messageId, int participantId, long deliveredTimestamp);
+    void setOutgoingDeliveryDeliveredTimestamp(int messageId, int participantId, long deliveredTimestamp, String callingPackage);
 
-    long getOutgoingDeliverySeenTimestamp(int messageId, int participantId);
+    long getOutgoingDeliverySeenTimestamp(int messageId, int participantId, String callingPackage);
 
-    void setOutgoingDeliverySeenTimestamp(int messageId, int participantId, long seenTimestamp);
+    void setOutgoingDeliverySeenTimestamp(int messageId, int participantId, long seenTimestamp, String callingPackage);
 
-    int getOutgoingDeliveryStatus(int messageId, int participantId);
+    int getOutgoingDeliveryStatus(int messageId, int participantId, String callingPackage);
 
-    void setOutgoingDeliveryStatus(int messageId, int participantId, int status);
+    void setOutgoingDeliveryStatus(int messageId, int participantId, int status, String callingPackage);
 
     /////////////////////////
     // RcsFileTransferPart APIs
@@ -203,64 +203,64 @@
 
     // Performs the initial write to storage and returns the row ID.
     int storeFileTransfer(int messageId, boolean isIncoming,
-            in RcsFileTransferCreationParams fileTransferCreationParams);
+            in RcsFileTransferCreationParams fileTransferCreationParams, String callingPackage);
 
-    void deleteFileTransfer(int partId);
+    void deleteFileTransfer(int partId, String callingPackage);
 
-    void setFileTransferSessionId(int partId, String sessionId);
+    void setFileTransferSessionId(int partId, String sessionId, String callingPackage);
 
-    String getFileTransferSessionId(int partId);
+    String getFileTransferSessionId(int partId, String callingPackage);
 
-    void setFileTransferContentUri(int partId, in Uri contentUri);
+    void setFileTransferContentUri(int partId, in Uri contentUri, String callingPackage);
 
-    Uri getFileTransferContentUri(int partId);
+    Uri getFileTransferContentUri(int partId, String callingPackage);
 
-    void setFileTransferContentType(int partId, String contentType);
+    void setFileTransferContentType(int partId, String contentType, String callingPackage);
 
-    String getFileTransferContentType(int partId);
+    String getFileTransferContentType(int partId, String callingPackage);
 
-    void setFileTransferFileSize(int partId, long fileSize);
+    void setFileTransferFileSize(int partId, long fileSize, String callingPackage);
 
-    long getFileTransferFileSize(int partId);
+    long getFileTransferFileSize(int partId, String callingPackage);
 
-    void setFileTransferTransferOffset(int partId, long transferOffset);
+    void setFileTransferTransferOffset(int partId, long transferOffset, String callingPackage);
 
-    long getFileTransferTransferOffset(int partId);
+    long getFileTransferTransferOffset(int partId, String callingPackage);
 
-    void setFileTransferStatus(int partId, int transferStatus);
+    void setFileTransferStatus(int partId, int transferStatus, String callingPackage);
 
-    int getFileTransferStatus(int partId);
+    int getFileTransferStatus(int partId, String callingPackage);
 
-    void setFileTransferWidth(int partId, int width);
+    void setFileTransferWidth(int partId, int width, String callingPackage);
 
-    int getFileTransferWidth(int partId);
+    int getFileTransferWidth(int partId, String callingPackage);
 
-    void setFileTransferHeight(int partId, int height);
+    void setFileTransferHeight(int partId, int height, String callingPackage);
 
-    int getFileTransferHeight(int partId);
+    int getFileTransferHeight(int partId, String callingPackage);
 
-    void setFileTransferLength(int partId, long length);
+    void setFileTransferLength(int partId, long length, String callingPackage);
 
-    long getFileTransferLength(int partId);
+    long getFileTransferLength(int partId, String callingPackage);
 
-    void setFileTransferPreviewUri(int partId, in Uri uri);
+    void setFileTransferPreviewUri(int partId, in Uri uri, String callingPackage);
 
-    Uri getFileTransferPreviewUri(int partId);
+    Uri getFileTransferPreviewUri(int partId, String callingPackage);
 
-    void setFileTransferPreviewType(int partId, String type);
+    void setFileTransferPreviewType(int partId, String type, String callingPackage);
 
-    String getFileTransferPreviewType(int partId);
+    String getFileTransferPreviewType(int partId, String callingPackage);
 
     /////////////////////////
     // RcsEvent APIs
     /////////////////////////
-    int createGroupThreadNameChangedEvent(long timestamp, int threadId, int originationParticipantId, String newName);
+    int createGroupThreadNameChangedEvent(long timestamp, int threadId, int originationParticipantId, String newName, String callingPackage);
 
-    int createGroupThreadIconChangedEvent(long timestamp, int threadId, int originationParticipantId, in Uri newIcon);
+    int createGroupThreadIconChangedEvent(long timestamp, int threadId, int originationParticipantId, in Uri newIcon, String callingPackage);
 
-    int createGroupThreadParticipantJoinedEvent(long timestamp, int threadId, int originationParticipantId, int participantId);
+    int createGroupThreadParticipantJoinedEvent(long timestamp, int threadId, int originationParticipantId, int participantId, String callingPackage);
 
-    int createGroupThreadParticipantLeftEvent(long timestamp, int threadId, int originationParticipantId, int participantId);
+    int createGroupThreadParticipantLeftEvent(long timestamp, int threadId, int originationParticipantId, int participantId, String callingPackage);
 
-    int createParticipantAliasChangedEvent(long timestamp, int participantId, String newAlias);
+    int createParticipantAliasChangedEvent(long timestamp, int participantId, String newAlias, String callingPackage);
 }
\ No newline at end of file