Refactor nfc preference controller

- Remove BaseNfcPreferenceController.
- NfcPreferenceController inherit from TogglePreferenceController.
- AndroidBeamPreferenceController inherit from BasePreferenceController.
- Override getIntentFilter in NfcPreferenceController to listen changes.
- Add an API (hasAsyncUpdate) into BasePreferenceController to
distinguish the setting which is updated asynchronously.

Change-Id: I1abe4410169e305a0d6106e24c54e7f2e763fc91
Merged-In: I7c9c48ea7f1ad01a02524beabf9d30baa3db891f
Fixes: 67997761
Fixes: 74887543
Test: RunSettingsRoboTests
This commit is contained in:
Chihhang Chuang
2018-03-29 17:26:04 +08:00
parent 5a0a7ef4bb
commit 6719a9b73e
19 changed files with 471 additions and 221 deletions

View File

@@ -246,6 +246,16 @@ public abstract class BasePreferenceController extends AbstractPreferenceControl
return false;
}
/**
* @return {@code true} if the setting update asynchronously.
* <p>
* For example, a Wifi controller would return true, because it needs to update the radio
* and wait for it to turn on.
*/
public boolean hasAsyncUpdate() {
return false;
}
/**
* Updates non-indexable keys for search provider.
*