Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 024e5c23 authored by Alice Kuo's avatar Alice Kuo
Browse files

LeAudioTestApp: Add group id input support for lock/unlock button

If the remote device doesn't support CAS, we could assign group id 2 for standalone CSIP group for test

Bug: 230426955
Test: assign group id for set member lock/unlock
Change-Id: I4a75924b743760f81f23556de00793d55f32f55f
parent da9bfe44
Loading
Loading
Loading
Loading
+32 −8
Original line number Diff line number Diff line
@@ -1262,19 +1262,43 @@ public class LeAudioRecycleViewAdapter
            });

            leAudioSetLockButton.setOnClickListener(view -> {
                final Integer group_id =
                        Integer.parseInt(ViewHolder.this.leAudioGroupIdText.getText().toString());
                AlertDialog.Builder alert = new AlertDialog.Builder(itemView.getContext());
                alert.setTitle("Pick a group ID");
                final EditText input = new EditText(itemView.getContext());
                input.setInputType(InputType.TYPE_CLASS_NUMBER);
                input.setRawInputType(Configuration.KEYBOARD_12KEY);
                alert.setView(input);
                alert.setPositiveButton("Ok", (dialog, whichButton) -> {
                    final Integer group_id = Integer.valueOf(input.getText().toString());
                    if (leAudioInteractionListener != null)
                        leAudioInteractionListener.onGroupSetLockClicked(
                            devices.get(ViewHolder.this.getAdapterPosition()), group_id, true);

                });
                alert.setNegativeButton("Cancel", (dialog, whichButton) -> {
                    // Do nothing
                });
                alert.show();
            });

            leAudioSetUnlockButton.setOnClickListener(view -> {
                final Integer group_id =
                        Integer.parseInt(ViewHolder.this.leAudioGroupIdText.getText().toString());
                AlertDialog.Builder alert = new AlertDialog.Builder(itemView.getContext());
                alert.setTitle("Pick a group ID");
                final EditText input = new EditText(itemView.getContext());
                input.setInputType(InputType.TYPE_CLASS_NUMBER);
                input.setRawInputType(Configuration.KEYBOARD_12KEY);
                alert.setView(input);
                alert.setPositiveButton("Ok", (dialog, whichButton) -> {
                    final Integer group_id = Integer.valueOf(input.getText().toString());
                    if (leAudioInteractionListener != null)
                        leAudioInteractionListener.onGroupSetLockClicked(
                            devices.get(ViewHolder.this.getAdapterPosition()), group_id, false);

                });
                alert.setNegativeButton("Cancel", (dialog, whichButton) -> {
                    // Do nothing
                });
                alert.show();
            });

            leAudioGroupMicrophoneSwitch.setOnCheckedChangeListener((compoundButton, b) -> {