diff --git a/examples/tv-casting-app/android/App/app/src/main/java/com/matter/casting/ConnectionExampleFragment.java b/examples/tv-casting-app/android/App/app/src/main/java/com/matter/casting/ConnectionExampleFragment.java index b61b63f3e0785e..5db9a3560749b5 100644 --- a/examples/tv-casting-app/android/App/app/src/main/java/com/matter/casting/ConnectionExampleFragment.java +++ b/examples/tv-casting-app/android/App/app/src/main/java/com/matter/casting/ConnectionExampleFragment.java @@ -160,13 +160,17 @@ public void handle(Void v) { Log.i( TAG, "Successfully connected to CastingPlayer with deviceId: " - + targetCastingPlayer.getDeviceId()); + + targetCastingPlayer.getDeviceId() + + ", useCommissionerGeneratedPasscode: " + + useCommissionerGeneratedPasscode); getActivity() .runOnUiThread( () -> { connectionFragmentStatusTextView.setText( "Successfully connected to Casting Player with device name: " + targetCastingPlayer.getDeviceName() + + "\n\nUsed CastingPlayer Passcode: " + + useCommissionerGeneratedPasscode + "\n\n"); connectionFragmentNextButton.setEnabled(true); }); diff --git a/examples/tv-casting-app/android/App/app/src/main/java/com/matter/casting/DiscoveryExampleFragment.java b/examples/tv-casting-app/android/App/app/src/main/java/com/matter/casting/DiscoveryExampleFragment.java index 3dca2320b8924c..64130fa94cfe7b 100644 --- a/examples/tv-casting-app/android/App/app/src/main/java/com/matter/casting/DiscoveryExampleFragment.java +++ b/examples/tv-casting-app/android/App/app/src/main/java/com/matter/casting/DiscoveryExampleFragment.java @@ -67,7 +67,8 @@ public class DiscoveryExampleFragment extends Fragment { public void onAdded(CastingPlayer castingPlayer) { Log.i( TAG, - "onAdded() Discovered CastingPlayer deviceId: " + castingPlayer.getDeviceId()); + "DiscoveryExampleFragment onAdded() Discovered CastingPlayer deviceId: " + + castingPlayer.getDeviceId()); // Display CastingPlayer info on the screen new Handler(Looper.getMainLooper()) .post( @@ -80,7 +81,7 @@ public void onAdded(CastingPlayer castingPlayer) { public void onChanged(CastingPlayer castingPlayer) { Log.i( TAG, - "onChanged() Discovered changes to CastingPlayer with deviceId: " + "DiscoveryExampleFragment onChanged() Discovered changes to CastingPlayer with deviceId: " + castingPlayer.getDeviceId()); // Update the CastingPlayer on the screen new Handler(Looper.getMainLooper()) @@ -107,7 +108,7 @@ public void onChanged(CastingPlayer castingPlayer) { public void onRemoved(CastingPlayer castingPlayer) { Log.i( TAG, - "onRemoved() Removed CastingPlayer with deviceId: " + "DiscoveryExampleFragment onRemoved() Removed CastingPlayer with deviceId: " + castingPlayer.getDeviceId()); // Remove CastingPlayer from the screen new Handler(Looper.getMainLooper()) @@ -215,7 +216,10 @@ public void onResume() { @Override public void onPause() { super.onPause(); - Log.i(TAG, "onPause() called"); + Log.i(TAG, "DiscoveryExampleFragment onPause() called, calling stopDiscovery()"); + // Stop discovery when leaving the fragment, for example, while displaying the + // ConnectionExampleFragment. + stopDiscovery(); } /** Interface for notifying the host. */ @@ -261,7 +265,7 @@ private boolean startDiscovery() { } private void stopDiscovery() { - Log.i(TAG, "stopDiscovery() called"); + Log.i(TAG, "DiscoveryExampleFragment stopDiscovery() called"); matterDiscoveryErrorMessageTextView.setText( getString(R.string.matter_discovery_error_message_initial)); diff --git a/examples/tv-casting-app/android/App/app/src/main/res/layout/custom_passcode_dialog.xml b/examples/tv-casting-app/android/App/app/src/main/res/layout/custom_passcode_dialog.xml index 1b868e06b71f29..c91fa4ad404089 100644 --- a/examples/tv-casting-app/android/App/app/src/main/res/layout/custom_passcode_dialog.xml +++ b/examples/tv-casting-app/android/App/app/src/main/res/layout/custom_passcode_dialog.xml @@ -1,5 +1,6 @@ @@ -11,7 +12,6 @@ android:textStyle="bold" android:textSize="18sp" android:padding="16dp" - android:textColor="@android:color/white" android:gravity="center" android:text="@string/matter_connection_input_dialog_title" /> @@ -24,7 +24,6 @@ android:paddingEnd="16dp" android:paddingTop="8dp" android:paddingBottom="8dp" - android:textColor="@android:color/white" android:text="@string/matter_connection_input_dialog_instructions" /> - - -