OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 package org.chromium.media; |
| 6 |
| 7 import org.chromium.base.annotations.CalledByNative; |
| 8 import org.chromium.base.annotations.JNINamespace; |
| 9 |
| 10 /** |
| 11 * Callback helper for native. This works with our JNI implementation to hop |
| 12 * to the right thread for callbacks, and handle async deletion of the native |
| 13 * object. It directly implemens the aidl interface also. |
| 14 */ |
| 15 @JNINamespace("media") |
| 16 class DialogSurfaceCallback extends IDialogSurfaceCallback.Stub { |
| 17 private final long mNativeId; |
| 18 |
| 19 public DialogSurfaceCallback(long nativeId) { |
| 20 mNativeId = nativeId; |
| 21 } |
| 22 |
| 23 @CalledByNative |
| 24 public static DialogSurfaceCallback create(long nativeId) { |
| 25 return new DialogSurfaceCallback(nativeId); |
| 26 } |
| 27 |
| 28 @Override |
| 29 public void onCallback(int what) { |
| 30 nativeOnDialogSurfaceCallbackCallback(mNativeId, what); |
| 31 } |
| 32 |
| 33 private static native void nativeOnDialogSurfaceCallbackCallback(long id, in
t what); |
| 34 }; |
OLD | NEW |