From 4f6307cd3784a53a76f3e51747bfb06866dad3b2 Mon Sep 17 00:00:00 2001 From: roldenburg Date: Thu, 7 Dec 2017 14:09:24 -0800 Subject: Add isActivated check to Duo interface Bug: 70034799 Test: GoogleCallLogAdapterTest PiperOrigin-RevId: 178292533 Change-Id: I9769a7fbe0edcc42eff99d636334a0c2eaf14779 --- java/com/android/dialer/duo/Duo.java | 6 ++++++ java/com/android/dialer/duo/stub/DuoStub.java | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/java/com/android/dialer/duo/Duo.java b/java/com/android/dialer/duo/Duo.java index 839c1d3a8..ff694c053 100644 --- a/java/com/android/dialer/duo/Duo.java +++ b/java/com/android/dialer/duo/Duo.java @@ -31,6 +31,12 @@ public interface Duo { boolean isEnabled(); + /** + * @return true if Duo is installed and the user has gone through the set-up flow confirming their + * phone number. + */ + boolean isActivated(@NonNull Context context); + @MainThread boolean isReachable(@NonNull Context context, @Nullable String number); diff --git a/java/com/android/dialer/duo/stub/DuoStub.java b/java/com/android/dialer/duo/stub/DuoStub.java index 82b9c79e3..7cc8f7808 100644 --- a/java/com/android/dialer/duo/stub/DuoStub.java +++ b/java/com/android/dialer/duo/stub/DuoStub.java @@ -40,6 +40,11 @@ public class DuoStub implements Duo { return false; } + @Override + public boolean isActivated(@NonNull Context context) { + return false; + } + @MainThread @Override public boolean isReachable(@NonNull Context context, @Nullable String number) { -- cgit v1.2.3