Skip to content

Commit

Permalink
fix restyled-io and ci errors
Browse files Browse the repository at this point in the history
  • Loading branch information
xylophone21 committed Jan 8, 2022
1 parent 8292b3f commit 01e942a
Show file tree
Hide file tree
Showing 20 changed files with 180 additions and 173 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import com.tcl.chip.tvapp.MediaInputManagerStub;
import com.tcl.chip.tvapp.MediaPlaybackManagerStub;
import com.tcl.chip.tvapp.TvApp;
import com.tcl.chip.tvapp.TvAppCallback;
import com.tcl.chip.tvapp.WakeOnLanManagerStub;

public class MatterServant {
Expand All @@ -33,31 +32,33 @@ public static MatterServant get() {
}

public void init(@NonNull Context context) {
TvApp tvApp = new TvApp((app, clusterId, endpoint) -> {
switch (clusterId){
case Clusters.ClusterId_KeypadInput:
app.setKeypadInputManager(endpoint, new KeypadInputManagerStub(endpoint));
break;
case Clusters.ClusterId_WakeOnLan:
app.setWakeOnLanManager(endpoint, new WakeOnLanManagerStub(endpoint));
break;
case Clusters.ClusterId_MediaInput:
app.setMediaInputManager(endpoint, new MediaInputManagerStub(endpoint));
break;
case Clusters.ClusterId_ContentLauncher:
app.setContentLaunchManager(endpoint, new ContentLaunchManagerStub(endpoint));
break;
case Clusters.ClusterId_LowPower:
app.setLowPowerManager(endpoint, new LowPowerManagerStub(endpoint));
break;
case Clusters.ClusterId_MediaPlayback:
app.setMediaPlaybackManager(endpoint, new MediaPlaybackManagerStub(endpoint));
break;
case Clusters.ClusterId_Channel:
app.setChannelManager(endpoint, new ChannelManagerStub(endpoint));
break;
}
});
TvApp tvApp =
new TvApp(
(app, clusterId, endpoint) -> {
switch (clusterId) {
case Clusters.ClusterId_KeypadInput:
app.setKeypadInputManager(endpoint, new KeypadInputManagerStub(endpoint));
break;
case Clusters.ClusterId_WakeOnLan:
app.setWakeOnLanManager(endpoint, new WakeOnLanManagerStub(endpoint));
break;
case Clusters.ClusterId_MediaInput:
app.setMediaInputManager(endpoint, new MediaInputManagerStub(endpoint));
break;
case Clusters.ClusterId_ContentLauncher:
app.setContentLaunchManager(endpoint, new ContentLaunchManagerStub(endpoint));
break;
case Clusters.ClusterId_LowPower:
app.setLowPowerManager(endpoint, new LowPowerManagerStub(endpoint));
break;
case Clusters.ClusterId_MediaPlayback:
app.setMediaPlaybackManager(endpoint, new MediaPlaybackManagerStub(endpoint));
break;
case Clusters.ClusterId_Channel:
app.setChannelManager(endpoint, new ChannelManagerStub(endpoint));
break;
}
});

Context applicationContext = context.getApplicationContext();
AndroidChipPlatform chipPlatform =
Expand Down
4 changes: 2 additions & 2 deletions examples/tv-app/android/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ android_library("java") {
"java/src/com/tcl/chip/tvapp/ChannelLineupInfo.java",
"java/src/com/tcl/chip/tvapp/ChannelManager.java",
"java/src/com/tcl/chip/tvapp/ChannelManagerStub.java",
"java/src/com/tcl/chip/tvapp/Clusters.java",
"java/src/com/tcl/chip/tvapp/ContentLaunchBrandingInformation.java",
"java/src/com/tcl/chip/tvapp/ContentLaunchManager.java",
"java/src/com/tcl/chip/tvapp/ContentLaunchManagerStub.java",
Expand All @@ -102,10 +103,9 @@ android_library("java") {
"java/src/com/tcl/chip/tvapp/MediaPlaybackManager.java",
"java/src/com/tcl/chip/tvapp/MediaPlaybackManagerStub.java",
"java/src/com/tcl/chip/tvapp/TvApp.java",
"java/src/com/tcl/chip/tvapp/TvAppCallback.java",
"java/src/com/tcl/chip/tvapp/WakeOnLanManager.java",
"java/src/com/tcl/chip/tvapp/WakeOnLanManagerStub.java",
"java/src/com/tcl/chip/tvapp/TvAppCallback.java",
"java/src/com/tcl/chip/tvapp/Clusters.java",
]

javac_flags = [ "-Xlint:deprecation" ]
Expand Down
2 changes: 1 addition & 1 deletion examples/tv-app/android/java/ChannelManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void emberAfChannelClusterInitCallback(EndpointId endpoint)
void ChannelManager::NewManager(jint endpoint, jobject manager)
{
ChipLogProgress(Zcl, "TV Android App: Channel::SetDefaultDelegate");
ChannelManager* mgr = new ChannelManager();
ChannelManager * mgr = new ChannelManager();
mgr->InitializeWithObjects(manager);
chip::app::Clusters::Channel::SetDefaultDelegate(static_cast<EndpointId>(endpoint), mgr);
}
Expand Down
2 changes: 1 addition & 1 deletion examples/tv-app/android/java/ContentLauncherManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void emberAfContentLauncherClusterInitCallback(EndpointId endpoint)
void ContentLauncherManager::NewManager(jint endpoint, jobject manager)
{
ChipLogProgress(Zcl, "TV Android App: ContentLauncher::SetDefaultDelegate");
ContentLauncherManager* mgr = new ContentLauncherManager();
ContentLauncherManager * mgr = new ContentLauncherManager();
mgr->InitializeWithObjects(manager);
chip::app::Clusters::ContentLauncher::SetDelegate(static_cast<EndpointId>(endpoint), mgr);
}
Expand Down
2 changes: 1 addition & 1 deletion examples/tv-app/android/java/KeypadInputManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ void emberAfKeypadInputClusterInitCallback(EndpointId endpoint)
void KeypadInputManager::NewManager(jint endpoint, jobject manager)
{
ChipLogProgress(Zcl, "TV Android App: KeypadInput::SetDefaultDelegate");
KeypadInputManager* mgr = new KeypadInputManager();
KeypadInputManager * mgr = new KeypadInputManager();
mgr->InitializeWithObjects(manager);
chip::app::Clusters::KeypadInput::SetDefaultDelegate(static_cast<EndpointId>(endpoint), mgr);
}
Expand Down
2 changes: 1 addition & 1 deletion examples/tv-app/android/java/LowPowerManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ void emberAfLowPowerClusterInitCallback(EndpointId endpoint)
void LowPowerManager::NewManager(jint endpoint, jobject manager)
{
ChipLogProgress(Zcl, "TV Android App: LowPower::SetDefaultDelegate");
LowPowerManager* mgr = new LowPowerManager();
LowPowerManager * mgr = new LowPowerManager();
mgr->InitializeWithObjects(manager);
chip::app::Clusters::LowPower::SetDefaultDelegate(static_cast<EndpointId>(endpoint), mgr);
}
Expand Down
2 changes: 1 addition & 1 deletion examples/tv-app/android/java/MediaInputManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void emberAfMediaInputClusterInitCallback(EndpointId endpoint)
void MediaInputManager::NewManager(jint endpoint, jobject manager)
{
ChipLogProgress(Zcl, "TV Android App: MediaInput::SetDefaultDelegate");
MediaInputManager* mgr = new MediaInputManager();
MediaInputManager * mgr = new MediaInputManager();
mgr->InitializeWithObjects(manager);
chip::app::Clusters::MediaInput::SetDefaultDelegate(static_cast<EndpointId>(endpoint), mgr);
}
Expand Down
2 changes: 1 addition & 1 deletion examples/tv-app/android/java/MediaInputManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

#pragma once

#include <app/clusters/media-input-server/media-input-server.h>
#include <app/AttributeAccessInterface.h>
#include <app/clusters/media-input-server/media-input-server.h>
#include <jni.h>

class MediaInputManager : public chip::app::Clusters::MediaInput::Delegate
Expand Down
2 changes: 1 addition & 1 deletion examples/tv-app/android/java/MediaPlaybackManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void emberAfMediaPlaybackClusterInitCallback(chip::EndpointId endpoint)
void MediaPlaybackManager::NewManager(jint endpoint, jobject manager)
{
ChipLogProgress(Zcl, "TV Android App: MediaPlayback::SetDefaultDelegate");
MediaPlaybackManager* mgr = new MediaPlaybackManager();
MediaPlaybackManager * mgr = new MediaPlaybackManager();
mgr->InitializeWithObjects(manager);
chip::app::Clusters::MediaPlayback::SetDefaultDelegate(static_cast<EndpointId>(endpoint), mgr);
}
Expand Down
2 changes: 1 addition & 1 deletion examples/tv-app/android/java/TVApp-JNI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
*
*/

#include "TvApp-JNI.h"
#include "ChannelManager.h"
#include "ContentLauncherManager.h"
#include "KeypadInputManager.h"
#include "LowPowerManager.h"
#include "MediaInputManager.h"
#include "MediaPlaybackManager.h"
#include "WakeOnLanManager.h"
#include "TvApp-JNI.h"
#include <app/server/java/AndroidAppServerWrapper.h>
#include <jni.h>
#include <lib/core/CHIPError.h>
Expand Down
4 changes: 2 additions & 2 deletions examples/tv-app/android/java/TvApp-JNI.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ class TvAppJNI
friend TvAppJNI & TvAppJNIMgr();

static TvAppJNI sInstance;
jobject mTvAppObject = nullptr;
jmethodID mPostClusterInitMethod = nullptr;
jobject mTvAppObject = nullptr;
jmethodID mPostClusterInitMethod = nullptr;
};

inline class TvAppJNI & TvAppJNIMgr()
Expand Down
2 changes: 1 addition & 1 deletion examples/tv-app/android/java/WakeOnLanManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void emberAfWakeOnLanClusterInitCallback(chip::EndpointId endpoint)
void WakeOnLanManager::NewManager(jint endpoint, jobject manager)
{
ChipLogProgress(Zcl, "TV Android App: WakeOnLan::SetDefaultDelegate");
WakeOnLanManager* mgr = new WakeOnLanManager();
WakeOnLanManager * mgr = new WakeOnLanManager();
mgr->InitializeWithObjects(manager);
chip::app::Clusters::WakeOnLan::SetDefaultDelegate(static_cast<EndpointId>(endpoint), mgr);
}
Expand Down
2 changes: 1 addition & 1 deletion examples/tv-app/android/java/WakeOnLanManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class WakeOnLanManager : public chip::app::Clusters::WakeOnLan::Delegate
public:
static void NewManager(jint endpoint, jobject manager);
void InitializeWithObjects(jobject managerObject);

chip::CharSpan HandleGetMacAddress() override;

private:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,12 @@ public ChannelInfo changeChannel(String match) {
public boolean changeChannelByNumber(int majorNumber, int minorNumber) {
Log.d(
TAG,
"changeChannelByNumber: majorNumber = " + majorNumber + " minorNumber = " + minorNumber + " at " + endpoint);
"changeChannelByNumber: majorNumber = "
+ majorNumber
+ " minorNumber = "
+ minorNumber
+ " at "
+ endpoint);
return true;
}

Expand Down
Loading

0 comments on commit 01e942a

Please sign in to comment.