diff options
author | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-02-08 02:44:24 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-02-08 02:44:24 +0000 |
commit | 3efac232a383ffb9eef1db13d7b106c02f641d61 (patch) | |
tree | 25fae956fb3bf96d4b9580620e1852596d793cac | |
parent | 399b6d28177f61911563ec4f356b79c2bafed390 (diff) | |
parent | c06672320160fb74268d5412bd6838d1e5a29479 (diff) | |
download | voip-3efac232a383ffb9eef1db13d7b106c02f641d61.tar.gz |
Merge "API review cleanups." am: 624fe0ea1e am: a52da8332b am: c066723201
Change-Id: I927414e3897da9adefe8c94d9a70f05158f71dd3
-rw-r--r-- | src/java/android/net/sip/ISipService.aidl | 2 | ||||
-rw-r--r-- | src/java/android/net/sip/SipAudioCall.java | 5 | ||||
-rw-r--r-- | src/java/android/net/sip/SipManager.java | 19 | ||||
-rw-r--r-- | src/java/android/net/sip/SipProfile.java | 3 | ||||
-rw-r--r-- | src/java/com/android/server/sip/SipService.java | 7 |
5 files changed, 29 insertions, 7 deletions
diff --git a/src/java/android/net/sip/ISipService.aidl b/src/java/android/net/sip/ISipService.aidl index f88ed6c..adbf1cb 100644 --- a/src/java/android/net/sip/ISipService.aidl +++ b/src/java/android/net/sip/ISipService.aidl @@ -39,5 +39,5 @@ interface ISipService { in ISipSessionListener listener, String opPackageName); ISipSession getPendingSession(String callId, String opPackageName); - List<SipProfile> getListOfProfiles(String opPackageName); + List<SipProfile> getProfiles(String opPackageName); } diff --git a/src/java/android/net/sip/SipAudioCall.java b/src/java/android/net/sip/SipAudioCall.java index a1a5ae8..363995c 100644 --- a/src/java/android/net/sip/SipAudioCall.java +++ b/src/java/android/net/sip/SipAudioCall.java @@ -18,6 +18,7 @@ package android.net.sip; import android.annotation.NonNull; import android.annotation.Nullable; +import android.annotation.SystemApi; import android.content.Context; import android.media.AudioManager; import android.net.rtp.AudioCodec; @@ -960,7 +961,9 @@ public class SipAudioCall { * @return the {@link AudioGroup} object or null if the RTP stream has not * yet been set up * @see #getAudioStream + * @hide */ + @SystemApi public @Nullable AudioGroup getAudioGroup() { synchronized (mLock) { if (mAudioGroup != null) return mAudioGroup; @@ -978,7 +981,9 @@ public class SipAudioCall { * settings of the first object (that merges others) override others'. * * @see #getAudioStream + * @hide */ + @SystemApi public void setAudioGroup(@NonNull AudioGroup group) { synchronized (mLock) { if (DBG) log("setAudioGroup: group=" + group); diff --git a/src/java/android/net/sip/SipManager.java b/src/java/android/net/sip/SipManager.java index 43b816b..39f66de 100644 --- a/src/java/android/net/sip/SipManager.java +++ b/src/java/android/net/sip/SipManager.java @@ -18,6 +18,7 @@ package android.net.sip; import android.annotation.NonNull; import android.annotation.SdkConstant; +import android.annotation.SystemApi; import android.app.PendingIntent; import android.content.Context; import android.content.Intent; @@ -86,15 +87,19 @@ public class SipManager { /** * Intent action sent when the SipManager becomes available. + * @hide */ @SdkConstant(SdkConstant.SdkConstantType.BROADCAST_INTENT_ACTION) + @SystemApi public static final String ACTION_SIP_SERVICE_UP = "android.net.sip.action.SIP_SERVICE_UP"; /** * Intent action sent when there is a new incoming SIP call. + * @hide */ @SdkConstant(SdkConstant.SdkConstantType.BROADCAST_INTENT_ACTION) + @SystemApi public static final String ACTION_SIP_INCOMING_CALL = "android.net.sip.action.SIP_INCOMING_CALL"; @@ -108,23 +113,29 @@ public class SipManager { /** * Intent action sent when a SIP profile has been removed. + * @hide */ @SdkConstant(SdkConstant.SdkConstantType.BROADCAST_INTENT_ACTION) + @SystemApi public static final String ACTION_SIP_REMOVE_PROFILE = "android.net.sip.action.SIP_REMOVE_PROFILE"; /** * Intent action sent when the SIP accounts or other configuration has changed. * This should trigger a re-registration of the SIP PhoneAccounts. + * @hide */ @SdkConstant(SdkConstant.SdkConstantType.BROADCAST_INTENT_ACTION) + @SystemApi public static final String ACTION_SIP_CALL_OPTION_CHANGED = "android.net.sip.action.SIP_CALL_OPTION_CHANGED"; /** * Intent action used by Telephony to start the SIP service after about. + * @hide */ @SdkConstant(SdkConstant.SdkConstantType.BROADCAST_INTENT_ACTION) + @SystemApi public static final String ACTION_START_SIP = "android.net.sip.action.START_SIP"; @@ -610,13 +621,15 @@ public class SipManager { /** * Gets the list of profiles hosted by the SIP service. The user information * (username, password and display name) are crossed out. + * @hide */ - public @NonNull List<SipProfile> getListOfProfiles() throws SipException { + @SystemApi + public @NonNull List<SipProfile> getProfiles() throws SipException { try { checkSipServiceConnection(); - return mSipService.getListOfProfiles(mContext.getOpPackageName()); + return mSipService.getProfiles(mContext.getOpPackageName()); } catch (RemoteException e) { - return new ArrayList<>(); + throw new SipException(e.getMessage()); } } diff --git a/src/java/android/net/sip/SipProfile.java b/src/java/android/net/sip/SipProfile.java index 98069c0..14b0334 100644 --- a/src/java/android/net/sip/SipProfile.java +++ b/src/java/android/net/sip/SipProfile.java @@ -16,6 +16,7 @@ package android.net.sip; +import android.annotation.SystemApi; import android.os.Parcel; import android.os.Parcelable; import android.text.TextUtils; @@ -489,7 +490,9 @@ public class SipProfile implements Parcelable, Serializable, Cloneable { * Gets the calling process's Uid in the sip settings. * * @return the calling process's Uid in the sip settings. + * @hide */ + @SystemApi public int getCallingUid() { return mCallingUid; } diff --git a/src/java/com/android/server/sip/SipService.java b/src/java/com/android/server/sip/SipService.java index 15f3cec..ca91943 100644 --- a/src/java/com/android/server/sip/SipService.java +++ b/src/java/com/android/server/sip/SipService.java @@ -129,9 +129,10 @@ public final class SipService extends ISipService.Stub { } @Override - public synchronized List<SipProfile> getListOfProfiles(String opPackageName) { - if (!canUseSip(opPackageName, "getListOfProfiles")) { - return new ArrayList<>(); + public synchronized List<SipProfile> getProfiles(String opPackageName) throws RemoteException { + if (!canUseSip(opPackageName, "getProfiles")) { + throw new RemoteException(String.format("Package %s cannot use Sip service", + opPackageName)); } boolean isCallerRadio = isCallerRadio(); ArrayList<SipProfile> profiles = new ArrayList<>(); |