Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix an issue where the message queue fails to queue in the looper thr…

…eads because they are not created.

o related-to-bug: 6293875

Change-Id: I03dbb2782bd90f88d1f8df086b8a529730afe5dc
  • Loading branch information...
commit 011385508726fef027641fcbb3e4e446efc9af2c 1 parent a08dc5d
James Dong authored
Showing with 17 additions and 15 deletions.
  1. +17 −15 drm/java/android/drm/DrmManagerClient.java
View
32 drm/java/android/drm/DrmManagerClient.java
@@ -242,6 +242,7 @@ public void handleMessage(Message msg) {
public DrmManagerClient(Context context) {
mContext = context;
mReleased = false;
+ createEventThreads();
// save the unique id
mUniqueId = _initialize();
@@ -283,21 +284,6 @@ public void release() {
_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 @@ private native DrmConvertedStatus _convertData(
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));
+ }
}
Please sign in to comment.
Something went wrong with that request. Please try again.