Merge "Address small comments from http://ag/13957078" into sc-dev
This commit is contained in:
@@ -160,11 +160,18 @@ public class CarrierTextManager {
|
|||||||
*
|
*
|
||||||
* @param separator Separator between different parts of the text
|
* @param separator Separator between different parts of the text
|
||||||
*/
|
*/
|
||||||
private CarrierTextManager(Context context, CharSequence separator, boolean showAirplaneMode,
|
private CarrierTextManager(
|
||||||
boolean showMissingSim, @Nullable WifiManager wifiManager,
|
Context context,
|
||||||
TelephonyManager telephonyManager, TelephonyListenerManager telephonyListenerManager,
|
CharSequence separator,
|
||||||
WakefulnessLifecycle wakefulnessLifecycle, @Main Executor mainExecutor,
|
boolean showAirplaneMode,
|
||||||
@Background Executor bgExecutor, KeyguardUpdateMonitor keyguardUpdateMonitor) {
|
boolean showMissingSim,
|
||||||
|
@Nullable WifiManager wifiManager,
|
||||||
|
TelephonyManager telephonyManager,
|
||||||
|
TelephonyListenerManager telephonyListenerManager,
|
||||||
|
WakefulnessLifecycle wakefulnessLifecycle,
|
||||||
|
@Main Executor mainExecutor,
|
||||||
|
@Background Executor bgExecutor,
|
||||||
|
KeyguardUpdateMonitor keyguardUpdateMonitor) {
|
||||||
mContext = context;
|
mContext = context;
|
||||||
mIsEmergencyCallCapable = telephonyManager.isVoiceCapable();
|
mIsEmergencyCallCapable = telephonyManager.isVoiceCapable();
|
||||||
|
|
||||||
@@ -633,12 +640,15 @@ public class CarrierTextManager {
|
|||||||
private boolean mShowMissingSim;
|
private boolean mShowMissingSim;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public Builder(Context context, @Main Resources resources,
|
public Builder(
|
||||||
|
Context context,
|
||||||
|
@Main Resources resources,
|
||||||
@Nullable WifiManager wifiManager,
|
@Nullable WifiManager wifiManager,
|
||||||
TelephonyManager telephonyManager,
|
TelephonyManager telephonyManager,
|
||||||
TelephonyListenerManager telephonyListenerManager,
|
TelephonyListenerManager telephonyListenerManager,
|
||||||
WakefulnessLifecycle wakefulnessLifecycle,
|
WakefulnessLifecycle wakefulnessLifecycle,
|
||||||
@Main Executor mainExecutor, @Background Executor bgExecutor,
|
@Main Executor mainExecutor,
|
||||||
|
@Background Executor bgExecutor,
|
||||||
KeyguardUpdateMonitor keyguardUpdateMonitor) {
|
KeyguardUpdateMonitor keyguardUpdateMonitor) {
|
||||||
mContext = context;
|
mContext = context;
|
||||||
mSeparator = resources.getString(
|
mSeparator = resources.getString(
|
||||||
@@ -668,8 +678,8 @@ public class CarrierTextManager {
|
|||||||
public CarrierTextManager build() {
|
public CarrierTextManager build() {
|
||||||
return new CarrierTextManager(
|
return new CarrierTextManager(
|
||||||
mContext, mSeparator, mShowAirplaneMode, mShowMissingSim, mWifiManager,
|
mContext, mSeparator, mShowAirplaneMode, mShowMissingSim, mWifiManager,
|
||||||
mTelephonyManager, mTelephonyListenerManager,
|
mTelephonyManager, mTelephonyListenerManager, mWakefulnessLifecycle,
|
||||||
mWakefulnessLifecycle, mMainExecutor, mBgExecutor, mKeyguardUpdateMonitor);
|
mMainExecutor, mBgExecutor, mKeyguardUpdateMonitor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -28,6 +28,12 @@ import java.util.List;
|
|||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class for use by {@link TelephonyListenerManager} to centralize TelephonyManager Callbacks.
|
||||||
|
*
|
||||||
|
* There are more callback interfaces defined in {@link android.telephony.TelephonyCallback} that
|
||||||
|
* are not currently covered. Add them here if they ever become necessary.
|
||||||
|
*/
|
||||||
class TelephonyCallback extends android.telephony.TelephonyCallback
|
class TelephonyCallback extends android.telephony.TelephonyCallback
|
||||||
implements ActiveDataSubscriptionIdListener, CallStateListener, ServiceStateListener {
|
implements ActiveDataSubscriptionIdListener, CallStateListener, ServiceStateListener {
|
||||||
|
|
||||||
|
|||||||
@@ -47,7 +47,9 @@ public class TelephonyListenerManager {
|
|||||||
private boolean mListening = false;
|
private boolean mListening = false;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public TelephonyListenerManager(TelephonyManager telephonyManager, @Main Executor executor,
|
public TelephonyListenerManager(
|
||||||
|
TelephonyManager telephonyManager,
|
||||||
|
@Main Executor executor,
|
||||||
TelephonyCallback telephonyCallback) {
|
TelephonyCallback telephonyCallback) {
|
||||||
mTelephonyManager = telephonyManager;
|
mTelephonyManager = telephonyManager;
|
||||||
mExecutor = executor;
|
mExecutor = executor;
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ import androidx.test.runner.AndroidJUnit4;
|
|||||||
|
|
||||||
import com.android.systemui.SysuiTestCase;
|
import com.android.systemui.SysuiTestCase;
|
||||||
|
|
||||||
import org.junit.Before;
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
@@ -36,7 +35,7 @@ import org.junit.runner.RunWith;
|
|||||||
public class TelephonyCallbackTest extends SysuiTestCase {
|
public class TelephonyCallbackTest extends SysuiTestCase {
|
||||||
|
|
||||||
private TelephonyCallback mTelephonyCallback = new TelephonyCallback();
|
private TelephonyCallback mTelephonyCallback = new TelephonyCallback();
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testAddListener_ActiveDataSubscriptionIdListener() {
|
public void testAddListener_ActiveDataSubscriptionIdListener() {
|
||||||
assertThat(mTelephonyCallback.hasAnyListeners()).isFalse();
|
assertThat(mTelephonyCallback.hasAnyListeners()).isFalse();
|
||||||
|
|||||||
Reference in New Issue
Block a user