diff options
author | twyen <twyen@google.com> | 2018-01-09 17:33:48 -0800 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-01-09 18:29:31 -0800 |
commit | 06fee1b28472f1019443c9b63ea9bd8aad9f5757 (patch) | |
tree | ca5a7198d176ad17ddb3ce16d2208f6825c3a05a /java/com/android/dialer/preferredsim | |
parent | 6518fdb6a4adc054d4c9400a734cc4b194734b5c (diff) |
Allow SimSuggestionProvider to auto select phone account.
Bug: 70503524
Test: Unit tests.
PiperOrigin-RevId: 181400523
Change-Id: I07f2f2cd7c1402d1acb6bfbde9db8d90c888edf6
Diffstat (limited to 'java/com/android/dialer/preferredsim')
-rw-r--r-- | java/com/android/dialer/preferredsim/suggestion/SuggestionProvider.java | 15 | ||||
-rw-r--r-- | java/com/android/dialer/preferredsim/suggestion/stub/StubSuggestionProvider.java | 3 |
2 files changed, 16 insertions, 2 deletions
diff --git a/java/com/android/dialer/preferredsim/suggestion/SuggestionProvider.java b/java/com/android/dialer/preferredsim/suggestion/SuggestionProvider.java index 61a831b5e..c1114b3f3 100644 --- a/java/com/android/dialer/preferredsim/suggestion/SuggestionProvider.java +++ b/java/com/android/dialer/preferredsim/suggestion/SuggestionProvider.java @@ -32,17 +32,25 @@ public interface SuggestionProvider { // The SIM has the same carrier as the callee. INTRA_CARRIER, // The user has selected the SIM for the callee multiple times. - FREQUENT + FREQUENT, + // The user has select the SIM for this category of calls (contacts from certain accounts, + // etc.). + USER_SET, } /** The suggestion. */ class Suggestion { @NonNull public final PhoneAccountHandle phoneAccountHandle; @NonNull public final Reason reason; + public final boolean shouldAutoSelect; - public Suggestion(@NonNull PhoneAccountHandle phoneAccountHandle, @NonNull Reason reason) { + public Suggestion( + @NonNull PhoneAccountHandle phoneAccountHandle, + @NonNull Reason reason, + boolean shouldAutoSelect) { this.phoneAccountHandle = Assert.isNotNull(phoneAccountHandle); this.reason = Assert.isNotNull(reason); + this.shouldAutoSelect = shouldAutoSelect; } } @@ -55,4 +63,7 @@ public interface SuggestionProvider { @NonNull Context context, @NonNull String number, @NonNull PhoneAccountHandle phoneAccountHandle); + + @WorkerThread + void reportIncorrectSuggestion(@NonNull Context context, @NonNull String number); } diff --git a/java/com/android/dialer/preferredsim/suggestion/stub/StubSuggestionProvider.java b/java/com/android/dialer/preferredsim/suggestion/stub/StubSuggestionProvider.java index e3240448d..6fb73ac5d 100644 --- a/java/com/android/dialer/preferredsim/suggestion/stub/StubSuggestionProvider.java +++ b/java/com/android/dialer/preferredsim/suggestion/stub/StubSuggestionProvider.java @@ -41,4 +41,7 @@ public class StubSuggestionProvider implements SuggestionProvider { @NonNull Context context, @NonNull String number, @NonNull PhoneAccountHandle phoneAccountHandle) {} + + @Override + public void reportIncorrectSuggestion(@NonNull Context context, @NonNull String number) {} } |