Merge "Update comment and make change backward compatible." am: 176fca7d51
Change-Id: I2cf216d73a106b5e6bc6c036f504368dfd247ccb
diff --git a/src/java/android/net/rtp/AudioGroup.java b/src/java/android/net/rtp/AudioGroup.java
index 697c3ab..9d96006 100644
--- a/src/java/android/net/rtp/AudioGroup.java
+++ b/src/java/android/net/rtp/AudioGroup.java
@@ -114,8 +114,7 @@
/**
* Creates an empty AudioGroup.
- * @param context Context used to get package name. If context is null, app ops checks will
- * fail and as a result {@link AudioStream#join(AudioGroup)} may fail.
+ * @param context Context used to get package name
*/
public AudioGroup(@NonNull Context context) {
mContext = context;
@@ -168,7 +167,8 @@
long id = nativeAdd(stream.getMode(), stream.getSocket(),
stream.getRemoteAddress().getHostAddress(),
stream.getRemotePort(), codecSpec, stream.getDtmfType(),
- mContext != null ? mContext.getOpPackageName() : null);
+ mContext != null ? mContext.getOpPackageName()
+ : ActivityThread.currentOpPackageName());
mStreams.put(stream, id);
} catch (NullPointerException e) {
throw new IllegalStateException(e);