Merge "[Settings] Code refactor for IMS part"
This commit is contained in:
@@ -47,13 +47,15 @@ abstract class ImsQueryController {
|
||||
mTransportType = transportType;
|
||||
}
|
||||
|
||||
abstract boolean isEnabledByUser(int subId);
|
||||
|
||||
@VisibleForTesting
|
||||
ImsQuery isTtyOnVolteEnabled(int subId) {
|
||||
return new ImsQueryTtyOnVolteStat(subId);
|
||||
boolean isTtyOnVolteEnabled(int subId) {
|
||||
return (new ImsQueryTtyOnVolteStat(subId)).query();
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
ImsQuery isProvisionedOnDevice(int subId) {
|
||||
return new ImsQueryProvisioningStat(subId, mCapability, mTech);
|
||||
boolean isProvisionedOnDevice(int subId) {
|
||||
return (new ImsQueryProvisioningStat(subId, mCapability, mTech)).query();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,8 +55,8 @@ public class VolteQueryImsState extends ImsQueryController {
|
||||
* Implementation of ImsQueryController#isEnabledByUser(int subId)
|
||||
*/
|
||||
@VisibleForTesting
|
||||
ImsQuery isEnabledByUser(int subId) {
|
||||
return new ImsQueryEnhanced4gLteModeUserSetting(subId);
|
||||
boolean isEnabledByUser(int subId) {
|
||||
return (new ImsQueryEnhanced4gLteModeUserSetting(subId)).query();
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
@@ -77,7 +77,7 @@ public class VolteQueryImsState extends ImsQueryController {
|
||||
}
|
||||
|
||||
return imsManager.isVolteEnabledByPlatform()
|
||||
&& isProvisionedOnDevice(mSubId).query();
|
||||
&& isProvisionedOnDevice(mSubId);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -101,7 +101,7 @@ public class VolteQueryImsState extends ImsQueryController {
|
||||
}
|
||||
|
||||
return ((!isTtyEnabled(mContext))
|
||||
|| (isTtyOnVolteEnabled(mSubId).query()));
|
||||
|| (isTtyOnVolteEnabled(mSubId)));
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
@@ -119,6 +119,6 @@ public class VolteQueryImsState extends ImsQueryController {
|
||||
if (!SubscriptionManager.isValidSubscriptionId(mSubId)) {
|
||||
return false;
|
||||
}
|
||||
return isEnabledByUser(mSubId).query();
|
||||
return isEnabledByUser(mSubId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,8 +55,8 @@ public class VtQueryImsState extends ImsQueryController {
|
||||
* Implementation of ImsQueryController#isEnabledByUser(int subId)
|
||||
*/
|
||||
@VisibleForTesting
|
||||
ImsQuery isEnabledByUser(int subId) {
|
||||
return new ImsQueryVtUserSetting(subId);
|
||||
boolean isEnabledByUser(int subId) {
|
||||
return (new ImsQueryVtUserSetting(subId)).query();
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
@@ -77,7 +77,7 @@ public class VtQueryImsState extends ImsQueryController {
|
||||
}
|
||||
|
||||
return imsManager.isVtEnabledByPlatform()
|
||||
&& isProvisionedOnDevice(mSubId).query()
|
||||
&& isProvisionedOnDevice(mSubId)
|
||||
&& MobileNetworkUtils.isImsServiceStateReady(imsManager);
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ public class VtQueryImsState extends ImsQueryController {
|
||||
return false;
|
||||
}
|
||||
return ((!isTtyEnabled(mContext))
|
||||
|| (isTtyOnVolteEnabled(mSubId).query()));
|
||||
|| (isTtyOnVolteEnabled(mSubId)));
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
@@ -109,6 +109,6 @@ public class VtQueryImsState extends ImsQueryController {
|
||||
if (!SubscriptionManager.isValidSubscriptionId(mSubId)) {
|
||||
return false;
|
||||
}
|
||||
return isEnabledByUser(mSubId).query();
|
||||
return isEnabledByUser(mSubId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,8 +55,8 @@ public class WifiCallingQueryImsState extends ImsQueryController {
|
||||
* Implementation of ImsQueryController#isEnabledByUser(int subId)
|
||||
*/
|
||||
@VisibleForTesting
|
||||
ImsQuery isEnabledByUser(int subId) {
|
||||
return new ImsQueryWfcUserSetting(subId);
|
||||
boolean isEnabledByUser(int subId) {
|
||||
return (new ImsQueryWfcUserSetting(subId)).query();
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
@@ -77,7 +77,7 @@ public class WifiCallingQueryImsState extends ImsQueryController {
|
||||
}
|
||||
|
||||
return imsManager.isWfcEnabledByPlatform()
|
||||
&& isProvisionedOnDevice(mSubId).query();
|
||||
&& isProvisionedOnDevice(mSubId);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -101,7 +101,7 @@ public class WifiCallingQueryImsState extends ImsQueryController {
|
||||
}
|
||||
|
||||
return ((!isTtyEnabled(mContext))
|
||||
|| (isTtyOnVolteEnabled(mSubId).query()));
|
||||
|| (isTtyOnVolteEnabled(mSubId)));
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
@@ -119,6 +119,6 @@ public class WifiCallingQueryImsState extends ImsQueryController {
|
||||
if (!SubscriptionManager.isValidSubscriptionId(mSubId)) {
|
||||
return false;
|
||||
}
|
||||
return isEnabledByUser(mSubId).query();
|
||||
return isEnabledByUser(mSubId);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user