Skip to content

Commit f4a4d1b

Browse files
Moved usage of CHIPController
1 parent 5d69666 commit f4a4d1b

File tree

4 files changed

+17
-12
lines changed

4 files changed

+17
-12
lines changed

examples/tv-casting-app/android/App/app/src/main/jni/com/matter/casting/core/CastingApp.java

-11
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
import android.content.Context;
2121
import android.util.Log;
2222
import chip.appserver.ChipAppServer;
23-
import chip.devicecontroller.ChipDeviceController;
24-
import chip.devicecontroller.ChipStructs;
2523
import chip.platform.AndroidBleManager;
2624
import chip.platform.AndroidChipPlatform;
2725
import chip.platform.ChipMdnsCallbackImpl;
@@ -67,15 +65,6 @@ public MatterError initialize(AppParameters appParameters) {
6765
return MatterError.CHIP_ERROR_INCORRECT_STATE;
6866
}
6967

70-
try
71-
{
72-
ChipDeviceController c = new ChipDeviceController(null);
73-
}
74-
catch(Throwable t)
75-
{
76-
Log.d(TAG, "Caught: " + t);
77-
}
78-
7968
this.appParameters = appParameters;
8069
this.nsdManagerResolverAvailState =
8170
new NsdManagerServiceResolver.NsdManagerResolverAvailState();

examples/tv-casting-app/android/App/app/src/main/jni/com/matter/casting/core/MatterCastingPlayer.java

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
*/
1717
package com.matter.casting.core;
1818

19+
import android.util.Log;
20+
1921
import com.matter.casting.support.EndpointFilter;
2022
import java.net.InetAddress;
2123
import java.util.List;

examples/tv-casting-app/android/App/app/src/main/jni/com/matter/casting/core/MatterCastingPlayerDiscovery.java

+14
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,13 @@
1616
*/
1717
package com.matter.casting.core;
1818

19+
import android.util.Log;
20+
1921
import com.matter.casting.support.MatterError;
2022
import java.util.List;
2123

24+
import chip.devicecontroller.ChipDeviceController;
25+
2226
/**
2327
* MatterCastingPlayerDiscovery provides an API to control Matter Casting Player discovery over
2428
* DNS-SD, and to collect discovery results. This class provides methods to add and remove a
@@ -34,6 +38,16 @@ public static MatterCastingPlayerDiscovery getInstance() {
3438
if (matterCastingPlayerDiscoveryInstance == null) {
3539
matterCastingPlayerDiscoveryInstance = new MatterCastingPlayerDiscovery();
3640
}
41+
42+
try
43+
{
44+
ChipDeviceController c = new ChipDeviceController(null);
45+
}
46+
catch(Throwable t)
47+
{
48+
Log.d(TAG, "Caught: " + t);
49+
}
50+
3751
return matterCastingPlayerDiscoveryInstance;
3852
};
3953

examples/tv-casting-app/android/App/app/src/main/jni/cpp/support/RotatingDeviceIdUniqueIdProvider-JNI.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ MutableByteSpan * RotatingDeviceIdUniqueIdProviderJNI::Get()
8484
ChipLogProgress(AppServer, "RotatingDeviceIdUniqueIdProviderJNI.Get() called");
8585
mRotatingDeviceIdUniqueIdSpan = MutableByteSpan(mRotatingDeviceIdUniqueId);
8686
CHIP_ERROR err = GetJavaByteByMethod(mGetMethod, mRotatingDeviceIdUniqueIdSpan);
87-
VerifyOrReturnValue(err != CHIP_NO_ERROR, nullptr,
87+
VerifyOrReturnValue(err == CHIP_NO_ERROR, nullptr,
8888
ChipLogError(AppServer, "Error calling GetJavaByteByMethod %" CHIP_ERROR_FORMAT, err.Format()));
8989
return &mRotatingDeviceIdUniqueIdSpan;
9090
}

0 commit comments

Comments
 (0)