commit | 38b15a8845142b1786531ce222283c1705ccc2d4 | [log] [tgz] |
---|---|---|
author | Josh Yang <yzj@google.com> | Mon Aug 17 16:13:40 2020 -0700 |
committer | Haiping Yang <haiping@google.com> | Fri Apr 09 00:53:36 2021 +0000 |
tree | fd5db6856842c644b240e13d9450df1ae34b6b77 | |
parent | 5efefe36b8d037022276bd1a2d4421f1e3d57487 [diff] |
Manual cp of ag/9958222 Grant focus to list view in Rington selection Activity This allows the RSB to work properly in this activity. Test: unable to test because salmon has no RSB and speaker Change-Id: I7cd8470f9cfc0b2441b1de09f4c52ecc85efd84e
diff --git a/packages/SoundPicker/src/com/android/soundpicker/RingtonePickerActivity.java b/packages/SoundPicker/src/com/android/soundpicker/RingtonePickerActivity.java index 504e18a..56b940c 100644 --- a/packages/SoundPicker/src/com/android/soundpicker/RingtonePickerActivity.java +++ b/packages/SoundPicker/src/com/android/soundpicker/RingtonePickerActivity.java
@@ -256,6 +256,14 @@ } setupAlert(); + + ListView listView = mAlert.getListView(); + if (listView != null) { + // List view needs to gain focus in order for RSB to work. + if (!listView.requestFocus()) { + Log.e(TAG, "Unable to gain focus! RSB may not work properly."); + } + } } @Override public void onSaveInstanceState(Bundle outState) {