Commit 55f5143a authored by Ryan Daum's avatar Ryan Daum Committed by Commit Bot

[chromecast] Fix JNI method invoke for gesture handled callback

Follow-up after fixing the JNI classname; unfortunately previous
CL was mistakenly thought to fix the issue but the bug remained.

This CL fixes:

  * Classname signature (missing $)
  * Method signature (extraneous ';')
  * Calling method (Should be CallVoidMethod)

Tested on physical Android things device.

Bug: internal b/159235968
Test: manual on device
Change-Id: I5907ab842740e697e80d757a2f96485ba63c7f32
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2276242Reviewed-by: default avatarAlex Sakhartchouk <alexst@chromium.org>
Reviewed-by: default avatarRandy Rossi <rmrossi@chromium.org>
Commit-Queue: Ryan Daum <rdaum@chromium.org>
Cr-Commit-Position: refs/heads/master@{#784137}
parent 0decdf0e
......@@ -39,7 +39,7 @@ constexpr char kContextInteractionId[] = "interactionId";
constexpr char kContextConversationId[] = "conversationId";
constexpr char kGestureConsumedCallbackClassName[] =
"org/chromium/chromecast/shell/"
"CastWebContentsComponent.GestureHandledCallback";
"CastWebContentsComponent$GestureHandledCallback";
// Wraps the JNI gesture consumption handled callback for invocation from C++.
class GestureConsumedCallbackWrapper {
......@@ -52,11 +52,14 @@ class GestureConsumedCallbackWrapper {
base::android::GetClass(env_, kGestureConsumedCallbackClassName));
callback_method_id_ =
base::android::MethodID::Get<base::android::MethodID::TYPE_INSTANCE>(
env_, class_.obj(), "invoke", "(Z;)V");
env_, class_.obj(), "invoke",
"(Z" // boolean handled
")V");
}
void Invoke(bool handled) {
env_->CallObjectMethod(callback_.obj(), callback_method_id_, &handled);
jboolean handled_value(handled);
env_->CallVoidMethod(callback_.obj(), callback_method_id_, handled_value);
}
private:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment