Replace API v23 calls.

R=jiayl@webrtc.org

Review URL: https://codereview.webrtc.org/1396373002 .

Cr-Commit-Position: refs/heads/master@{#10257}
This commit is contained in:
Alex Glaznev
2015-10-12 13:56:20 -07:00
parent e2524bad1d
commit a5b62d987a

View File

@ -105,7 +105,7 @@ final class SurfaceTextureHelper {
private boolean isQuitting = false;
private SurfaceTextureHelper(EGLContext sharedContext, Handler handler, boolean isOwningThread) {
if (!handler.getLooper().isCurrentThread()) {
if (handler.getLooper().getThread() != Thread.currentThread()) {
throw new IllegalStateException("SurfaceTextureHelper must be created on the handler thread");
}
this.handler = handler;
@ -169,7 +169,7 @@ final class SurfaceTextureHelper {
* onTextureFrameAvailable() after this function returns.
*/
public void disconnect() {
if (handler.getLooper().isCurrentThread()) {
if (handler.getLooper().getThread() == Thread.currentThread()) {
isQuitting = true;
if (!isTextureInUse) {
release();
@ -190,7 +190,7 @@ final class SurfaceTextureHelper {
}
private void tryDeliverTextureFrame() {
if (!handler.getLooper().isCurrentThread()) {
if (handler.getLooper().getThread() != Thread.currentThread()) {
throw new IllegalStateException("Wrong thread.");
}
if (isQuitting || !hasPendingTexture || isTextureInUse) {
@ -211,7 +211,7 @@ final class SurfaceTextureHelper {
}
private void release() {
if (!handler.getLooper().isCurrentThread()) {
if (handler.getLooper().getThread() != Thread.currentThread()) {
throw new IllegalStateException("Wrong thread.");
}
if (isTextureInUse || !isQuitting) {