Skip to content

Commit

Permalink
Fix kotlin static code analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
joonhaengHeo committed Sep 21, 2023
1 parent ebb365c commit 588da6a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.google.chip.chiptool.clusterclient

import android.content.Context
import android.os.Bundle
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
Expand Down Expand Up @@ -61,7 +62,9 @@ class AddressUpdateFragment : Fragment() {
binding.deviceIdEd.setText(deviceIdList[position].toULong(16).toString())
}

override fun onNothingSelected(parent: AdapterView<*>?) {}
override fun onNothingSelected(parent: AdapterView<*>?) {
Log.d(TAG, "onNothingSelected")
}
}
}

Expand All @@ -81,6 +84,7 @@ class AddressUpdateFragment : Fragment() {
}

companion object {
private const val TAG = "AddressUpdateFragment"
// Refer from NodeId.h (src/lib/core/NodeId.h)
private const val MIN_GROUP_NODE_ID = 0xFFFF_FFFF_FFFF_0000UL
private const val MASK_GROUP_ID = 0x0000_0000_0000_FFFFUL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,14 +296,14 @@ class GroupSettingFragment : Fragment() {
ClusterIDMapping.GroupKeyManagement.KeySetWriteCommandField.GroupKeySet.id
)
)
put(ContextSpecificTag(0), keySetId)
put(ContextSpecificTag(1), keyPolicy)
put(ContextSpecificTag(2), epochKey0)
put(ContextSpecificTag(3), epochStartTime0)
put(ContextSpecificTag(4), epochKey1)
put(ContextSpecificTag(5), epochStartTime1)
put(ContextSpecificTag(6), epochKey2)
put(ContextSpecificTag(7), epochStartTime2)
put(ContextSpecificTag(0 /* keySetId */), keySetId)
put(ContextSpecificTag(1 /* keyPolicy */), keyPolicy)
put(ContextSpecificTag(2 /* epochKey0 */), epochKey0)
put(ContextSpecificTag(3 /* epochStartTime0 */), epochStartTime0)
put(ContextSpecificTag(4 /* epochKey1 */), epochKey1)
put(ContextSpecificTag(5 /* epochStartTime1 */), epochStartTime1)
put(ContextSpecificTag(6 /* epochKey2 */), epochKey2)
put(ContextSpecificTag(7 /* epochStartTime2 */), epochStartTime2)
endStructure()
endStructure()
}
Expand Down Expand Up @@ -604,8 +604,6 @@ class GroupSettingFragment : Fragment() {
}

inner class ChipControllerCallback : GenericChipDeviceListener() {
override fun onConnectDeviceComplete() {}

override fun onCommissioningComplete(nodeId: Long, errorCode: Int) {
Log.d(TAG, "onCommissioningComplete for nodeId $nodeId: $errorCode")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ object DeviceIdUtil {

fun setCommissionedNodeId(context: Context, nodeId: Long) {
val nodeList = getCommissionedNodeId(context)
nodeList.add(nodeId.toULong().toString(16))
nodeList.add(nodeId.toULong().toString(16 /* hex */))

getPrefs(context).edit().putStringSet(DEVICE_ID_LIST_PREFS_KEY, nodeList.toSet()).apply()
}
Expand Down

0 comments on commit 588da6a

Please sign in to comment.