diff options
author | Svet Ganov <svetoslavganov@google.com> | 2015-05-02 16:44:34 -0700 |
---|---|---|
committer | Svet Ganov <svetoslavganov@google.com> | 2015-05-02 16:44:34 -0700 |
commit | b65349013b2ee185dd7e0793ff6cbcbd76affa3e (patch) | |
tree | 1f9865ec9737c813b4f4eac8435844792c82358e | |
parent | b0d9f5e87cd4c7dc7d1cd4a52aec3bf2e07b63d3 (diff) | |
download | voip-b65349013b2ee185dd7e0793ff6cbcbd76affa3e.tar.gz |
Use simpler API to get op package name
Change-Id: I678f5030350d0b795e46bed177e909a81536457f
-rw-r--r-- | src/java/android/net/rtp/AudioGroup.java | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/src/java/android/net/rtp/AudioGroup.java b/src/java/android/net/rtp/AudioGroup.java index da74bd6..15390d3 100644 --- a/src/java/android/net/rtp/AudioGroup.java +++ b/src/java/android/net/rtp/AudioGroup.java @@ -17,7 +17,6 @@ package android.net.rtp; import android.app.ActivityThread; -import android.app.Application; import android.media.AudioManager; import java.util.HashMap; @@ -154,7 +153,7 @@ public class AudioGroup { long id = nativeAdd(stream.getMode(), stream.getSocket(), stream.getRemoteAddress().getHostAddress(), stream.getRemotePort(), codecSpec, stream.getDtmfType(), - getMyOpPackageName()); + ActivityThread.currentOpPackageName()); mStreams.put(stream, id); } catch (NullPointerException e) { throw new IllegalStateException(e); @@ -206,15 +205,4 @@ public class AudioGroup { nativeRemove(0L); super.finalize(); } - - private static String getMyOpPackageName() { - ActivityThread activityThread = ActivityThread.currentActivityThread(); - if (activityThread != null) { - Application application = activityThread.getApplication(); - if (application != null) { - return application.getOpPackageName(); - } - } - throw new IllegalStateException("Cannot create AudioRecord outside of an app"); - } } |