Skip to content

Commit

Permalink
wip: weekend progress
Browse files Browse the repository at this point in the history
  • Loading branch information
swan-amazon committed Jul 20, 2024
1 parent 2b46d85 commit 675be40
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ class CHIPToolActivity :

override fun handleEnhancedSetupFlowClicked() {
Toast.makeText(this, "Enhanced Setup Flow", Toast.LENGTH_SHORT).show()
showFragment(DeviceProvisioningFragment.newInstance(deviceInfo!!, null))
}

override fun setNetworkType(type: ProvisionNetworkType?) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,12 @@ open class GenericChipDeviceListener : ChipDeviceController.CompletionListener {
override fun onICDRegistrationComplete(errorCode: Long, icdDeviceInfo: ICDDeviceInfo) {
// No op
}

override fun onTermsAndConditionsRequired() {
// No op
}

override fun onTermsAndConditionsRequiredComplete(termsAndConditionsAcknowledgements: Int, termsAndConditionsVersion: Int) {
// No op
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,14 @@ class DeviceProvisioningFragment : Fragment() {
.show()
}
}

override fun onTermsAndConditionsRequired() {
}

override fun onTermsAndConditionsRequiredComplete(termsAndConditionsAcknowledgements: Int, termsAndConditionsVersion: Int) {
Log.d(TAG, "onTermsAndConditionsRequiredComplete: $termsAndConditionsAcknowledgements, $termsAndConditionsVersion")
deviceController.updateTermsAndConditionsAcknowledgements(termsAndConditionsAcknowledgements, termsAndConditionsVersion)
}
}

private fun ByteArray.toHex(): String =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1847,5 +1847,8 @@ void onReadCommissioningInfo(

/** Notifies when the registration flow for the ICD completes. */
void onICDRegistrationComplete(long errorCode, ICDDeviceInfo icdDeviceInfo);

void onTermsAndConditionsRequired();
void onTermsAndConditionsRequiredComplete(int termsAndConditionsAcknowledgements, int termsAndConditionsVersion);
}
}
4 changes: 4 additions & 0 deletions src/controller/java/src/matter/controller/MatterController.kt
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ interface MatterController : Closeable, InteractionClient {
/** Notifies the Commissioner when the OpCSR for the Comissionee is generated. */
fun onOpCSRGenerationComplete(csr: ByteArray)

fun onTermsAndConditionsRequired()

fun onTermsAndConditionsComplete()

/**
* Notifies when the ICD registration information (ICD symmetric key, check-in node ID and
* monitored subject) is required.
Expand Down

0 comments on commit 675be40

Please sign in to comment.