Skip to content

Commit

Permalink
Android tv-casting-app: Add support for additional Media commands to …
Browse files Browse the repository at this point in the history
…JNI library (#20973) (#20981)

* Fixing break in build script for android tv-casting-app from #20422

* Android tv-casting-app: Adding support to send several Media commands

Co-authored-by: Sharad Binjola <[email protected]>
  • Loading branch information
woody-apple and sharadb-amazon authored Jul 20, 2022
1 parent 037a04c commit f309832
Show file tree
Hide file tree
Showing 8 changed files with 505 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,72 @@ public native boolean openBasicCommissioningWindow(

public native void init();

/*
* CONTENT LAUNCHER CLUSTER
*/
public native boolean contentLauncherLaunchURL(
String contentUrl, String contentDisplayStr, Object launchURLHandler);

/*
* LEVEL CONTROL CLUSTER
*/
public native boolean levelControl_step(
byte stepMode,
byte stepSize,
short transitionTime,
byte optionMask,
byte optionOverridem,
Object responseHandler);

public native boolean levelControl_moveToLevel(
byte level,
short transitionTime,
byte optionMask,
byte optionOverridem,
Object responseHandler);

/*
* MEDIA PLAYBACK CLUSTER
*/
public native boolean mediaPlayback_play(Object responseHandler);

public native boolean mediaPlayback_pause(Object responseHandler);

public native boolean mediaPlayback_stopPlayback(Object responseHandler);

public native boolean mediaPlayback_next(Object responseHandler);

public native boolean mediaPlayback_seek(long position, Object responseHandler);

public native boolean mediaPlayback_skipForward(
long deltaPositionMilliseconds, Object responseHandler);

public native boolean mediaPlayback_skipBackward(
long deltaPositionMilliseconds, Object responseHandler);

/*
* APPLICATION LAUNCHER CLUSTER
*/
public native boolean applicationLauncher_launchApp(
short catalogVendorId, String applicationId, String data, Object responseHandler);

public native boolean applicationLauncher_stopApp(
short catalogVendorId, String applicationId, Object responseHandler);

public native boolean applicationLauncher_hideApp(
short catalogVendorId, String applicationId, Object responseHandler);

/*
* TARGET NAVIGATOR CLUSTER
*/
public native boolean targetNavigator_navigateTarget(
byte target, String data, Object responseHandler);

/*
* KEYPAD INPUT CLUSTER
*/
public native boolean keypadInput_sendKey(byte keyCode, Object responseHandler);

static {
System.loadLibrary("TvCastingApp");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* Copyright (c) 2022 Project CHIP Authors
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#pragma once

enum MediaCommandName
{
ContentLauncher_LaunchURL,
ContentLauncher_LaunchContent,
LevelControl_Step,
LevelControl_MoveToLevel,
MediaPlayback_Play,
MediaPlayback_Pause,
MediaPlayback_StopPlayback,
MediaPlayback_Next,
MediaPlayback_Seek,
MediaPlayback_SkipForward,
MediaPlayback_SkipBackward,
ApplicationLauncher_LaunchApp,
ApplicationLauncher_StopApp,
ApplicationLauncher_HideApp,
TargetNavigator_NavigateTarget,
KeypadInput_SendKey,

MEDIA_COMMAND_COUNT
};
Loading

0 comments on commit f309832

Please sign in to comment.