diff options
author | James Dong <jdong@google.com> | 2012-05-07 14:49:00 -0700 |
---|---|---|
committer | James Dong <jdong@google.com> | 2012-05-07 14:49:00 -0700 |
commit | 011385508726fef027641fcbb3e4e446efc9af2c (patch) | |
tree | 8e48b991e5376e4b27c1ed2b457efbc23bf2bee6 /drm/java/android | |
parent | a08dc5de8d039a4fd0a8c1286147c6afd01d2edf (diff) | |
download | frameworks_base-011385508726fef027641fcbb3e4e446efc9af2c.zip frameworks_base-011385508726fef027641fcbb3e4e446efc9af2c.tar.gz frameworks_base-011385508726fef027641fcbb3e4e446efc9af2c.tar.bz2 |
Fix an issue where the message queue fails to queue in the looper threads because they are not created.
o related-to-bug: 6293875
Change-Id: I03dbb2782bd90f88d1f8df086b8a529730afe5dc
Diffstat (limited to 'drm/java/android')
-rwxr-xr-x | drm/java/android/drm/DrmManagerClient.java | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/drm/java/android/drm/DrmManagerClient.java b/drm/java/android/drm/DrmManagerClient.java index 482ab0a..4b51994 100755 --- a/drm/java/android/drm/DrmManagerClient.java +++ b/drm/java/android/drm/DrmManagerClient.java @@ -242,6 +242,7 @@ public class DrmManagerClient { public DrmManagerClient(Context context) { mContext = context; mReleased = false; + createEventThreads(); // save the unique id mUniqueId = _initialize(); @@ -283,21 +284,6 @@ public class DrmManagerClient { _release(mUniqueId); } - - private void createListeners() { - if (mEventHandler == null && mInfoHandler == null) { - mInfoThread = new HandlerThread("DrmManagerClient.InfoHandler"); - mInfoThread.start(); - mInfoHandler = new InfoHandler(mInfoThread.getLooper()); - - mEventThread = new HandlerThread("DrmManagerClient.EventHandler"); - mEventThread.start(); - mEventHandler = new EventHandler(mEventThread.getLooper()); - _setListeners(mUniqueId, new WeakReference<DrmManagerClient>(this)); - } - } - - /** * Registers an {@link DrmManagerClient.OnInfoListener} callback, which is invoked when the * DRM framework sends status or warning information during registration or rights acquisition. @@ -878,5 +864,21 @@ public class DrmManagerClient { private native DrmConvertedStatus _closeConvertSession(int uniqueId, int convertId); private native DrmSupportInfo[] _getAllSupportInfo(int uniqueId); + + private void createEventThreads() { + if (mEventHandler == null && mInfoHandler == null) { + mInfoThread = new HandlerThread("DrmManagerClient.InfoHandler"); + mInfoThread.start(); + mInfoHandler = new InfoHandler(mInfoThread.getLooper()); + + mEventThread = new HandlerThread("DrmManagerClient.EventHandler"); + mEventThread.start(); + mEventHandler = new EventHandler(mEventThread.getLooper()); + } + } + + private void createListeners() { + _setListeners(mUniqueId, new WeakReference<DrmManagerClient>(this)); + } } |