Merge "Move SIM_ACTIVATION_TYPE_* to TelephonyRegistryManager" am: 392f3db6b0

am: 484b1b87e0

Change-Id: I681dcc688aa1e66706c99cfa401c8b89cb6367c3
This commit is contained in:
Meng Wang
2019-12-05 17:20:49 -08:00
committed by android-build-merger
3 changed files with 27 additions and 23 deletions

View File

@@ -462,6 +462,19 @@ public class TelephonyRegistryManager {
} }
} }
/**
* Sim activation type: voice
* @see #notifyVoiceActivationStateChanged
* @hide
*/
public static final int SIM_ACTIVATION_TYPE_VOICE = 0;
/**
* Sim activation type: data
* @see #notifyDataActivationStateChanged
* @hide
*/
public static final int SIM_ACTIVATION_TYPE_DATA = 1;
/** /**
* Notify data activation state changed on certain subscription. * Notify data activation state changed on certain subscription.
* @see TelephonyManager#getDataActivationState() * @see TelephonyManager#getDataActivationState()
@@ -477,7 +490,7 @@ public class TelephonyRegistryManager {
@SimActivationState int activationState) { @SimActivationState int activationState) {
try { try {
sRegistry.notifySimActivationStateChangedForPhoneId(slotIndex, subId, sRegistry.notifySimActivationStateChangedForPhoneId(slotIndex, subId,
TelephonyManager.SIM_ACTIVATION_TYPE_DATA, activationState); SIM_ACTIVATION_TYPE_DATA, activationState);
} catch (RemoteException ex) { } catch (RemoteException ex) {
// system process is dead // system process is dead
} }
@@ -498,7 +511,7 @@ public class TelephonyRegistryManager {
@SimActivationState int activationState) { @SimActivationState int activationState) {
try { try {
sRegistry.notifySimActivationStateChangedForPhoneId(slotIndex, subId, sRegistry.notifySimActivationStateChangedForPhoneId(slotIndex, subId,
TelephonyManager.SIM_ACTIVATION_TYPE_VOICE, activationState); SIM_ACTIVATION_TYPE_VOICE, activationState);
} catch (RemoteException ex) { } catch (RemoteException ex) {
// system process is dead // system process is dead
} }

View File

@@ -17,6 +17,8 @@
package com.android.server; package com.android.server;
import static android.telephony.TelephonyManager.ACTION_MULTI_SIM_CONFIG_CHANGED; import static android.telephony.TelephonyManager.ACTION_MULTI_SIM_CONFIG_CHANGED;
import static android.telephony.TelephonyRegistryManager.SIM_ACTIVATION_TYPE_DATA;
import static android.telephony.TelephonyRegistryManager.SIM_ACTIVATION_TYPE_VOICE;
import static java.util.Arrays.copyOf; import static java.util.Arrays.copyOf;
@@ -1203,10 +1205,10 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
synchronized (mRecords) { synchronized (mRecords) {
if (validatePhoneId(phoneId)) { if (validatePhoneId(phoneId)) {
switch (activationType) { switch (activationType) {
case TelephonyManager.SIM_ACTIVATION_TYPE_VOICE: case SIM_ACTIVATION_TYPE_VOICE:
mVoiceActivationState[phoneId] = activationState; mVoiceActivationState[phoneId] = activationState;
break; break;
case TelephonyManager.SIM_ACTIVATION_TYPE_DATA: case SIM_ACTIVATION_TYPE_DATA:
mDataActivationState[phoneId] = activationState; mDataActivationState[phoneId] = activationState;
break; break;
default: default:
@@ -1219,10 +1221,10 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
+ " state=" + activationState); + " state=" + activationState);
} }
try { try {
if ((activationType == TelephonyManager.SIM_ACTIVATION_TYPE_VOICE) && if ((activationType == SIM_ACTIVATION_TYPE_VOICE)
r.matchPhoneStateListenerEvent( && r.matchPhoneStateListenerEvent(
PhoneStateListener.LISTEN_VOICE_ACTIVATION_STATE) && PhoneStateListener.LISTEN_VOICE_ACTIVATION_STATE)
idMatch(r.subId, subId, phoneId)) { && idMatch(r.subId, subId, phoneId)) {
if (DBG) { if (DBG) {
log("notifyVoiceActivationStateForPhoneId: callback.onVASC r=" + r log("notifyVoiceActivationStateForPhoneId: callback.onVASC r=" + r
+ " subId=" + subId + " phoneId=" + phoneId + " subId=" + subId + " phoneId=" + phoneId
@@ -1230,10 +1232,10 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
} }
r.callback.onVoiceActivationStateChanged(activationState); r.callback.onVoiceActivationStateChanged(activationState);
} }
if ((activationType == TelephonyManager.SIM_ACTIVATION_TYPE_DATA) && if ((activationType == SIM_ACTIVATION_TYPE_DATA)
r.matchPhoneStateListenerEvent( && r.matchPhoneStateListenerEvent(
PhoneStateListener.LISTEN_DATA_ACTIVATION_STATE) && PhoneStateListener.LISTEN_DATA_ACTIVATION_STATE)
idMatch(r.subId, subId, phoneId)) { && idMatch(r.subId, subId, phoneId)) {
if (DBG) { if (DBG) {
log("notifyDataActivationStateForPhoneId: callback.onDASC r=" + r log("notifyDataActivationStateForPhoneId: callback.onDASC r=" + r
+ " subId=" + subId + " phoneId=" + phoneId + " subId=" + subId + " phoneId=" + phoneId

View File

@@ -4582,17 +4582,6 @@ public class TelephonyManager {
} }
} }
/**
* Sim activation type: voice
* @hide
*/
public static final int SIM_ACTIVATION_TYPE_VOICE = 0;
/**
* Sim activation type: data
* @hide
*/
public static final int SIM_ACTIVATION_TYPE_DATA = 1;
/** /**
* Initial SIM activation state, unknown. Not set by any carrier apps. * Initial SIM activation state, unknown. Not set by any carrier apps.
* @hide * @hide