support data migration from OEM legacy app to mainline
Defined systemAPI for interaction with legacy cellbroadcast app
Bug: 135956699
Test: Tested with cell broadcast receiver test app and confirmed data can be migrated.
Merged-In: I6e583672a3673fd226e14d33d7a7648f4fd03efb
Change-Id: I6e583672a3673fd226e14d33d7a7648f4fd03efb
(cherry picked from commit ad2f91fc6d)
This commit is contained in:
@@ -6905,6 +6905,9 @@ package android.provider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static final class Telephony.CellBroadcasts implements android.provider.BaseColumns {
|
public static final class Telephony.CellBroadcasts implements android.provider.BaseColumns {
|
||||||
|
field @NonNull public static final String AUTHORITY_LEGACY = "cellbroadcast-legacy";
|
||||||
|
field @NonNull public static final android.net.Uri AUTHORITY_LEGACY_URI;
|
||||||
|
field @NonNull public static final String CALL_METHOD_GET_PREFERENCE = "get_preference";
|
||||||
field public static final String CID = "cid";
|
field public static final String CID = "cid";
|
||||||
field public static final String CMAS_CATEGORY = "cmas_category";
|
field public static final String CMAS_CATEGORY = "cmas_category";
|
||||||
field public static final String CMAS_CERTAINTY = "cmas_certainty";
|
field public static final String CMAS_CERTAINTY = "cmas_certainty";
|
||||||
@@ -6935,6 +6938,21 @@ package android.provider {
|
|||||||
field public static final String SUB_ID = "sub_id";
|
field public static final String SUB_ID = "sub_id";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static final class Telephony.CellBroadcasts.Preference {
|
||||||
|
field @NonNull public static final String ENABLE_ALERT_VIBRATION_PREF = "enable_alert_vibrate";
|
||||||
|
field @NonNull public static final String ENABLE_AREA_UPDATE_INFO_PREF = "enable_area_update_info_alerts";
|
||||||
|
field @NonNull public static final String ENABLE_CMAS_AMBER_PREF = "enable_cmas_amber_alerts";
|
||||||
|
field @NonNull public static final String ENABLE_CMAS_EXTREME_THREAT_PREF = "enable_cmas_extreme_threat_alerts";
|
||||||
|
field @NonNull public static final String ENABLE_CMAS_IN_SECOND_LANGUAGE_PREF = "receive_cmas_in_second_language";
|
||||||
|
field @NonNull public static final String ENABLE_CMAS_PRESIDENTIAL_PREF = "enable_cmas_presidential_alerts";
|
||||||
|
field @NonNull public static final String ENABLE_CMAS_SEVERE_THREAT_PREF = "enable_cmas_severe_threat_alerts";
|
||||||
|
field @NonNull public static final String ENABLE_EMERGENCY_PERF = "enable_emergency_alerts";
|
||||||
|
field @NonNull public static final String ENABLE_FULL_VOLUME_PREF = "use_full_volume";
|
||||||
|
field @NonNull public static final String ENABLE_PUBLIC_SAFETY_PREF = "enable_public_safety_messages";
|
||||||
|
field @NonNull public static final String ENABLE_STATE_LOCAL_TEST_PREF = "enable_state_local_test_alerts";
|
||||||
|
field @NonNull public static final String ENABLE_TEST_ALERT_PREF = "enable_test_alerts";
|
||||||
|
}
|
||||||
|
|
||||||
public static final class Telephony.SimInfo {
|
public static final class Telephony.SimInfo {
|
||||||
field @NonNull public static final android.net.Uri CONTENT_URI;
|
field @NonNull public static final android.net.Uri CONTENT_URI;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ import android.database.Cursor;
|
|||||||
import android.database.sqlite.SqliteWrapper;
|
import android.database.sqlite.SqliteWrapper;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
|
import android.os.Bundle;
|
||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
import android.telephony.Rlog;
|
import android.telephony.Rlog;
|
||||||
import android.telephony.ServiceState;
|
import android.telephony.ServiceState;
|
||||||
@@ -4057,6 +4058,113 @@ public final class Telephony {
|
|||||||
@NonNull
|
@NonNull
|
||||||
public static final Uri MESSAGE_HISTORY_URI = Uri.parse("content://cellbroadcasts/history");
|
public static final Uri MESSAGE_HISTORY_URI = Uri.parse("content://cellbroadcasts/history");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The authority for the legacy cellbroadcast provider.
|
||||||
|
* This is used for OEM data migration. OEMs want to migrate message history or
|
||||||
|
* sharepreference data to mainlined cellbroadcastreceiver app, should have a
|
||||||
|
* contentprovider with authority: cellbroadcast-legacy. Mainlined cellbroadcastreceiver
|
||||||
|
* will interact with this URI to retrieve data and persists to mainlined cellbroadcast app.
|
||||||
|
*
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
@SystemApi
|
||||||
|
public static final @NonNull String AUTHORITY_LEGACY = "cellbroadcast-legacy";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A content:// style uri to the authority for the legacy cellbroadcast provider.
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
@SystemApi
|
||||||
|
public static final @NonNull Uri AUTHORITY_LEGACY_URI =
|
||||||
|
Uri.parse("content://cellbroadcast-legacy");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method name to {@link android.content.ContentProvider#call(String, String, Bundle)
|
||||||
|
* for {@link #AUTHORITY_LEGACY}. Used to query cellbroadcast {@link Preference},
|
||||||
|
* containing following supported entries
|
||||||
|
* <ul>
|
||||||
|
* <li>{@link #ENABLE_AREA_UPDATE_INFO_PREF}</li>
|
||||||
|
* <li>{@link #ENABLE_TEST_ALERT_PREF}</li>
|
||||||
|
* <li>{@link #ENABLE_STATE_LOCAL_TEST_PREF}</li>
|
||||||
|
* <li>{@link #ENABLE_PUBLIC_SAFETY_PREF}</li>
|
||||||
|
* <li>{@link #ENABLE_CMAS_AMBER_PREF}</li>
|
||||||
|
* <li>{@link #ENABLE_CMAS_SEVERE_THREAT_PREF}</li>
|
||||||
|
* <li>{@link #ENABLE_CMAS_EXTREME_THREAT_PREF}</li>
|
||||||
|
* <li>{@link #ENABLE_CMAS_PRESIDENTIAL_PREF}</li>
|
||||||
|
* <li>{@link #ENABLE_ALERT_VIBRATION_PREF}</li>
|
||||||
|
* <li>{@link #ENABLE_EMERGENCY_PERF}</li>
|
||||||
|
* <li>{@link #ENABLE_FULL_VOLUME_PREF}</li>
|
||||||
|
* <li>{@link #ENABLE_CMAS_IN_SECOND_LANGUAGE_PREF}</li>
|
||||||
|
* </ul>
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
@SystemApi
|
||||||
|
public static final @NonNull String CALL_METHOD_GET_PREFERENCE = "get_preference";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Arg name to {@link android.content.ContentProvider#call(String, String, Bundle)}
|
||||||
|
* for {@link #AUTHORITY_LEGACY}.
|
||||||
|
* Contains all supported shared preferences for cellbroadcast.
|
||||||
|
*
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
@SystemApi
|
||||||
|
public static final class Preference {
|
||||||
|
/**
|
||||||
|
* Not Instantiatable.
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
private Preference() {}
|
||||||
|
|
||||||
|
/** Preference to enable area update info alert */
|
||||||
|
public static final @NonNull String ENABLE_AREA_UPDATE_INFO_PREF =
|
||||||
|
"enable_area_update_info_alerts";
|
||||||
|
|
||||||
|
/** Preference to enable test alert */
|
||||||
|
public static final @NonNull String ENABLE_TEST_ALERT_PREF =
|
||||||
|
"enable_test_alerts";
|
||||||
|
|
||||||
|
/** Preference to enable state local test alert */
|
||||||
|
public static final @NonNull String ENABLE_STATE_LOCAL_TEST_PREF
|
||||||
|
= "enable_state_local_test_alerts";
|
||||||
|
|
||||||
|
/** Preference to enable public safety alert */
|
||||||
|
public static final @NonNull String ENABLE_PUBLIC_SAFETY_PREF
|
||||||
|
= "enable_public_safety_messages";
|
||||||
|
|
||||||
|
/** Preference to enable amber alert */
|
||||||
|
public static final @NonNull String ENABLE_CMAS_AMBER_PREF
|
||||||
|
= "enable_cmas_amber_alerts";
|
||||||
|
|
||||||
|
/** Preference to enable severe threat alert */
|
||||||
|
public static final @NonNull String ENABLE_CMAS_SEVERE_THREAT_PREF
|
||||||
|
= "enable_cmas_severe_threat_alerts";
|
||||||
|
|
||||||
|
/** Preference to enable extreme threat alert */
|
||||||
|
public static final @NonNull String ENABLE_CMAS_EXTREME_THREAT_PREF =
|
||||||
|
"enable_cmas_extreme_threat_alerts";
|
||||||
|
|
||||||
|
/** Preference to enable presidential alert */
|
||||||
|
public static final @NonNull String ENABLE_CMAS_PRESIDENTIAL_PREF =
|
||||||
|
"enable_cmas_presidential_alerts";
|
||||||
|
|
||||||
|
/** Preference to enable alert vibration */
|
||||||
|
public static final @NonNull String ENABLE_ALERT_VIBRATION_PREF =
|
||||||
|
"enable_alert_vibrate";
|
||||||
|
|
||||||
|
/** Preference to enable emergency alert */
|
||||||
|
public static final @NonNull String ENABLE_EMERGENCY_PERF =
|
||||||
|
"enable_emergency_alerts";
|
||||||
|
|
||||||
|
/** Preference to enable volume for alerts */
|
||||||
|
public static final @NonNull String ENABLE_FULL_VOLUME_PREF =
|
||||||
|
"use_full_volume";
|
||||||
|
|
||||||
|
/** Preference to enable receive alerts in second language */
|
||||||
|
public static final @NonNull String ENABLE_CMAS_IN_SECOND_LANGUAGE_PREF =
|
||||||
|
"receive_cmas_in_second_language";
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The subscription which received this cell broadcast message.
|
* The subscription which received this cell broadcast message.
|
||||||
* <P>Type: INTEGER</P>
|
* <P>Type: INTEGER</P>
|
||||||
|
|||||||
Reference in New Issue
Block a user