Fix preferences under Related category can not launch its own page in bluetooth device details page
Root Cause: KeyboardSettingsPreferenceController override handlePreferenceTreeClick() without checking the preference key, it will lead to handle all preferences' click action. Solution: Check the preference is the expected preference key Bug: 264017256 Test: make RunSettingsRoboTests ROBOTEST_FILTER=KeyboardSettingsPreferenceControllerTest Change-Id: Idcdadc323df5b758b4b21329227e2bb721b1c394
This commit is contained in:
@@ -50,6 +50,10 @@ public class KeyboardSettingsPreferenceController extends BasePreferenceControll
|
||||
|
||||
@Override
|
||||
public boolean handlePreferenceTreeClick(Preference preference) {
|
||||
if (!getPreferenceKey().equals(preference.getKey())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final Intent intent = new Intent(Settings.ACTION_HARD_KEYBOARD_SETTINGS);
|
||||
intent.setClass(mContext, PhysicalKeyboardActivity.class);
|
||||
intent.putExtra(PhysicalKeyboardFragment.EXTRA_BT_ADDRESS, mCachedDevice.getAddress());
|
||||
|
Reference in New Issue
Block a user