Merge "Rename ANAS to ANS"

This commit is contained in:
Sooraj Sasindran
2018-10-06 03:41:26 +00:00
committed by Android (Google) Code Review
3 changed files with 23 additions and 24 deletions

View File

@@ -561,7 +561,7 @@ java_defaults {
"telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl",
"telephony/java/com/android/internal/telephony/ISms.aidl",
"telephony/java/com/android/internal/telephony/ISub.aidl",
"telephony/java/com/android/internal/telephony/IAnas.aidl",
"telephony/java/com/android/internal/telephony/IAns.aidl",
"telephony/java/com/android/internal/telephony/ITelephony.aidl",
"telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl",
"telephony/java/com/android/internal/telephony/IWapPushManager.aidl",

View File

@@ -17,7 +17,6 @@
package android.telephony;
import static android.content.Context.TELECOM_SERVICE;
import static com.android.internal.util.Preconditions.checkNotNull;
import android.annotation.IntDef;
@@ -67,7 +66,7 @@ import com.android.ims.internal.IImsServiceFeatureCallback;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.telecom.ITelecomService;
import com.android.internal.telephony.CellNetworkScanResult;
import com.android.internal.telephony.IAnas;
import com.android.internal.telephony.IAns;
import com.android.internal.telephony.IPhoneSubInfo;
import com.android.internal.telephony.ITelephony;
import com.android.internal.telephony.ITelephonyRegistry;
@@ -4390,8 +4389,8 @@ public class TelephonyManager {
return ITelephonyRegistry.Stub.asInterface(ServiceManager.getService("telephony.registry"));
}
private IAnas getIAnas() {
return IAnas.Stub.asInterface(ServiceManager.getService("ianas"));
private IAns getIAns() {
return IAns.Stub.asInterface(ServiceManager.getService("ians"));
}
//
@@ -8603,10 +8602,10 @@ public class TelephonyManager {
}
/**
* Enable or disable AlternativeNetworkAccessService.
* Enable or disable AlternativeNetworkService.
*
* This method should be called to enable or disable
* AlternativeNetworkAccess service on the device.
* AlternativeNetwork service on the device.
*
* <p>
* Requires Permission:
@@ -8617,25 +8616,25 @@ public class TelephonyManager {
* @hide
*/
@RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
public boolean setAlternativeNetworkAccessState(boolean enable) {
public boolean setAlternativeNetworkState(boolean enable) {
String pkgForDebug = mContext != null ? mContext.getOpPackageName() : "<unknown>";
boolean ret = false;
try {
IAnas iAlternativeAccessService = getIAnas();
if (iAlternativeAccessService != null) {
ret = iAlternativeAccessService.setEnable(enable, pkgForDebug);
IAns iAlternativeNetworkService = getIAns();
if (iAlternativeNetworkService != null) {
ret = iAlternativeNetworkService.setEnable(enable, pkgForDebug);
}
} catch (RemoteException ex) {
Rlog.e(TAG, "enableAlternativeNetworkAccess RemoteException", ex);
Rlog.e(TAG, "enableAlternativeNetwork RemoteException", ex);
}
return ret;
}
/**
* is AlternativeNetworkAccessService enabled
* is AlternativeNetworkService enabled
*
* This method should be called to determine if the AlternativeNetworkAccessService is
* This method should be called to determine if the AlternativeNetworkService is
* enabled
*
* <p>
@@ -8644,17 +8643,17 @@ public class TelephonyManager {
* @hide
*/
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
public boolean isAlternativeNetworkAccessEnabled() {
public boolean isAlternativeNetworkEnabled() {
String pkgForDebug = mContext != null ? mContext.getOpPackageName() : "<unknown>";
boolean isEnabled = false;
try {
IAnas iAlternativeAccessService = getIAnas();
if (iAlternativeAccessService != null) {
isEnabled = iAlternativeAccessService.isEnabled(pkgForDebug);
IAns iAlternativeNetworkService = getIAns();
if (iAlternativeNetworkService != null) {
isEnabled = iAlternativeNetworkService.isEnabled(pkgForDebug);
}
} catch (RemoteException ex) {
Rlog.e(TAG, "enableAlternativeNetworkAccess RemoteException", ex);
Rlog.e(TAG, "enableAlternativeNetwork RemoteException", ex);
}
return isEnabled;

View File

@@ -17,13 +17,13 @@
package com.android.internal.telephony;
interface IAnas {
interface IAns {
/**
* Enable or disable Alternative Network Access service.
* Enable or disable Alternative Network service.
*
* This method should be called to enable or disable
* AlternativeNetworkAccess service on the device.
* AlternativeNetwork service on the device.
*
* <p>
* Requires Permission:
@@ -37,9 +37,9 @@ interface IAnas {
boolean setEnable(boolean enable, String callingPackage);
/**
* is Alternative Network Access service enabled
* is Alternative Network service enabled
*
* This method should be called to determine if the Alternative Network Access service is enabled
* This method should be called to determine if the Alternative Network service is enabled
*
* <p>
* Requires Permission: