Merge changes from topics "cbs_area_info", "subscription_id"
* changes: Added area info support in cell broadcast service Renamed SUB_ID to SUBSCRIPTION_ID
This commit is contained in:
@@ -7221,7 +7221,7 @@ package android.provider {
|
|||||||
field public static final String SERIAL_NUMBER = "serial_number";
|
field public static final String SERIAL_NUMBER = "serial_number";
|
||||||
field public static final String SERVICE_CATEGORY = "service_category";
|
field public static final String SERVICE_CATEGORY = "service_category";
|
||||||
field public static final String SLOT_INDEX = "slot_index";
|
field public static final String SLOT_INDEX = "slot_index";
|
||||||
field public static final String SUB_ID = "sub_id";
|
field public static final String SUBSCRIPTION_ID = "sub_id";
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final class Telephony.CellBroadcasts.Preference {
|
public static final class Telephony.CellBroadcasts.Preference {
|
||||||
@@ -8555,10 +8555,12 @@ package android.telephony {
|
|||||||
|
|
||||||
public class CellBroadcastIntents {
|
public class CellBroadcastIntents {
|
||||||
method public static void sendSmsCbReceivedBroadcast(@NonNull android.content.Context, @Nullable android.os.UserHandle, @NonNull android.telephony.SmsCbMessage, @Nullable android.content.BroadcastReceiver, @Nullable android.os.Handler, int, int);
|
method public static void sendSmsCbReceivedBroadcast(@NonNull android.content.Context, @Nullable android.os.UserHandle, @NonNull android.telephony.SmsCbMessage, @Nullable android.content.BroadcastReceiver, @Nullable android.os.Handler, int, int);
|
||||||
|
field public static final String ACTION_AREA_INFO_UPDATED = "android.telephony.action.AREA_INFO_UPDATED";
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract class CellBroadcastService extends android.app.Service {
|
public abstract class CellBroadcastService extends android.app.Service {
|
||||||
ctor public CellBroadcastService();
|
ctor public CellBroadcastService();
|
||||||
|
method @NonNull @WorkerThread public abstract CharSequence getCellBroadcastAreaInfo(int);
|
||||||
method @CallSuper @NonNull public android.os.IBinder onBind(@Nullable android.content.Intent);
|
method @CallSuper @NonNull public android.os.IBinder onBind(@Nullable android.content.Intent);
|
||||||
method public abstract void onCdmaCellBroadcastSms(int, @NonNull byte[], int);
|
method public abstract void onCdmaCellBroadcastSms(int, @NonNull byte[], int);
|
||||||
method public abstract void onCdmaScpMessage(int, @NonNull java.util.List<android.telephony.cdma.CdmaSmsCbProgramData>, @NonNull String, @NonNull java.util.function.Consumer<android.os.Bundle>);
|
method public abstract void onCdmaScpMessage(int, @NonNull java.util.List<android.telephony.cdma.CdmaSmsCbProgramData>, @NonNull String, @NonNull java.util.function.Consumer<android.os.Bundle>);
|
||||||
|
|||||||
@@ -2580,7 +2580,7 @@ package android.provider {
|
|||||||
field public static final String SERIAL_NUMBER = "serial_number";
|
field public static final String SERIAL_NUMBER = "serial_number";
|
||||||
field public static final String SERVICE_CATEGORY = "service_category";
|
field public static final String SERVICE_CATEGORY = "service_category";
|
||||||
field public static final String SLOT_INDEX = "slot_index";
|
field public static final String SLOT_INDEX = "slot_index";
|
||||||
field public static final String SUB_ID = "sub_id";
|
field public static final String SUBSCRIPTION_ID = "sub_id";
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final class Telephony.Sms.Intents {
|
public static final class Telephony.Sms.Intents {
|
||||||
|
|||||||
@@ -4166,7 +4166,7 @@ public final class Telephony {
|
|||||||
* The subscription which received this cell broadcast message.
|
* The subscription which received this cell broadcast message.
|
||||||
* <P>Type: INTEGER</P>
|
* <P>Type: INTEGER</P>
|
||||||
*/
|
*/
|
||||||
public static final String SUB_ID = "sub_id";
|
public static final String SUBSCRIPTION_ID = "sub_id";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The slot which received this cell broadcast message.
|
* The slot which received this cell broadcast message.
|
||||||
@@ -4447,7 +4447,7 @@ public final class Telephony {
|
|||||||
public static final String[] QUERY_COLUMNS_FWK = {
|
public static final String[] QUERY_COLUMNS_FWK = {
|
||||||
_ID,
|
_ID,
|
||||||
SLOT_INDEX,
|
SLOT_INDEX,
|
||||||
SUB_ID,
|
SUBSCRIPTION_ID,
|
||||||
GEOGRAPHICAL_SCOPE,
|
GEOGRAPHICAL_SCOPE,
|
||||||
PLMN,
|
PLMN,
|
||||||
LAC,
|
LAC,
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ package android.telephony;
|
|||||||
import android.Manifest;
|
import android.Manifest;
|
||||||
import android.annotation.NonNull;
|
import android.annotation.NonNull;
|
||||||
import android.annotation.Nullable;
|
import android.annotation.Nullable;
|
||||||
|
import android.annotation.SdkConstant;
|
||||||
|
import android.annotation.SdkConstant.SdkConstantType;
|
||||||
import android.annotation.SystemApi;
|
import android.annotation.SystemApi;
|
||||||
import android.app.AppOpsManager;
|
import android.app.AppOpsManager;
|
||||||
import android.content.BroadcastReceiver;
|
import android.content.BroadcastReceiver;
|
||||||
@@ -42,6 +44,14 @@ public class CellBroadcastIntents {
|
|||||||
|
|
||||||
private static final String EXTRA_MESSAGE = "message";
|
private static final String EXTRA_MESSAGE = "message";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Broadcast intent action for notifying area information has been updated. The information
|
||||||
|
* can be retrieved by {@link CellBroadcastService#getCellBroadcastAreaInfo(int)}
|
||||||
|
*/
|
||||||
|
@SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
|
||||||
|
public static final String ACTION_AREA_INFO_UPDATED =
|
||||||
|
"android.telephony.action.AREA_INFO_UPDATED";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import android.annotation.CallSuper;
|
|||||||
import android.annotation.NonNull;
|
import android.annotation.NonNull;
|
||||||
import android.annotation.Nullable;
|
import android.annotation.Nullable;
|
||||||
import android.annotation.SystemApi;
|
import android.annotation.SystemApi;
|
||||||
|
import android.annotation.WorkerThread;
|
||||||
import android.app.Service;
|
import android.app.Service;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
@@ -101,6 +102,17 @@ public abstract class CellBroadcastService extends Service {
|
|||||||
@NonNull List<CdmaSmsCbProgramData> smsCbProgramData,
|
@NonNull List<CdmaSmsCbProgramData> smsCbProgramData,
|
||||||
@NonNull String originatingAddress, @NonNull Consumer<Bundle> callback);
|
@NonNull String originatingAddress, @NonNull Consumer<Bundle> callback);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get broadcasted area information.
|
||||||
|
*
|
||||||
|
* @param slotIndex the index of the slot which received the area information.
|
||||||
|
*
|
||||||
|
* @return The area information string sent from the network. This is usually the human readable
|
||||||
|
* string shown in Setting app's SIM status page.
|
||||||
|
*/
|
||||||
|
@WorkerThread
|
||||||
|
public abstract @NonNull CharSequence getCellBroadcastAreaInfo(int slotIndex);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If overriding this method, call through to the super method for any unknown actions.
|
* If overriding this method, call through to the super method for any unknown actions.
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
@@ -163,5 +175,17 @@ public abstract class CellBroadcastService extends Service {
|
|||||||
CellBroadcastService.this.onCdmaScpMessage(slotIndex, smsCbProgramData,
|
CellBroadcastService.this.onCdmaScpMessage(slotIndex, smsCbProgramData,
|
||||||
originatingAddress, consumer);
|
originatingAddress, consumer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get broadcasted area information
|
||||||
|
*
|
||||||
|
* @param slotIndex the index of the slot which received the message
|
||||||
|
*
|
||||||
|
* @return The area information
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public @NonNull CharSequence getCellBroadcastAreaInfo(int slotIndex) {
|
||||||
|
return CellBroadcastService.this.getCellBroadcastAreaInfo(slotIndex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,4 +36,7 @@ interface ICellBroadcastService {
|
|||||||
/** @see android.telephony.CellBroadcastService#onCdmaScpMessage */
|
/** @see android.telephony.CellBroadcastService#onCdmaScpMessage */
|
||||||
oneway void handleCdmaScpMessage(int slotId, in List<CdmaSmsCbProgramData> programData,
|
oneway void handleCdmaScpMessage(int slotId, in List<CdmaSmsCbProgramData> programData,
|
||||||
String originatingAddress, in RemoteCallback callback);
|
String originatingAddress, in RemoteCallback callback);
|
||||||
|
|
||||||
|
/** @see android.telephony.CellBroadcastService#getCellBroadcastAreaInfo */
|
||||||
|
CharSequence getCellBroadcastAreaInfo(int slotIndex);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -572,7 +572,7 @@ public final class SmsCbMessage implements Parcelable {
|
|||||||
public ContentValues getContentValues() {
|
public ContentValues getContentValues() {
|
||||||
ContentValues cv = new ContentValues(16);
|
ContentValues cv = new ContentValues(16);
|
||||||
cv.put(CellBroadcasts.SLOT_INDEX, mSlotIndex);
|
cv.put(CellBroadcasts.SLOT_INDEX, mSlotIndex);
|
||||||
cv.put(CellBroadcasts.SUB_ID, mSubId);
|
cv.put(CellBroadcasts.SUBSCRIPTION_ID, mSubId);
|
||||||
cv.put(CellBroadcasts.GEOGRAPHICAL_SCOPE, mGeographicalScope);
|
cv.put(CellBroadcasts.GEOGRAPHICAL_SCOPE, mGeographicalScope);
|
||||||
if (mLocation.getPlmn() != null) {
|
if (mLocation.getPlmn() != null) {
|
||||||
cv.put(CellBroadcasts.PLMN, mLocation.getPlmn());
|
cv.put(CellBroadcasts.PLMN, mLocation.getPlmn());
|
||||||
@@ -636,7 +636,7 @@ public final class SmsCbMessage implements Parcelable {
|
|||||||
int format = cursor.getInt(cursor.getColumnIndexOrThrow(CellBroadcasts.MESSAGE_FORMAT));
|
int format = cursor.getInt(cursor.getColumnIndexOrThrow(CellBroadcasts.MESSAGE_FORMAT));
|
||||||
int priority = cursor.getInt(cursor.getColumnIndexOrThrow(CellBroadcasts.MESSAGE_PRIORITY));
|
int priority = cursor.getInt(cursor.getColumnIndexOrThrow(CellBroadcasts.MESSAGE_PRIORITY));
|
||||||
int slotIndex = cursor.getInt(cursor.getColumnIndexOrThrow(CellBroadcasts.SLOT_INDEX));
|
int slotIndex = cursor.getInt(cursor.getColumnIndexOrThrow(CellBroadcasts.SLOT_INDEX));
|
||||||
int subId = cursor.getInt(cursor.getColumnIndexOrThrow(CellBroadcasts.SUB_ID));
|
int subId = cursor.getInt(cursor.getColumnIndexOrThrow(CellBroadcasts.SUBSCRIPTION_ID));
|
||||||
|
|
||||||
String plmn;
|
String plmn;
|
||||||
int plmnColumn = cursor.getColumnIndex(CellBroadcasts.PLMN);
|
int plmnColumn = cursor.getColumnIndex(CellBroadcasts.PLMN);
|
||||||
|
|||||||
Reference in New Issue
Block a user