From f87e12447c70ce389b9e078f89f394b3a65bb442 Mon Sep 17 00:00:00 2001 From: David Zhao Date: Tue, 7 Mar 2023 14:11:00 -0800 Subject: [PATCH] API Review: Use intdef for TvMessageType Bug: 269425648 Test: atest TvInputServiceTest && TvInteractiveAppServiceTest Change-Id: Iaf085248775d7f2ad730fd7ce7254cc6c36fe344 --- core/api/current.txt | 17 +++++++++-------- core/api/test-current.txt | 2 +- .../java/android/media/tv/ITvInputClient.aidl | 2 +- .../java/android/media/tv/ITvInputManager.aidl | 2 +- .../java/android/media/tv/ITvInputSession.aidl | 2 +- .../media/tv/ITvInputSessionCallback.aidl | 2 +- .../media/tv/ITvInputSessionWrapper.java | 4 ++-- .../java/android/media/tv/TvInputManager.java | 18 ++++++++++-------- .../java/android/media/tv/TvInputService.java | 11 ++++++----- media/java/android/media/tv/TvView.java | 14 ++++++++------ .../interactive/ITvInteractiveAppManager.aidl | 2 +- .../interactive/ITvInteractiveAppSession.aidl | 2 +- .../ITvInteractiveAppSessionWrapper.java | 4 ++-- .../interactive/TvInteractiveAppManager.java | 2 +- .../interactive/TvInteractiveAppService.java | 4 ++-- .../tv/interactive/TvInteractiveAppView.java | 2 +- .../server/tv/TvInputManagerService.java | 4 ++-- .../TvInteractiveAppManagerService.java | 2 +- 18 files changed, 51 insertions(+), 45 deletions(-) diff --git a/core/api/current.txt b/core/api/current.txt index a53de83c882d5..6078712fa7d12 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -27343,8 +27343,9 @@ package android.media.tv { field public static final int TIME_SHIFT_STATUS_UNKNOWN = 0; // 0x0 field public static final int TIME_SHIFT_STATUS_UNSUPPORTED = 1; // 0x1 field public static final String TV_MESSAGE_KEY_STREAM_ID = "android.media.tv.TvInputManager.stream_id"; - field public static final String TV_MESSAGE_TYPE_CLOSED_CAPTION = "CC"; - field public static final String TV_MESSAGE_TYPE_WATERMARK = "Watermark"; + field public static final int TV_MESSAGE_TYPE_CLOSED_CAPTION = 2; // 0x2 + field public static final int TV_MESSAGE_TYPE_OTHER = 1000; // 0x3e8 + field public static final int TV_MESSAGE_TYPE_WATERMARK = 1; // 0x1 field public static final int VIDEO_UNAVAILABLE_REASON_AUDIO_ONLY = 4; // 0x4 field public static final int VIDEO_UNAVAILABLE_REASON_BUFFERING = 3; // 0x3 field public static final int VIDEO_UNAVAILABLE_REASON_CAS_BLACKOUT = 16; // 0x10 @@ -27435,7 +27436,7 @@ package android.media.tv { method public void notifyTrackSelected(int, String); method public void notifyTracksChanged(java.util.List); method public void notifyTuned(@NonNull android.net.Uri); - method public void notifyTvMessage(@NonNull String, @NonNull android.os.Bundle); + method public void notifyTvMessage(int, @NonNull android.os.Bundle); method public void notifyVideoAvailable(); method public void notifyVideoUnavailable(int); method public void onAdBufferReady(@NonNull android.media.tv.AdBuffer); @@ -27457,7 +27458,7 @@ package android.media.tv { method public void onSetInteractiveAppNotificationEnabled(boolean); method public abstract void onSetStreamVolume(@FloatRange(from=0.0, to=1.0) float); method public abstract boolean onSetSurface(@Nullable android.view.Surface); - method public void onSetTvMessageEnabled(@NonNull String, boolean); + method public void onSetTvMessageEnabled(int, boolean); method public void onSurfaceChanged(int, int, int); method public long onTimeShiftGetCurrentPosition(); method public long onTimeShiftGetStartPosition(); @@ -27600,7 +27601,7 @@ package android.media.tv { method public void setOnUnhandledInputEventListener(android.media.tv.TvView.OnUnhandledInputEventListener); method public void setStreamVolume(@FloatRange(from=0.0, to=1.0) float); method public void setTimeShiftPositionCallback(@Nullable android.media.tv.TvView.TimeShiftPositionCallback); - method public void setTvMessageEnabled(@NonNull String, boolean); + method public void setTvMessageEnabled(int, boolean); method public void setZOrderMediaOverlay(boolean); method public void setZOrderOnTop(boolean); method public void timeShiftPause(); @@ -27641,7 +27642,7 @@ package android.media.tv { method public void onTrackSelected(String, int, String); method public void onTracksChanged(String, java.util.List); method public void onTuned(@NonNull String, @NonNull android.net.Uri); - method public void onTvMessage(@NonNull String, @NonNull String, @NonNull android.os.Bundle); + method public void onTvMessage(@NonNull String, int, @NonNull android.os.Bundle); method public void onVideoAvailable(String); method public void onVideoSizeChanged(String, int, int); method public void onVideoUnavailable(String, int); @@ -27801,7 +27802,7 @@ package android.media.tv.interactive { method public boolean onTrackballEvent(@NonNull android.view.MotionEvent); method public void onTracksChanged(@NonNull java.util.List); method public void onTuned(@NonNull android.net.Uri); - method public void onTvMessage(@NonNull String, @NonNull android.os.Bundle); + method public void onTvMessage(int, @NonNull android.os.Bundle); method public void onTvRecordingInfo(@Nullable android.media.tv.TvRecordingInfo); method public void onTvRecordingInfoList(@NonNull java.util.List); method public void onVideoAvailable(); @@ -27865,7 +27866,7 @@ package android.media.tv.interactive { method public void notifyTimeShiftPlaybackParams(@NonNull android.media.PlaybackParams); method public void notifyTimeShiftStartPositionChanged(@NonNull String, long); method public void notifyTimeShiftStatusChanged(@NonNull String, int); - method public void notifyTvMessage(@NonNull String, @NonNull android.os.Bundle); + method public void notifyTvMessage(@NonNull int, @NonNull android.os.Bundle); method public void onAttachedToWindow(); method public void onDetachedFromWindow(); method public void onLayout(boolean, int, int, int, int); diff --git a/core/api/test-current.txt b/core/api/test-current.txt index 46651a9f5409b..5608317917783 100644 --- a/core/api/test-current.txt +++ b/core/api/test-current.txt @@ -1957,7 +1957,7 @@ package android.media.tv { } public class TvView extends android.view.ViewGroup { - method public void notifyTvMessage(@NonNull String, @NonNull android.os.Bundle); + method public void notifyTvMessage(int, @NonNull android.os.Bundle); } } diff --git a/media/java/android/media/tv/ITvInputClient.aidl b/media/java/android/media/tv/ITvInputClient.aidl index c52cd59311c5f..0f8a00a3c7d97 100644 --- a/media/java/android/media/tv/ITvInputClient.aidl +++ b/media/java/android/media/tv/ITvInputClient.aidl @@ -55,7 +55,7 @@ oneway interface ITvInputClient { void onCueingMessageAvailability(boolean available, int seq); void onTimeShiftMode(int mode, int seq); void onAvailableSpeeds(in float[] speeds, int seq); - void onTvMessage(in String type, in Bundle data, int seq); + void onTvMessage(int type, in Bundle data, int seq); void onTuned(in Uri channelUri, int seq); // For the recording session diff --git a/media/java/android/media/tv/ITvInputManager.aidl b/media/java/android/media/tv/ITvInputManager.aidl index 3b00f20e724ac..14c020e94c150 100644 --- a/media/java/android/media/tv/ITvInputManager.aidl +++ b/media/java/android/media/tv/ITvInputManager.aidl @@ -119,7 +119,7 @@ interface ITvInputManager { void notifyAdBufferReady(in IBinder sessionToken, in AdBuffer buffer, int userId); // For TV Message - void notifyTvMessage(in IBinder sessionToken, in String type, in Bundle data, int userId); + void notifyTvMessage(in IBinder sessionToken, int type, in Bundle data, int userId); // For TV input hardware binding List getHardwareList(); diff --git a/media/java/android/media/tv/ITvInputSession.aidl b/media/java/android/media/tv/ITvInputSession.aidl index 6d65e1f95271a..a7bd8d313ac35 100644 --- a/media/java/android/media/tv/ITvInputSession.aidl +++ b/media/java/android/media/tv/ITvInputSession.aidl @@ -78,5 +78,5 @@ oneway interface ITvInputSession { void notifyAdBufferReady(in AdBuffer buffer); // For TV messages - void notifyTvMessage(in String type, in Bundle data); + void notifyTvMessage(int type, in Bundle data); } diff --git a/media/java/android/media/tv/ITvInputSessionCallback.aidl b/media/java/android/media/tv/ITvInputSessionCallback.aidl index 449c2d67067ea..a52e9a572dca0 100644 --- a/media/java/android/media/tv/ITvInputSessionCallback.aidl +++ b/media/java/android/media/tv/ITvInputSessionCallback.aidl @@ -66,5 +66,5 @@ oneway interface ITvInputSessionCallback { void onAdBufferConsumed(in AdBuffer buffer); // For messages sent from the TV input - void onTvMessage(in String type, in Bundle data); + void onTvMessage(int type, in Bundle data); } diff --git a/media/java/android/media/tv/ITvInputSessionWrapper.java b/media/java/android/media/tv/ITvInputSessionWrapper.java index 2810a7e650677..7946baee200a7 100644 --- a/media/java/android/media/tv/ITvInputSessionWrapper.java +++ b/media/java/android/media/tv/ITvInputSessionWrapper.java @@ -267,7 +267,7 @@ public class ITvInputSessionWrapper extends ITvInputSession.Stub implements Hand } case DO_SET_TV_MESSAGE_ENABLED: { SomeArgs args = (SomeArgs) msg.obj; - mTvInputSessionImpl.setTvMessageEnabled((String) args.arg1, (Boolean) args.arg2); + mTvInputSessionImpl.setTvMessageEnabled((Integer) args.arg1, (Boolean) args.arg2); break; } case DO_REQUEST_AD: { @@ -470,7 +470,7 @@ public class ITvInputSessionWrapper extends ITvInputSession.Stub implements Hand } @Override - public void notifyTvMessage(String type, Bundle data) { + public void notifyTvMessage(int type, Bundle data) { mCaller.executeOrSendMessage(mCaller.obtainMessageOO(DO_NOTIFY_TV_MESSAGE, type, data)); } diff --git a/media/java/android/media/tv/TvInputManager.java b/media/java/android/media/tv/TvInputManager.java index 97403a44f75fc..7d6a8b4c2e977 100644 --- a/media/java/android/media/tv/TvInputManager.java +++ b/media/java/android/media/tv/TvInputManager.java @@ -22,7 +22,6 @@ import android.annotation.IntRange; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.RequiresPermission; -import android.annotation.StringDef; import android.annotation.SystemApi; import android.annotation.SystemService; import android.annotation.TestApi; @@ -134,14 +133,17 @@ public final class TvInputManager { public @interface VideoUnavailableReason {} /** Indicates that this TV message contains watermarking data */ - public static final String TV_MESSAGE_TYPE_WATERMARK = "Watermark"; + public static final int TV_MESSAGE_TYPE_WATERMARK = 1; /** Indicates that this TV message contains Closed Captioning data */ - public static final String TV_MESSAGE_TYPE_CLOSED_CAPTION = "CC"; + public static final int TV_MESSAGE_TYPE_CLOSED_CAPTION = 2; + + /** Indicates that this TV message contains other data */ + public static final int TV_MESSAGE_TYPE_OTHER = 1000; /** @hide */ @Retention(RetentionPolicy.SOURCE) - @StringDef({TV_MESSAGE_TYPE_WATERMARK, TV_MESSAGE_TYPE_CLOSED_CAPTION}) + @IntDef({TV_MESSAGE_TYPE_WATERMARK, TV_MESSAGE_TYPE_CLOSED_CAPTION, TV_MESSAGE_TYPE_OTHER}) public @interface TvMessageType {} /** @@ -802,7 +804,7 @@ public final class TvInputManager { * @param type The type of message received, such as {@link #TV_MESSAGE_TYPE_WATERMARK} * @param data The raw data of the message */ - public void onTvMessage(Session session, @TvInputManager.TvMessageType String type, + public void onTvMessage(Session session, @TvInputManager.TvMessageType int type, Bundle data) { } @@ -1081,7 +1083,7 @@ public final class TvInputManager { }); } - void postTvMessage(String type, Bundle data) { + void postTvMessage(int type, Bundle data) { mHandler.post(new Runnable() { @Override public void run() { @@ -1620,7 +1622,7 @@ public final class TvInputManager { } @Override - public void onTvMessage(String type, Bundle data, int seq) { + public void onTvMessage(int type, Bundle data, int seq) { synchronized (mSessionCallbackRecordMap) { SessionCallbackRecord record = mSessionCallbackRecordMap.get(seq); if (record == null) { @@ -3230,7 +3232,7 @@ public final class TvInputManager { /** * Sends TV messages to the service for testing purposes */ - public void notifyTvMessage(@NonNull @TvMessageType String type, @NonNull Bundle data) { + public void notifyTvMessage(@NonNull @TvMessageType int type, @NonNull Bundle data) { try { mService.notifyTvMessage(mToken, type, data, mUserId); } catch (RemoteException e) { diff --git a/media/java/android/media/tv/TvInputService.java b/media/java/android/media/tv/TvInputService.java index afc124028ce2b..3c6ed91d21002 100644 --- a/media/java/android/media/tv/TvInputService.java +++ b/media/java/android/media/tv/TvInputService.java @@ -1032,7 +1032,7 @@ public abstract class TvInputService extends Service { * {@link TvInputManager#TV_MESSAGE_TYPE_WATERMARK} * @param data The data sent with the message. */ - public void notifyTvMessage(@NonNull @TvInputManager.TvMessageType String type, + public void notifyTvMessage(@TvInputManager.TvMessageType int type, @NonNull Bundle data) { executeOrPostRunnableOnMainThread(new Runnable() { @MainThread @@ -1486,11 +1486,12 @@ public abstract class TvInputService extends Service { /** * Called when the application enables or disables the detection of the specified message * type. - * @param type The {@link TvInputManager.TvMessageType} of message that was sent. + * @param type The type of message received, such as + * {@link TvInputManager#TV_MESSAGE_TYPE_WATERMARK} * @param enabled {@code true} if TV message detection is enabled, * {@code false} otherwise. */ - public void onSetTvMessageEnabled(@NonNull @TvInputManager.TvMessageType String type, + public void onSetTvMessageEnabled(@TvInputManager.TvMessageType int type, boolean enabled) { } @@ -1856,9 +1857,9 @@ public abstract class TvInputService extends Service { } /** - * Calls {@link #onSetTvMessageEnabled(String, boolean)}. + * Calls {@link #onSetTvMessageEnabled(int, boolean)}. */ - void setTvMessageEnabled(String type, boolean enabled) { + void setTvMessageEnabled(int type, boolean enabled) { onSetTvMessageEnabled(type, enabled); } diff --git a/media/java/android/media/tv/TvView.java b/media/java/android/media/tv/TvView.java index 5aeed1fbbaf5f..19a2e5d8d1570 100644 --- a/media/java/android/media/tv/TvView.java +++ b/media/java/android/media/tv/TvView.java @@ -648,7 +648,7 @@ public class TvView extends ViewGroup { * @hide */ @TestApi - public void notifyTvMessage(@TvInputManager.TvMessageType @NonNull String type, + public void notifyTvMessage(@TvInputManager.TvMessageType int type, @NonNull Bundle data) { if (mSession != null) { mSession.notifyTvMessage(type, data); @@ -738,11 +738,12 @@ public class TvView extends ViewGroup { /** * Enables or disables TV message detection in the stream of the bound TV input. * - * @param type The type of {@link android.media.tv.TvInputManager.TvMessageType} + * @param type The type of message received, such as + * {@link TvInputManager#TV_MESSAGE_TYPE_WATERMARK} * @param enabled {@code true} if you want to enable TV message detection * {@code false} otherwise. */ - public void setTvMessageEnabled(@NonNull @TvInputManager.TvMessageType String type, + public void setTvMessageEnabled(@TvInputManager.TvMessageType int type, boolean enabled) { } @@ -1251,11 +1252,12 @@ public class TvView extends ViewGroup { * This is called when a new TV Message has been received. * * @param inputId The ID of the TV input bound to this view. - * @param type The type of {@link android.media.tv.TvInputManager.TvMessageType} + * @param type The type of message received, such as + * {@link TvInputManager#TV_MESSAGE_TYPE_WATERMARK} * @param data The raw data of the message */ public void onTvMessage(@NonNull String inputId, - @NonNull @TvInputManager.TvMessageType String type, @NonNull Bundle data) { + @TvInputManager.TvMessageType int type, @NonNull Bundle data) { } } @@ -1670,7 +1672,7 @@ public class TvView extends ViewGroup { } @Override - public void onTvMessage(Session session, String type, Bundle data) { + public void onTvMessage(Session session, int type, Bundle data) { if (DEBUG) { Log.d(TAG, "onTvMessage(type=" + type + ", data=" + data + ")"); } diff --git a/media/java/android/media/tv/interactive/ITvInteractiveAppManager.aidl b/media/java/android/media/tv/interactive/ITvInteractiveAppManager.aidl index 89847a73ccded..41cbe4ae02d0c 100644 --- a/media/java/android/media/tv/interactive/ITvInteractiveAppManager.aidl +++ b/media/java/android/media/tv/interactive/ITvInteractiveAppManager.aidl @@ -94,7 +94,7 @@ interface ITvInteractiveAppManager { void notifyRecordingStarted(in IBinder sessionToken, in String recordingId, String requestId, int userId); void notifyRecordingStopped(in IBinder sessionToken, in String recordingId, int userId); - void notifyTvMessage(in IBinder sessionToken, in String type, in Bundle data, int userId); + void notifyTvMessage(in IBinder sessionToken, in int type, in Bundle data, int userId); void setSurface(in IBinder sessionToken, in Surface surface, int userId); void dispatchSurfaceChanged(in IBinder sessionToken, int format, int width, int height, int userId); diff --git a/media/java/android/media/tv/interactive/ITvInteractiveAppSession.aidl b/media/java/android/media/tv/interactive/ITvInteractiveAppSession.aidl index f17d1b73994ed..052bc3d5adceb 100644 --- a/media/java/android/media/tv/interactive/ITvInteractiveAppSession.aidl +++ b/media/java/android/media/tv/interactive/ITvInteractiveAppSession.aidl @@ -72,7 +72,7 @@ oneway interface ITvInteractiveAppSession { void notifySignalStrength(int strength); void notifyRecordingStarted(in String recordingId, in String requestId); void notifyRecordingStopped(in String recordingId); - void notifyTvMessage(in String type, in Bundle data); + void notifyTvMessage(int type, in Bundle data); void setSurface(in Surface surface); void dispatchSurfaceChanged(int format, int width, int height); void notifyBroadcastInfoResponse(in BroadcastInfoResponse response); diff --git a/media/java/android/media/tv/interactive/ITvInteractiveAppSessionWrapper.java b/media/java/android/media/tv/interactive/ITvInteractiveAppSessionWrapper.java index 705e6c4e960c5..d3f598a7c0094 100644 --- a/media/java/android/media/tv/interactive/ITvInteractiveAppSessionWrapper.java +++ b/media/java/android/media/tv/interactive/ITvInteractiveAppSessionWrapper.java @@ -243,7 +243,7 @@ public class ITvInteractiveAppSessionWrapper } case DO_NOTIFY_TV_MESSAGE: { SomeArgs args = (SomeArgs) msg.obj; - mSessionImpl.notifyTvMessage((String) args.arg1, (Bundle) args.arg2); + mSessionImpl.notifyTvMessage((Integer) args.arg1, (Bundle) args.arg2); args.recycle(); break; } @@ -520,7 +520,7 @@ public class ITvInteractiveAppSessionWrapper } @Override - public void notifyTvMessage(String type, Bundle data) { + public void notifyTvMessage(int type, Bundle data) { mCaller.executeOrSendMessage( mCaller.obtainMessageOO(DO_NOTIFY_TV_MESSAGE, type, data)); } diff --git a/media/java/android/media/tv/interactive/TvInteractiveAppManager.java b/media/java/android/media/tv/interactive/TvInteractiveAppManager.java index 1b26deff38226..fc8fe5c30967c 100755 --- a/media/java/android/media/tv/interactive/TvInteractiveAppManager.java +++ b/media/java/android/media/tv/interactive/TvInteractiveAppManager.java @@ -1751,7 +1751,7 @@ public final class TvInteractiveAppManager { /** * Notifies Interactive APP session when a new TV message is received. */ - public void notifyTvMessage(String type, Bundle data) { + public void notifyTvMessage(int type, Bundle data) { if (mToken == null) { Log.w(TAG, "The session has been already released"); return; diff --git a/media/java/android/media/tv/interactive/TvInteractiveAppService.java b/media/java/android/media/tv/interactive/TvInteractiveAppService.java index 012d5c1bc58be..26a0837ae4dd0 100755 --- a/media/java/android/media/tv/interactive/TvInteractiveAppService.java +++ b/media/java/android/media/tv/interactive/TvInteractiveAppService.java @@ -923,7 +923,7 @@ public abstract class TvInteractiveAppService extends Service { * {@link TvInputManager#TV_MESSAGE_TYPE_WATERMARK} * @param data The raw data of the message */ - public void onTvMessage(@NonNull @TvInputManager.TvMessageType String type, + public void onTvMessage(@TvInputManager.TvMessageType int type, @NonNull Bundle data) { } @@ -1768,7 +1768,7 @@ public abstract class TvInteractiveAppService extends Service { onAdResponse(response); } - void notifyTvMessage(String type, Bundle data) { + void notifyTvMessage(int type, Bundle data) { if (DEBUG) { Log.d(TAG, "notifyTvMessage (type=" + type + ", data= " + data + ")"); } diff --git a/media/java/android/media/tv/interactive/TvInteractiveAppView.java b/media/java/android/media/tv/interactive/TvInteractiveAppView.java index f51e8a33bc3af..1a0319bddc2d8 100755 --- a/media/java/android/media/tv/interactive/TvInteractiveAppView.java +++ b/media/java/android/media/tv/interactive/TvInteractiveAppView.java @@ -946,7 +946,7 @@ public class TvInteractiveAppView extends ViewGroup { * {@link TvInputManager#TV_MESSAGE_TYPE_WATERMARK} * @param data The raw data of the message */ - public void notifyTvMessage(@NonNull @TvInputManager.TvMessageType String type, + public void notifyTvMessage(@NonNull @TvInputManager.TvMessageType int type, @NonNull Bundle data) { if (DEBUG) { Log.d(TAG, "notifyTvMessage type=" + type diff --git a/services/core/java/com/android/server/tv/TvInputManagerService.java b/services/core/java/com/android/server/tv/TvInputManagerService.java index 11294b7c46fc5..5442b6dc4b095 100644 --- a/services/core/java/com/android/server/tv/TvInputManagerService.java +++ b/services/core/java/com/android/server/tv/TvInputManagerService.java @@ -2125,7 +2125,7 @@ public final class TvInputManagerService extends SystemService { } @Override - public void notifyTvMessage(IBinder sessionToken, String type, Bundle data, int userId) { + public void notifyTvMessage(IBinder sessionToken, int type, Bundle data, int userId) { final int callingUid = Binder.getCallingUid(); final int resolvedUserId = resolveCallingUserId(Binder.getCallingPid(), callingUid, userId, "timeShiftEnablePositionTracking"); @@ -3765,7 +3765,7 @@ public final class TvInputManagerService extends SystemService { } @Override - public void onTvMessage(String type, Bundle data) { + public void onTvMessage(int type, Bundle data) { synchronized (mLock) { if (DEBUG) { Slog.d(TAG, "onTvMessage(type=" + type + ", data=" + data + ")"); diff --git a/services/core/java/com/android/server/tv/interactive/TvInteractiveAppManagerService.java b/services/core/java/com/android/server/tv/interactive/TvInteractiveAppManagerService.java index bef349f177aab..0d4a76ee3add3 100644 --- a/services/core/java/com/android/server/tv/interactive/TvInteractiveAppManagerService.java +++ b/services/core/java/com/android/server/tv/interactive/TvInteractiveAppManagerService.java @@ -1117,7 +1117,7 @@ public class TvInteractiveAppManagerService extends SystemService { } @Override - public void notifyTvMessage(IBinder sessionToken, String type, Bundle data, int userId) { + public void notifyTvMessage(IBinder sessionToken, int type, Bundle data, int userId) { final int callingUid = Binder.getCallingUid(); final int callingPid = Binder.getCallingPid(); final int resolvedUserId = resolveCallingUserId(callingPid, callingUid, userId,