summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authoruabdullah <uabdullah@google.com>2018-06-12 10:21:22 -0700
committerCopybara-Service <copybara-piper@google.com>2018-06-12 11:41:50 -0700
commita5b8041a4c5efb933b3cb47750786ec24a095166 (patch)
treea696c0c310081a0288d68a57136e07f1b990066f /java
parent59b1a51d8a0be236f08a841fac21fcc79613d0ef (diff)
Use an activity instead of a fragment for SpeakEasySettings
Bug: 109890761,73736474,79701706 Test: Unit Tests PiperOrigin-RevId: 200237086 Change-Id: If33011f8a6477ea69f8a41d8f78ee9cf7fb51c1f
Diffstat (limited to 'java')
-rw-r--r--java/com/android/incallui/speakeasy/Annotations.java2
-rw-r--r--java/com/android/incallui/speakeasy/SpeakEasyComponent.java20
-rw-r--r--java/com/android/incallui/speakeasy/StubSpeakEasyModule.java7
3 files changed, 14 insertions, 15 deletions
diff --git a/java/com/android/incallui/speakeasy/Annotations.java b/java/com/android/incallui/speakeasy/Annotations.java
index 6d7fb4a1c..c66fe94c3 100644
--- a/java/com/android/incallui/speakeasy/Annotations.java
+++ b/java/com/android/incallui/speakeasy/Annotations.java
@@ -23,7 +23,7 @@ public final class Annotations {
/** A Speakeasy settings fragment */
@Qualifier
- public @interface SpeakEasySettingsFragment {}
+ public @interface SpeakEasySettingsActivity {}
/** A Speakeasy settings object */
@Qualifier
diff --git a/java/com/android/incallui/speakeasy/SpeakEasyComponent.java b/java/com/android/incallui/speakeasy/SpeakEasyComponent.java
index d3145949e..5d536321d 100644
--- a/java/com/android/incallui/speakeasy/SpeakEasyComponent.java
+++ b/java/com/android/incallui/speakeasy/SpeakEasyComponent.java
@@ -17,10 +17,10 @@
package com.android.incallui.speakeasy;
import android.content.Context;
-import android.preference.PreferenceFragment;
+import android.support.v7.app.AppCompatActivity;
import com.android.dialer.inject.HasRootComponent;
import com.android.incallui.speakeasy.Annotations.SpeakEasyChipResourceId;
-import com.android.incallui.speakeasy.Annotations.SpeakEasySettingsFragment;
+import com.android.incallui.speakeasy.Annotations.SpeakEasySettingsActivity;
import com.android.incallui.speakeasy.Annotations.SpeakEasySettingsObject;
import com.android.incallui.speakeasy.Annotations.SpeakEasyTextResourceId;
import com.google.common.base.Optional;
@@ -30,10 +30,16 @@ import dagger.Subcomponent;
@Subcomponent
public abstract class SpeakEasyComponent {
+ public static SpeakEasyComponent get(Context context) {
+ return ((SpeakEasyComponent.HasComponent)
+ ((HasRootComponent) context.getApplicationContext()).component())
+ .speakEasyComponent();
+ }
+
public abstract SpeakEasyCallManager speakEasyCallManager();
- public abstract @SpeakEasySettingsFragment Optional<PreferenceFragment>
- speakEasySettingsFragment();
+ public abstract @SpeakEasySettingsActivity Optional<AppCompatActivity>
+ speakEasySettingsActivity();
public abstract @SpeakEasySettingsObject Optional<Object> speakEasySettingsObject();
@@ -41,12 +47,6 @@ public abstract class SpeakEasyComponent {
public abstract @SpeakEasyTextResourceId Optional<Integer> speakEasyTextResource();
- public static SpeakEasyComponent get(Context context) {
- return ((SpeakEasyComponent.HasComponent)
- ((HasRootComponent) context.getApplicationContext()).component())
- .speakEasyComponent();
- }
-
/** Used to refer to the root application component. */
public interface HasComponent {
SpeakEasyComponent speakEasyComponent();
diff --git a/java/com/android/incallui/speakeasy/StubSpeakEasyModule.java b/java/com/android/incallui/speakeasy/StubSpeakEasyModule.java
index 9bb7783bf..bab52ffcb 100644
--- a/java/com/android/incallui/speakeasy/StubSpeakEasyModule.java
+++ b/java/com/android/incallui/speakeasy/StubSpeakEasyModule.java
@@ -16,11 +16,11 @@
package com.android.incallui.speakeasy;
-import android.preference.PreferenceFragment;
+import android.support.v7.app.AppCompatActivity;
import com.android.dialer.inject.DialerVariant;
import com.android.dialer.inject.InstallIn;
import com.android.incallui.speakeasy.Annotations.SpeakEasyChipResourceId;
-import com.android.incallui.speakeasy.Annotations.SpeakEasySettingsFragment;
+import com.android.incallui.speakeasy.Annotations.SpeakEasySettingsActivity;
import com.android.incallui.speakeasy.Annotations.SpeakEasySettingsObject;
import com.android.incallui.speakeasy.Annotations.SpeakEasyTextResourceId;
import com.google.common.base.Optional;
@@ -37,8 +37,7 @@ public abstract class StubSpeakEasyModule {
abstract SpeakEasyCallManager bindsSpeakEasy(SpeakEasyCallManagerStub stub);
@Provides
- static @SpeakEasySettingsFragment Optional<PreferenceFragment>
- provideSpeakEasySettingsFragment() {
+ static @SpeakEasySettingsActivity Optional<AppCompatActivity> provideSpeakEasySettingsActivity() {
return Optional.absent();
}