blob: fb8f3e78ff84207f054af8a7bb1cee5bde1d95c3 [file] [log] [blame]
Dan Willemsen4980bf42017-02-14 14:17:12 -08001/*
2 * Copyright (C) 2006 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.provider;
18
chen xu7ebcd782018-11-28 00:21:50 -080019import android.annotation.IntDef;
Jayachandran C32e712e2018-10-30 15:09:06 -070020import android.annotation.RequiresPermission;
Dan Willemsen4980bf42017-02-14 14:17:12 -080021import android.annotation.SdkConstant;
22import android.annotation.SdkConstant.SdkConstantType;
chen xu85100482018-10-12 15:30:34 -070023import android.annotation.SystemApi;
Dan Willemsen4980bf42017-02-14 14:17:12 -080024import android.annotation.TestApi;
Mathew Inwoodba503112018-08-10 09:37:35 +010025import android.annotation.UnsupportedAppUsage;
Jordan Liub9b75ed2017-02-28 18:15:07 -080026import android.app.job.JobService;
Dan Willemsen4980bf42017-02-14 14:17:12 -080027import android.content.ComponentName;
28import android.content.ContentResolver;
29import android.content.ContentValues;
30import android.content.Context;
31import android.content.Intent;
Jordan Liub9b75ed2017-02-28 18:15:07 -080032import android.database.ContentObserver;
Cassie6d0a5712018-08-21 13:38:39 -070033import android.database.Cursor;
Dan Willemsen4980bf42017-02-14 14:17:12 -080034import android.database.sqlite.SqliteWrapper;
35import android.net.Uri;
Mathew Inwood45d2c252018-09-14 12:35:36 +010036import android.os.Build;
Jordan Liub9b75ed2017-02-28 18:15:07 -080037import android.telephony.Rlog;
38import android.telephony.ServiceState;
Dan Willemsen4980bf42017-02-14 14:17:12 -080039import android.telephony.SmsMessage;
40import android.telephony.SubscriptionManager;
fionaxu58278be2018-01-29 14:08:12 -080041import android.telephony.TelephonyManager;
Dan Willemsen4980bf42017-02-14 14:17:12 -080042import android.text.TextUtils;
Dan Willemsen4980bf42017-02-14 14:17:12 -080043import android.util.Patterns;
44
45import com.android.internal.telephony.PhoneConstants;
46import com.android.internal.telephony.SmsApplication;
47
chen xu7ebcd782018-11-28 00:21:50 -080048import java.lang.annotation.Retention;
49import java.lang.annotation.RetentionPolicy;
Dan Willemsen4980bf42017-02-14 14:17:12 -080050import java.util.HashSet;
51import java.util.Set;
52import java.util.regex.Matcher;
53import java.util.regex.Pattern;
54
55/**
56 * The Telephony provider contains data related to phone operation, specifically SMS and MMS
Jordan Liub9b75ed2017-02-28 18:15:07 -080057 * messages, access to the APN list, including the MMSC to use, and the service state.
Dan Willemsen4980bf42017-02-14 14:17:12 -080058 *
59 * <p class="note"><strong>Note:</strong> These APIs are not available on all Android-powered
60 * devices. If your app depends on telephony features such as for managing SMS messages, include
61 * a <a href="{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code <uses-feature>}
62 * </a> element in your manifest that declares the {@code "android.hardware.telephony"} hardware
63 * feature. Alternatively, you can check for telephony availability at runtime using either
64 * {@link android.content.pm.PackageManager#hasSystemFeature
65 * hasSystemFeature(PackageManager.FEATURE_TELEPHONY)} or {@link
66 * android.telephony.TelephonyManager#getPhoneType}.</p>
67 *
68 * <h3>Creating an SMS app</h3>
69 *
70 * <p>Only the default SMS app (selected by the user in system settings) is able to write to the
71 * SMS Provider (the tables defined within the {@code Telephony} class) and only the default SMS
72 * app receives the {@link android.provider.Telephony.Sms.Intents#SMS_DELIVER_ACTION} broadcast
73 * when the user receives an SMS or the {@link
74 * android.provider.Telephony.Sms.Intents#WAP_PUSH_DELIVER_ACTION} broadcast when the user
75 * receives an MMS.</p>
76 *
77 * <p>Any app that wants to behave as the user's default SMS app must handle the following intents:
78 * <ul>
79 * <li>In a broadcast receiver, include an intent filter for {@link Sms.Intents#SMS_DELIVER_ACTION}
80 * (<code>"android.provider.Telephony.SMS_DELIVER"</code>). The broadcast receiver must also
81 * require the {@link android.Manifest.permission#BROADCAST_SMS} permission.
82 * <p>This allows your app to directly receive incoming SMS messages.</p></li>
83 * <li>In a broadcast receiver, include an intent filter for {@link
84 * Sms.Intents#WAP_PUSH_DELIVER_ACTION}} ({@code "android.provider.Telephony.WAP_PUSH_DELIVER"})
85 * with the MIME type <code>"application/vnd.wap.mms-message"</code>.
86 * The broadcast receiver must also require the {@link
87 * android.Manifest.permission#BROADCAST_WAP_PUSH} permission.
88 * <p>This allows your app to directly receive incoming MMS messages.</p></li>
89 * <li>In your activity that delivers new messages, include an intent filter for
90 * {@link android.content.Intent#ACTION_SENDTO} (<code>"android.intent.action.SENDTO"
91 * </code>) with schemas, <code>sms:</code>, <code>smsto:</code>, <code>mms:</code>, and
92 * <code>mmsto:</code>.
93 * <p>This allows your app to receive intents from other apps that want to deliver a
94 * message.</p></li>
95 * <li>In a service, include an intent filter for {@link
96 * android.telephony.TelephonyManager#ACTION_RESPOND_VIA_MESSAGE}
97 * (<code>"android.intent.action.RESPOND_VIA_MESSAGE"</code>) with schemas,
98 * <code>sms:</code>, <code>smsto:</code>, <code>mms:</code>, and <code>mmsto:</code>.
99 * This service must also require the {@link
100 * android.Manifest.permission#SEND_RESPOND_VIA_MESSAGE} permission.
101 * <p>This allows users to respond to incoming phone calls with an immediate text message
102 * using your app.</p></li>
103 * </ul>
104 *
105 * <p>Other apps that are not selected as the default SMS app can only <em>read</em> the SMS
106 * Provider, but may also be notified when a new SMS arrives by listening for the {@link
107 * Sms.Intents#SMS_RECEIVED_ACTION}
108 * broadcast, which is a non-abortable broadcast that may be delivered to multiple apps. This
109 * broadcast is intended for apps that&mdash;while not selected as the default SMS app&mdash;need to
110 * read special incoming messages such as to perform phone number verification.</p>
111 *
112 * <p>For more information about building SMS apps, read the blog post, <a
113 * href="http://android-developers.blogspot.com/2013/10/getting-your-sms-apps-ready-for-kitkat.html"
114 * >Getting Your SMS Apps Ready for KitKat</a>.</p>
115 *
116 */
117public final class Telephony {
118 private static final String TAG = "Telephony";
119
120 /**
121 * Not instantiable.
122 * @hide
123 */
124 private Telephony() {
125 }
126
127 /**
128 * Base columns for tables that contain text-based SMSs.
129 */
130 public interface TextBasedSmsColumns {
131
132 /** Message type: all messages. */
133 public static final int MESSAGE_TYPE_ALL = 0;
134
135 /** Message type: inbox. */
136 public static final int MESSAGE_TYPE_INBOX = 1;
137
138 /** Message type: sent messages. */
139 public static final int MESSAGE_TYPE_SENT = 2;
140
141 /** Message type: drafts. */
142 public static final int MESSAGE_TYPE_DRAFT = 3;
143
144 /** Message type: outbox. */
145 public static final int MESSAGE_TYPE_OUTBOX = 4;
146
147 /** Message type: failed outgoing message. */
148 public static final int MESSAGE_TYPE_FAILED = 5;
149
150 /** Message type: queued to send later. */
151 public static final int MESSAGE_TYPE_QUEUED = 6;
152
153 /**
154 * The type of message.
155 * <P>Type: INTEGER</P>
156 */
157 public static final String TYPE = "type";
158
159 /**
160 * The thread ID of the message.
161 * <P>Type: INTEGER</P>
162 */
163 public static final String THREAD_ID = "thread_id";
164
165 /**
166 * The address of the other party.
167 * <P>Type: TEXT</P>
168 */
169 public static final String ADDRESS = "address";
170
171 /**
172 * The date the message was received.
173 * <P>Type: INTEGER (long)</P>
174 */
175 public static final String DATE = "date";
176
177 /**
178 * The date the message was sent.
179 * <P>Type: INTEGER (long)</P>
180 */
181 public static final String DATE_SENT = "date_sent";
182
183 /**
184 * Has the message been read?
185 * <P>Type: INTEGER (boolean)</P>
186 */
187 public static final String READ = "read";
188
189 /**
190 * Has the message been seen by the user? The "seen" flag determines
191 * whether we need to show a notification.
192 * <P>Type: INTEGER (boolean)</P>
193 */
194 public static final String SEEN = "seen";
195
196 /**
197 * {@code TP-Status} value for the message, or -1 if no status has been received.
198 * <P>Type: INTEGER</P>
199 */
200 public static final String STATUS = "status";
201
202 /** TP-Status: no status received. */
203 public static final int STATUS_NONE = -1;
204 /** TP-Status: complete. */
205 public static final int STATUS_COMPLETE = 0;
206 /** TP-Status: pending. */
207 public static final int STATUS_PENDING = 32;
208 /** TP-Status: failed. */
209 public static final int STATUS_FAILED = 64;
210
211 /**
212 * The subject of the message, if present.
213 * <P>Type: TEXT</P>
214 */
215 public static final String SUBJECT = "subject";
216
217 /**
218 * The body of the message.
219 * <P>Type: TEXT</P>
220 */
221 public static final String BODY = "body";
222
223 /**
224 * The ID of the sender of the conversation, if present.
225 * <P>Type: INTEGER (reference to item in {@code content://contacts/people})</P>
226 */
227 public static final String PERSON = "person";
228
229 /**
230 * The protocol identifier code.
231 * <P>Type: INTEGER</P>
232 */
233 public static final String PROTOCOL = "protocol";
234
235 /**
236 * Is the {@code TP-Reply-Path} flag set?
237 * <P>Type: BOOLEAN</P>
238 */
239 public static final String REPLY_PATH_PRESENT = "reply_path_present";
240
241 /**
242 * The service center (SC) through which to send the message, if present.
243 * <P>Type: TEXT</P>
244 */
245 public static final String SERVICE_CENTER = "service_center";
246
247 /**
248 * Is the message locked?
249 * <P>Type: INTEGER (boolean)</P>
250 */
251 public static final String LOCKED = "locked";
252
253 /**
254 * The subscription to which the message belongs to. Its value will be
255 * < 0 if the sub id cannot be determined.
256 * <p>Type: INTEGER (long) </p>
257 */
258 public static final String SUBSCRIPTION_ID = "sub_id";
259
260 /**
261 * The MTU size of the mobile interface to which the APN connected
262 * @hide
263 */
264 public static final String MTU = "mtu";
265
266 /**
267 * Error code associated with sending or receiving this message
268 * <P>Type: INTEGER</P>
269 */
270 public static final String ERROR_CODE = "error_code";
271
272 /**
273 * The identity of the sender of a sent message. It is
274 * usually the package name of the app which sends the message.
275 * <p class="note"><strong>Note:</strong>
276 * This column is read-only. It is set by the provider and can not be changed by apps.
277 * <p>Type: TEXT</p>
278 */
279 public static final String CREATOR = "creator";
280 }
281
282 /**
283 * Contains all text-based SMS messages.
284 */
285 public static final class Sms implements BaseColumns, TextBasedSmsColumns {
286
287 /**
288 * Not instantiable.
289 * @hide
290 */
291 private Sms() {
292 }
293
294 /**
295 * Used to determine the currently configured default SMS package.
296 * @param context context of the requesting application
297 * @return package name for the default SMS package or null
298 */
299 public static String getDefaultSmsPackage(Context context) {
300 ComponentName component = SmsApplication.getDefaultSmsApplication(context, false);
301 if (component != null) {
302 return component.getPackageName();
303 }
304 return null;
305 }
306
307 /**
308 * Return cursor for table query.
309 * @hide
310 */
311 public static Cursor query(ContentResolver cr, String[] projection) {
312 return cr.query(CONTENT_URI, projection, null, null, DEFAULT_SORT_ORDER);
313 }
314
315 /**
316 * Return cursor for table query.
317 * @hide
318 */
Mathew Inwood45d2c252018-09-14 12:35:36 +0100319 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
Dan Willemsen4980bf42017-02-14 14:17:12 -0800320 public static Cursor query(ContentResolver cr, String[] projection,
321 String where, String orderBy) {
322 return cr.query(CONTENT_URI, projection, where,
323 null, orderBy == null ? DEFAULT_SORT_ORDER : orderBy);
324 }
325
326 /**
327 * The {@code content://} style URL for this table.
328 */
329 public static final Uri CONTENT_URI = Uri.parse("content://sms");
330
331 /**
332 * The default sort order for this table.
333 */
334 public static final String DEFAULT_SORT_ORDER = "date DESC";
335
336 /**
337 * Add an SMS to the given URI.
338 *
339 * @param resolver the content resolver to use
340 * @param uri the URI to add the message to
341 * @param address the address of the sender
342 * @param body the body of the message
343 * @param subject the pseudo-subject of the message
344 * @param date the timestamp for the message
345 * @param read true if the message has been read, false if not
346 * @param deliveryReport true if a delivery report was requested, false if not
347 * @return the URI for the new message
348 * @hide
349 */
Mathew Inwoodba503112018-08-10 09:37:35 +0100350 @UnsupportedAppUsage
Dan Willemsen4980bf42017-02-14 14:17:12 -0800351 public static Uri addMessageToUri(ContentResolver resolver,
352 Uri uri, String address, String body, String subject,
353 Long date, boolean read, boolean deliveryReport) {
354 return addMessageToUri(SubscriptionManager.getDefaultSmsSubscriptionId(),
355 resolver, uri, address, body, subject, date, read, deliveryReport, -1L);
356 }
357
358 /**
359 * Add an SMS to the given URI.
360 *
361 * @param resolver the content resolver to use
362 * @param uri the URI to add the message to
363 * @param address the address of the sender
364 * @param body the body of the message
365 * @param subject the psuedo-subject of the message
366 * @param date the timestamp for the message
367 * @param read true if the message has been read, false if not
368 * @param deliveryReport true if a delivery report was requested, false if not
369 * @param subId the subscription which the message belongs to
370 * @return the URI for the new message
371 * @hide
372 */
Mathew Inwoodba503112018-08-10 09:37:35 +0100373 @UnsupportedAppUsage
Dan Willemsen4980bf42017-02-14 14:17:12 -0800374 public static Uri addMessageToUri(int subId, ContentResolver resolver,
375 Uri uri, String address, String body, String subject,
376 Long date, boolean read, boolean deliveryReport) {
377 return addMessageToUri(subId, resolver, uri, address, body, subject,
378 date, read, deliveryReport, -1L);
379 }
380
381 /**
382 * Add an SMS to the given URI with the specified thread ID.
383 *
384 * @param resolver the content resolver to use
385 * @param uri the URI to add the message to
386 * @param address the address of the sender
387 * @param body the body of the message
388 * @param subject the pseudo-subject of the message
389 * @param date the timestamp for the message
390 * @param read true if the message has been read, false if not
391 * @param deliveryReport true if a delivery report was requested, false if not
392 * @param threadId the thread_id of the message
393 * @return the URI for the new message
394 * @hide
395 */
Mathew Inwoodba503112018-08-10 09:37:35 +0100396 @UnsupportedAppUsage
Dan Willemsen4980bf42017-02-14 14:17:12 -0800397 public static Uri addMessageToUri(ContentResolver resolver,
398 Uri uri, String address, String body, String subject,
399 Long date, boolean read, boolean deliveryReport, long threadId) {
400 return addMessageToUri(SubscriptionManager.getDefaultSmsSubscriptionId(),
401 resolver, uri, address, body, subject,
402 date, read, deliveryReport, threadId);
403 }
404
405 /**
406 * Add an SMS to the given URI with thread_id specified.
407 *
408 * @param resolver the content resolver to use
409 * @param uri the URI to add the message to
410 * @param address the address of the sender
411 * @param body the body of the message
412 * @param subject the psuedo-subject of the message
413 * @param date the timestamp for the message
414 * @param read true if the message has been read, false if not
415 * @param deliveryReport true if a delivery report was requested, false if not
416 * @param threadId the thread_id of the message
417 * @param subId the subscription which the message belongs to
418 * @return the URI for the new message
419 * @hide
420 */
Mathew Inwoodba503112018-08-10 09:37:35 +0100421 @UnsupportedAppUsage
Dan Willemsen4980bf42017-02-14 14:17:12 -0800422 public static Uri addMessageToUri(int subId, ContentResolver resolver,
423 Uri uri, String address, String body, String subject,
424 Long date, boolean read, boolean deliveryReport, long threadId) {
425 ContentValues values = new ContentValues(8);
426 Rlog.v(TAG,"Telephony addMessageToUri sub id: " + subId);
427
428 values.put(SUBSCRIPTION_ID, subId);
429 values.put(ADDRESS, address);
430 if (date != null) {
431 values.put(DATE, date);
432 }
433 values.put(READ, read ? Integer.valueOf(1) : Integer.valueOf(0));
434 values.put(SUBJECT, subject);
435 values.put(BODY, body);
436 if (deliveryReport) {
437 values.put(STATUS, STATUS_PENDING);
438 }
439 if (threadId != -1L) {
440 values.put(THREAD_ID, threadId);
441 }
442 return resolver.insert(uri, values);
443 }
444
445 /**
446 * Move a message to the given folder.
447 *
448 * @param context the context to use
449 * @param uri the message to move
450 * @param folder the folder to move to
451 * @return true if the operation succeeded
452 * @hide
453 */
Mathew Inwoodba503112018-08-10 09:37:35 +0100454 @UnsupportedAppUsage
Dan Willemsen4980bf42017-02-14 14:17:12 -0800455 public static boolean moveMessageToFolder(Context context,
456 Uri uri, int folder, int error) {
457 if (uri == null) {
458 return false;
459 }
460
461 boolean markAsUnread = false;
462 boolean markAsRead = false;
463 switch(folder) {
464 case MESSAGE_TYPE_INBOX:
465 case MESSAGE_TYPE_DRAFT:
466 break;
467 case MESSAGE_TYPE_OUTBOX:
468 case MESSAGE_TYPE_SENT:
469 markAsRead = true;
470 break;
471 case MESSAGE_TYPE_FAILED:
472 case MESSAGE_TYPE_QUEUED:
473 markAsUnread = true;
474 break;
475 default:
476 return false;
477 }
478
479 ContentValues values = new ContentValues(3);
480
481 values.put(TYPE, folder);
482 if (markAsUnread) {
483 values.put(READ, 0);
484 } else if (markAsRead) {
485 values.put(READ, 1);
486 }
487 values.put(ERROR_CODE, error);
488
489 return 1 == SqliteWrapper.update(context, context.getContentResolver(),
490 uri, values, null, null);
491 }
492
493 /**
494 * Returns true iff the folder (message type) identifies an
495 * outgoing message.
496 * @hide
497 */
Mathew Inwoodba503112018-08-10 09:37:35 +0100498 @UnsupportedAppUsage
Dan Willemsen4980bf42017-02-14 14:17:12 -0800499 public static boolean isOutgoingFolder(int messageType) {
500 return (messageType == MESSAGE_TYPE_FAILED)
501 || (messageType == MESSAGE_TYPE_OUTBOX)
502 || (messageType == MESSAGE_TYPE_SENT)
503 || (messageType == MESSAGE_TYPE_QUEUED);
504 }
505
506 /**
507 * Contains all text-based SMS messages in the SMS app inbox.
508 */
509 public static final class Inbox implements BaseColumns, TextBasedSmsColumns {
510
511 /**
512 * Not instantiable.
513 * @hide
514 */
515 private Inbox() {
516 }
517
518 /**
519 * The {@code content://} style URL for this table.
520 */
521 public static final Uri CONTENT_URI = Uri.parse("content://sms/inbox");
522
523 /**
524 * The default sort order for this table.
525 */
526 public static final String DEFAULT_SORT_ORDER = "date DESC";
527
528 /**
529 * Add an SMS to the Draft box.
530 *
531 * @param resolver the content resolver to use
532 * @param address the address of the sender
533 * @param body the body of the message
534 * @param subject the pseudo-subject of the message
535 * @param date the timestamp for the message
536 * @param read true if the message has been read, false if not
537 * @return the URI for the new message
538 * @hide
539 */
Mathew Inwoodba503112018-08-10 09:37:35 +0100540 @UnsupportedAppUsage
Dan Willemsen4980bf42017-02-14 14:17:12 -0800541 public static Uri addMessage(ContentResolver resolver,
542 String address, String body, String subject, Long date,
543 boolean read) {
544 return addMessageToUri(SubscriptionManager.getDefaultSmsSubscriptionId(),
545 resolver, CONTENT_URI, address, body, subject, date, read, false);
546 }
547
548 /**
549 * Add an SMS to the Draft box.
550 *
551 * @param resolver the content resolver to use
552 * @param address the address of the sender
553 * @param body the body of the message
554 * @param subject the psuedo-subject of the message
555 * @param date the timestamp for the message
556 * @param read true if the message has been read, false if not
557 * @param subId the subscription which the message belongs to
558 * @return the URI for the new message
559 * @hide
560 */
Mathew Inwoodba503112018-08-10 09:37:35 +0100561 @UnsupportedAppUsage
Dan Willemsen4980bf42017-02-14 14:17:12 -0800562 public static Uri addMessage(int subId, ContentResolver resolver,
563 String address, String body, String subject, Long date, boolean read) {
564 return addMessageToUri(subId, resolver, CONTENT_URI, address, body,
565 subject, date, read, false);
566 }
567 }
568
569 /**
570 * Contains all sent text-based SMS messages in the SMS app.
571 */
572 public static final class Sent implements BaseColumns, TextBasedSmsColumns {
573
574 /**
575 * Not instantiable.
576 * @hide
577 */
578 private Sent() {
579 }
580
581 /**
582 * The {@code content://} style URL for this table.
583 */
584 public static final Uri CONTENT_URI = Uri.parse("content://sms/sent");
585
586 /**
587 * The default sort order for this table.
588 */
589 public static final String DEFAULT_SORT_ORDER = "date DESC";
590
591 /**
592 * Add an SMS to the Draft box.
593 *
594 * @param resolver the content resolver to use
595 * @param address the address of the sender
596 * @param body the body of the message
597 * @param subject the pseudo-subject of the message
598 * @param date the timestamp for the message
599 * @return the URI for the new message
600 * @hide
601 */
Mathew Inwoodba503112018-08-10 09:37:35 +0100602 @UnsupportedAppUsage
Dan Willemsen4980bf42017-02-14 14:17:12 -0800603 public static Uri addMessage(ContentResolver resolver,
604 String address, String body, String subject, Long date) {
605 return addMessageToUri(SubscriptionManager.getDefaultSmsSubscriptionId(),
606 resolver, CONTENT_URI, address, body, subject, date, true, false);
607 }
608
609 /**
610 * Add an SMS to the Draft box.
611 *
612 * @param resolver the content resolver to use
613 * @param address the address of the sender
614 * @param body the body of the message
615 * @param subject the psuedo-subject of the message
616 * @param date the timestamp for the message
617 * @param subId the subscription which the message belongs to
618 * @return the URI for the new message
619 * @hide
620 */
Mathew Inwoodba503112018-08-10 09:37:35 +0100621 @UnsupportedAppUsage
Dan Willemsen4980bf42017-02-14 14:17:12 -0800622 public static Uri addMessage(int subId, ContentResolver resolver,
623 String address, String body, String subject, Long date) {
624 return addMessageToUri(subId, resolver, CONTENT_URI, address, body,
625 subject, date, true, false);
626 }
627 }
628
629 /**
630 * Contains all sent text-based SMS messages in the SMS app.
631 */
632 public static final class Draft implements BaseColumns, TextBasedSmsColumns {
633
634 /**
635 * Not instantiable.
636 * @hide
637 */
638 private Draft() {
639 }
640
641 /**
642 * The {@code content://} style URL for this table.
643 */
644 public static final Uri CONTENT_URI = Uri.parse("content://sms/draft");
645
646 /**
647 * @hide
648 */
Mathew Inwoodba503112018-08-10 09:37:35 +0100649 @UnsupportedAppUsage
Dan Willemsen4980bf42017-02-14 14:17:12 -0800650 public static Uri addMessage(ContentResolver resolver,
651 String address, String body, String subject, Long date) {
652 return addMessageToUri(SubscriptionManager.getDefaultSmsSubscriptionId(),
653 resolver, CONTENT_URI, address, body, subject, date, true, false);
654 }
655
656 /**
657 * Add an SMS to the Draft box.
658 *
659 * @param resolver the content resolver to use
660 * @param address the address of the sender
661 * @param body the body of the message
662 * @param subject the psuedo-subject of the message
663 * @param date the timestamp for the message
664 * @param subId the subscription which the message belongs to
665 * @return the URI for the new message
666 * @hide
667 */
Mathew Inwoodba503112018-08-10 09:37:35 +0100668 @UnsupportedAppUsage
Dan Willemsen4980bf42017-02-14 14:17:12 -0800669 public static Uri addMessage(int subId, ContentResolver resolver,
670 String address, String body, String subject, Long date) {
671 return addMessageToUri(subId, resolver, CONTENT_URI, address, body,
672 subject, date, true, false);
673 }
674
675 /**
676 * The default sort order for this table.
677 */
678 public static final String DEFAULT_SORT_ORDER = "date DESC";
679 }
680
681 /**
682 * Contains all pending outgoing text-based SMS messages.
683 */
684 public static final class Outbox implements BaseColumns, TextBasedSmsColumns {
685
686 /**
687 * Not instantiable.
688 * @hide
689 */
690 private Outbox() {
691 }
692
693 /**
694 * The {@code content://} style URL for this table.
695 */
696 public static final Uri CONTENT_URI = Uri.parse("content://sms/outbox");
697
698 /**
699 * The default sort order for this table.
700 */
701 public static final String DEFAULT_SORT_ORDER = "date DESC";
702
703 /**
704 * Add an SMS to the outbox.
705 *
706 * @param resolver the content resolver to use
707 * @param address the address of the sender
708 * @param body the body of the message
709 * @param subject the pseudo-subject of the message
710 * @param date the timestamp for the message
711 * @param deliveryReport whether a delivery report was requested for the message
712 * @return the URI for the new message
713 * @hide
714 */
Mathew Inwoodba503112018-08-10 09:37:35 +0100715 @UnsupportedAppUsage
Dan Willemsen4980bf42017-02-14 14:17:12 -0800716 public static Uri addMessage(ContentResolver resolver,
717 String address, String body, String subject, Long date,
718 boolean deliveryReport, long threadId) {
719 return addMessageToUri(SubscriptionManager.getDefaultSmsSubscriptionId(),
720 resolver, CONTENT_URI, address, body, subject, date,
721 true, deliveryReport, threadId);
722 }
723
724 /**
725 * Add an SMS to the Out box.
726 *
727 * @param resolver the content resolver to use
728 * @param address the address of the sender
729 * @param body the body of the message
730 * @param subject the psuedo-subject of the message
731 * @param date the timestamp for the message
732 * @param deliveryReport whether a delivery report was requested for the message
733 * @param subId the subscription which the message belongs to
734 * @return the URI for the new message
735 * @hide
736 */
737 public static Uri addMessage(int subId, ContentResolver resolver,
738 String address, String body, String subject, Long date,
739 boolean deliveryReport, long threadId) {
740 return addMessageToUri(subId, resolver, CONTENT_URI, address, body,
741 subject, date, true, deliveryReport, threadId);
742 }
743 }
744
745 /**
746 * Contains all sent text-based SMS messages in the SMS app.
747 */
748 public static final class Conversations
749 implements BaseColumns, TextBasedSmsColumns {
750
751 /**
752 * Not instantiable.
753 * @hide
754 */
755 private Conversations() {
756 }
757
758 /**
759 * The {@code content://} style URL for this table.
760 */
761 public static final Uri CONTENT_URI = Uri.parse("content://sms/conversations");
762
763 /**
764 * The default sort order for this table.
765 */
766 public static final String DEFAULT_SORT_ORDER = "date DESC";
767
768 /**
769 * The first 45 characters of the body of the message.
770 * <P>Type: TEXT</P>
771 */
772 public static final String SNIPPET = "snippet";
773
774 /**
775 * The number of messages in the conversation.
776 * <P>Type: INTEGER</P>
777 */
778 public static final String MESSAGE_COUNT = "msg_count";
779 }
780
781 /**
782 * Contains constants for SMS related Intents that are broadcast.
783 */
784 public static final class Intents {
785
786 /**
787 * Not instantiable.
788 * @hide
789 */
790 private Intents() {
791 }
792
793 /**
794 * Set by BroadcastReceiver to indicate that the message was handled
795 * successfully.
796 */
797 public static final int RESULT_SMS_HANDLED = 1;
798
799 /**
800 * Set by BroadcastReceiver to indicate a generic error while
801 * processing the message.
802 */
803 public static final int RESULT_SMS_GENERIC_ERROR = 2;
804
805 /**
806 * Set by BroadcastReceiver to indicate insufficient memory to store
807 * the message.
808 */
809 public static final int RESULT_SMS_OUT_OF_MEMORY = 3;
810
811 /**
812 * Set by BroadcastReceiver to indicate that the message, while
813 * possibly valid, is of a format or encoding that is not
814 * supported.
815 */
816 public static final int RESULT_SMS_UNSUPPORTED = 4;
817
818 /**
819 * Set by BroadcastReceiver to indicate a duplicate incoming message.
820 */
821 public static final int RESULT_SMS_DUPLICATED = 5;
822
823 /**
824 * Activity action: Ask the user to change the default
825 * SMS application. This will show a dialog that asks the
826 * user whether they want to replace the current default
827 * SMS application with the one specified in
828 * {@link #EXTRA_PACKAGE_NAME}.
829 */
830 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
831 public static final String ACTION_CHANGE_DEFAULT =
832 "android.provider.Telephony.ACTION_CHANGE_DEFAULT";
833
834 /**
835 * The PackageName string passed in as an
836 * extra for {@link #ACTION_CHANGE_DEFAULT}
837 *
838 * @see #ACTION_CHANGE_DEFAULT
839 */
840 public static final String EXTRA_PACKAGE_NAME = "package";
841
842 /**
843 * Broadcast Action: A new text-based SMS message has been received
844 * by the device. This intent will only be delivered to the default
845 * sms app. That app is responsible for writing the message and notifying
846 * the user. The intent will have the following extra values:</p>
847 *
848 * <ul>
849 * <li><em>"pdus"</em> - An Object[] of byte[]s containing the PDUs
850 * that make up the message.</li>
851 * <li><em>"format"</em> - A String describing the format of the PDUs. It can
852 * be either "3gpp" or "3gpp2".</li>
853 * <li><em>"subscription"</em> - An optional long value of the subscription id which
854 * received the message.</li>
855 * <li><em>"slot"</em> - An optional int value of the SIM slot containing the
856 * subscription.</li>
857 * <li><em>"phone"</em> - An optional int value of the phone id associated with the
858 * subscription.</li>
859 * <li><em>"errorCode"</em> - An optional int error code associated with receiving
860 * the message.</li>
861 * </ul>
862 *
863 * <p>The extra values can be extracted using
864 * {@link #getMessagesFromIntent(Intent)}.</p>
865 *
866 * <p>If a BroadcastReceiver encounters an error while processing
867 * this intent it should set the result code appropriately.</p>
868 *
869 * <p class="note"><strong>Note:</strong>
870 * The broadcast receiver that filters for this intent must declare
871 * {@link android.Manifest.permission#BROADCAST_SMS} as a required permission in
872 * the <a href="{@docRoot}guide/topics/manifest/receiver-element.html">{@code
873 * <receiver>}</a> tag.
874 *
875 * <p>Requires {@link android.Manifest.permission#RECEIVE_SMS} to receive.</p>
876 */
877 @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
878 public static final String SMS_DELIVER_ACTION =
879 "android.provider.Telephony.SMS_DELIVER";
880
881 /**
882 * Broadcast Action: A new text-based SMS message has been received
883 * by the device. This intent will be delivered to all registered
884 * receivers as a notification. These apps are not expected to write the
885 * message or notify the user. The intent will have the following extra
886 * values:</p>
887 *
888 * <ul>
889 * <li><em>"pdus"</em> - An Object[] of byte[]s containing the PDUs
890 * that make up the message.</li>
891 * </ul>
892 *
893 * <p>The extra values can be extracted using
894 * {@link #getMessagesFromIntent(Intent)}.</p>
895 *
896 * <p>If a BroadcastReceiver encounters an error while processing
897 * this intent it should set the result code appropriately.</p>
898 *
899 * <p>Requires {@link android.Manifest.permission#RECEIVE_SMS} to receive.</p>
900 */
901 @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
902 public static final String SMS_RECEIVED_ACTION =
903 "android.provider.Telephony.SMS_RECEIVED";
904
905 /**
906 * Broadcast Action: A new data based SMS message has been received
907 * by the device. This intent will be delivered to all registered
908 * receivers as a notification. The intent will have the following extra
909 * values:</p>
910 *
911 * <ul>
912 * <li><em>"pdus"</em> - An Object[] of byte[]s containing the PDUs
913 * that make up the message.</li>
914 * </ul>
915 *
916 * <p>The extra values can be extracted using
917 * {@link #getMessagesFromIntent(Intent)}.</p>
918 *
919 * <p>If a BroadcastReceiver encounters an error while processing
920 * this intent it should set the result code appropriately.</p>
921 *
922 * <p>Requires {@link android.Manifest.permission#RECEIVE_SMS} to receive.</p>
923 */
924 @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
925 public static final String DATA_SMS_RECEIVED_ACTION =
926 "android.intent.action.DATA_SMS_RECEIVED";
927
928 /**
929 * Broadcast Action: A new WAP PUSH message has been received by the
930 * device. This intent will only be delivered to the default
931 * sms app. That app is responsible for writing the message and notifying
932 * the user. The intent will have the following extra values:</p>
933 *
934 * <ul>
935 * <li><em>"transactionId"</em> - (Integer) The WAP transaction ID</li>
936 * <li><em>"pduType"</em> - (Integer) The WAP PDU type</li>
937 * <li><em>"header"</em> - (byte[]) The header of the message</li>
938 * <li><em>"data"</em> - (byte[]) The data payload of the message</li>
939 * <li><em>"contentTypeParameters" </em>
940 * -(HashMap&lt;String,String&gt;) Any parameters associated with the content type
941 * (decoded from the WSP Content-Type header)</li>
942 * <li><em>"subscription"</em> - An optional long value of the subscription id which
943 * received the message.</li>
944 * <li><em>"slot"</em> - An optional int value of the SIM slot containing the
945 * subscription.</li>
946 * <li><em>"phone"</em> - An optional int value of the phone id associated with the
947 * subscription.</li>
948 * </ul>
949 *
950 * <p>If a BroadcastReceiver encounters an error while processing
951 * this intent it should set the result code appropriately.</p>
952 *
953 * <p>The contentTypeParameters extra value is map of content parameters keyed by
954 * their names.</p>
955 *
956 * <p>If any unassigned well-known parameters are encountered, the key of the map will
957 * be 'unassigned/0x...', where '...' is the hex value of the unassigned parameter. If
958 * a parameter has No-Value the value in the map will be null.</p>
959 *
960 * <p>Requires {@link android.Manifest.permission#RECEIVE_MMS} or
961 * {@link android.Manifest.permission#RECEIVE_WAP_PUSH} (depending on WAP PUSH type) to
962 * receive.</p>
963 *
964 * <p class="note"><strong>Note:</strong>
965 * The broadcast receiver that filters for this intent must declare
966 * {@link android.Manifest.permission#BROADCAST_WAP_PUSH} as a required permission in
967 * the <a href="{@docRoot}guide/topics/manifest/receiver-element.html">{@code
968 * <receiver>}</a> tag.
969 */
970 @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
971 public static final String WAP_PUSH_DELIVER_ACTION =
972 "android.provider.Telephony.WAP_PUSH_DELIVER";
973
974 /**
975 * Broadcast Action: A new WAP PUSH message has been received by the
976 * device. This intent will be delivered to all registered
977 * receivers as a notification. These apps are not expected to write the
978 * message or notify the user. The intent will have the following extra
979 * values:</p>
980 *
981 * <ul>
982 * <li><em>"transactionId"</em> - (Integer) The WAP transaction ID</li>
983 * <li><em>"pduType"</em> - (Integer) The WAP PDU type</li>
984 * <li><em>"header"</em> - (byte[]) The header of the message</li>
985 * <li><em>"data"</em> - (byte[]) The data payload of the message</li>
986 * <li><em>"contentTypeParameters"</em>
987 * - (HashMap&lt;String,String&gt;) Any parameters associated with the content type
988 * (decoded from the WSP Content-Type header)</li>
989 * </ul>
990 *
991 * <p>If a BroadcastReceiver encounters an error while processing
992 * this intent it should set the result code appropriately.</p>
993 *
994 * <p>The contentTypeParameters extra value is map of content parameters keyed by
995 * their names.</p>
996 *
997 * <p>If any unassigned well-known parameters are encountered, the key of the map will
998 * be 'unassigned/0x...', where '...' is the hex value of the unassigned parameter. If
999 * a parameter has No-Value the value in the map will be null.</p>
1000 *
1001 * <p>Requires {@link android.Manifest.permission#RECEIVE_MMS} or
1002 * {@link android.Manifest.permission#RECEIVE_WAP_PUSH} (depending on WAP PUSH type) to
1003 * receive.</p>
1004 */
1005 @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
1006 public static final String WAP_PUSH_RECEIVED_ACTION =
1007 "android.provider.Telephony.WAP_PUSH_RECEIVED";
1008
1009 /**
1010 * Broadcast Action: A new Cell Broadcast message has been received
1011 * by the device. The intent will have the following extra
1012 * values:</p>
1013 *
1014 * <ul>
1015 * <li><em>"message"</em> - An SmsCbMessage object containing the broadcast message
1016 * data. This is not an emergency alert, so ETWS and CMAS data will be null.</li>
1017 * </ul>
1018 *
1019 * <p>The extra values can be extracted using
1020 * {@link #getMessagesFromIntent(Intent)}.</p>
1021 *
1022 * <p>If a BroadcastReceiver encounters an error while processing
1023 * this intent it should set the result code appropriately.</p>
1024 *
1025 * <p>Requires {@link android.Manifest.permission#RECEIVE_SMS} to receive.</p>
1026 */
1027 @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
1028 public static final String SMS_CB_RECEIVED_ACTION =
1029 "android.provider.Telephony.SMS_CB_RECEIVED";
1030
1031 /**
1032 * Action: A SMS based carrier provision intent. Used to identify default
1033 * carrier provisioning app on the device.
1034 * @hide
1035 */
1036 @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
1037 @TestApi
1038 public static final String SMS_CARRIER_PROVISION_ACTION =
1039 "android.provider.Telephony.SMS_CARRIER_PROVISION";
1040
1041 /**
1042 * Broadcast Action: A new Emergency Broadcast message has been received
1043 * by the device. The intent will have the following extra
1044 * values:</p>
1045 *
1046 * <ul>
1047 * <li><em>"message"</em> - An SmsCbMessage object containing the broadcast message
1048 * data, including ETWS or CMAS warning notification info if present.</li>
1049 * </ul>
1050 *
1051 * <p>The extra values can be extracted using
1052 * {@link #getMessagesFromIntent(Intent)}.</p>
1053 *
1054 * <p>If a BroadcastReceiver encounters an error while processing
1055 * this intent it should set the result code appropriately.</p>
1056 *
1057 * <p>Requires {@link android.Manifest.permission#RECEIVE_EMERGENCY_BROADCAST} to
1058 * receive.</p>
1059 * @removed
1060 */
1061 @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
1062 public static final String SMS_EMERGENCY_CB_RECEIVED_ACTION =
1063 "android.provider.Telephony.SMS_EMERGENCY_CB_RECEIVED";
1064
1065 /**
1066 * Broadcast Action: A new CDMA SMS has been received containing Service Category
1067 * Program Data (updates the list of enabled broadcast channels). The intent will
1068 * have the following extra values:</p>
1069 *
1070 * <ul>
1071 * <li><em>"operations"</em> - An array of CdmaSmsCbProgramData objects containing
1072 * the service category operations (add/delete/clear) to perform.</li>
1073 * </ul>
1074 *
1075 * <p>The extra values can be extracted using
1076 * {@link #getMessagesFromIntent(Intent)}.</p>
1077 *
1078 * <p>If a BroadcastReceiver encounters an error while processing
1079 * this intent it should set the result code appropriately.</p>
1080 *
1081 * <p>Requires {@link android.Manifest.permission#RECEIVE_SMS} to receive.</p>
1082 */
1083 @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
1084 public static final String SMS_SERVICE_CATEGORY_PROGRAM_DATA_RECEIVED_ACTION =
1085 "android.provider.Telephony.SMS_SERVICE_CATEGORY_PROGRAM_DATA_RECEIVED";
1086
1087 /**
1088 * Broadcast Action: The SIM storage for SMS messages is full. If
1089 * space is not freed, messages targeted for the SIM (class 2) may
1090 * not be saved.
1091 *
1092 * <p>Requires {@link android.Manifest.permission#RECEIVE_SMS} to receive.</p>
1093 */
1094 @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
1095 public static final String SIM_FULL_ACTION =
1096 "android.provider.Telephony.SIM_FULL";
1097
1098 /**
1099 * Broadcast Action: An incoming SMS has been rejected by the
1100 * telephony framework. This intent is sent in lieu of any
1101 * of the RECEIVED_ACTION intents. The intent will have the
1102 * following extra value:</p>
1103 *
1104 * <ul>
1105 * <li><em>"result"</em> - An int result code, e.g. {@link #RESULT_SMS_OUT_OF_MEMORY}
1106 * indicating the error returned to the network.</li>
1107 * </ul>
1108 *
1109 * <p>Requires {@link android.Manifest.permission#RECEIVE_SMS} to receive.</p>
1110 */
1111 @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
1112 public static final String SMS_REJECTED_ACTION =
1113 "android.provider.Telephony.SMS_REJECTED";
1114
1115 /**
1116 * Broadcast Action: An incoming MMS has been downloaded. The intent is sent to all
1117 * users, except for secondary users where SMS has been disabled and to managed
1118 * profiles.
1119 * @hide
1120 */
1121 @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
1122 public static final String MMS_DOWNLOADED_ACTION =
1123 "android.provider.Telephony.MMS_DOWNLOADED";
1124
1125 /**
Cassie5b97cf12018-02-22 09:58:33 -08001126 * Broadcast Action: A debug code has been entered in the dialer. This intent is
1127 * broadcast by the system and OEM telephony apps may need to receive these broadcasts.
1128 * These "secret codes" are used to activate developer menus by dialing certain codes.
1129 * And they are of the form {@code *#*#&lt;code&gt;#*#*}. The intent will have the data
1130 * URI: {@code android_secret_code://&lt;code&gt;}. It is possible that a manifest
1131 * receiver would be woken up even if it is not currently running.
1132 *
1133 * <p>Requires {@code android.Manifest.permission#CONTROL_INCALL_EXPERIENCE} to
1134 * send and receive.</p>
Cassie6d0a5712018-08-21 13:38:39 -07001135 * @deprecated it is no longer supported, use {@link
1136 * TelephonyManager#ACTION_SECRET_CODE} instead
Cassie866f4942018-01-19 17:23:36 -08001137 */
Cassie6d0a5712018-08-21 13:38:39 -07001138 @Deprecated
Cassie866f4942018-01-19 17:23:36 -08001139 @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
1140 public static final String SECRET_CODE_ACTION =
1141 "android.provider.Telephony.SECRET_CODE";
1142
1143 /**
Dan Willemsen4980bf42017-02-14 14:17:12 -08001144 * Broadcast action: When the default SMS package changes,
1145 * the previous default SMS package and the new default SMS
1146 * package are sent this broadcast to notify them of the change.
1147 * A boolean is specified in {@link #EXTRA_IS_DEFAULT_SMS_APP} to
1148 * indicate whether the package is the new default SMS package.
1149 */
1150 @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
1151 public static final String ACTION_DEFAULT_SMS_PACKAGE_CHANGED =
1152 "android.provider.action.DEFAULT_SMS_PACKAGE_CHANGED";
1153
1154 /**
1155 * The IsDefaultSmsApp boolean passed as an
1156 * extra for {@link #ACTION_DEFAULT_SMS_PACKAGE_CHANGED} to indicate whether the
1157 * SMS app is becoming the default SMS app or is no longer the default.
1158 *
1159 * @see #ACTION_DEFAULT_SMS_PACKAGE_CHANGED
1160 */
1161 public static final String EXTRA_IS_DEFAULT_SMS_APP =
1162 "android.provider.extra.IS_DEFAULT_SMS_APP";
1163
1164 /**
1165 * Broadcast action: When a change is made to the SmsProvider or
1166 * MmsProvider by a process other than the default SMS application,
1167 * this intent is broadcast to the default SMS application so it can
1168 * re-sync or update the change. The uri that was used to call the provider
1169 * can be retrieved from the intent with getData(). The actual affected uris
1170 * (which would depend on the selection specified) are not included.
1171 */
1172 @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
1173 public static final String ACTION_EXTERNAL_PROVIDER_CHANGE =
1174 "android.provider.action.EXTERNAL_PROVIDER_CHANGE";
1175
1176 /**
sqian1ed547e2018-11-05 14:28:49 -08001177 * Same as {@link #ACTION_DEFAULT_SMS_PACKAGE_CHANGED} but it's implicit (e.g. sent to
1178 * all apps) and requires
1179 * {@link android.Manifest.permission#MONITOR_DEFAULT_SMS_PACKAGE} to receive.
1180 *
1181 * @hide
1182 */
1183 @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
1184 public static final String ACTION_DEFAULT_SMS_PACKAGE_CHANGED_INTERNAL =
1185 "android.provider.action.DEFAULT_SMS_PACKAGE_CHANGED_INTERNAL";
1186
1187 /**
Amit Mahajan3b5d52c2018-10-22 10:43:34 -07001188 * Broadcast action: When SMS-MMS db is being created. If file-based encryption is
1189 * supported, this broadcast indicates creation of the db in credential-encrypted
1190 * storage. A boolean is specified in {@link #EXTRA_IS_INITIAL_CREATE} to indicate if
1191 * this is the initial create of the db. Requires
1192 * {@link android.Manifest.permission#READ_SMS} to receive.
1193 *
1194 * @see #EXTRA_IS_INITIAL_CREATE
1195 *
1196 * @hide
1197 */
1198 @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
1199 public static final String ACTION_SMS_MMS_DB_CREATED =
1200 "android.provider.action.SMS_MMS_DB_CREATED";
1201
1202 /**
1203 * Boolean flag passed as an extra with {@link #ACTION_SMS_MMS_DB_CREATED} to indicate
1204 * whether the DB creation is the initial creation on the device, that is it is after a
1205 * factory-data reset or a new device. Any subsequent creations of the DB (which
1206 * happens only in error scenarios) will have this flag set to false.
1207 *
1208 * @see #ACTION_SMS_MMS_DB_CREATED
1209 *
1210 * @hide
1211 */
1212 public static final String EXTRA_IS_INITIAL_CREATE =
1213 "android.provider.extra.IS_INITIAL_CREATE";
1214
1215 /**
Jayachandran C32e712e2018-10-30 15:09:06 -07001216 * Broadcast intent action indicating that the telephony provider SMS MMS database is
1217 * corrupted. A boolean is specified in {@link #EXTRA_IS_CORRUPTED} to indicate if the
1218 * database is corrupted. Requires the
1219 * {@link android.Manifest.permission#READ_PRIVILEGED_PHONE_STATE permission.
1220 *
1221 * @hide
1222 */
1223 @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
1224 @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
1225 public static final String ACTION_SMS_MMS_DB_LOST =
1226 "android.provider.action.SMS_MMS_DB_LOST";
1227
1228 /**
1229 * Boolean flag passed as an extra with {@link #ACTION_SMS_MMS_DB_LOST} to indicate
1230 * whether the DB got corrupted or not.
1231 *
1232 * @see #ACTION_SMS_MMS_DB_LOST
1233 *
1234 * @hide
1235 */
1236 public static final String EXTRA_IS_CORRUPTED =
1237 "android.provider.extra.IS_CORRUPTED";
1238
1239 /**
Dan Willemsen4980bf42017-02-14 14:17:12 -08001240 * Read the PDUs out of an {@link #SMS_RECEIVED_ACTION} or a
1241 * {@link #DATA_SMS_RECEIVED_ACTION} intent.
1242 *
1243 * @param intent the intent to read from
1244 * @return an array of SmsMessages for the PDUs
1245 */
1246 public static SmsMessage[] getMessagesFromIntent(Intent intent) {
1247 Object[] messages;
1248 try {
1249 messages = (Object[]) intent.getSerializableExtra("pdus");
1250 }
1251 catch (ClassCastException e) {
1252 Rlog.e(TAG, "getMessagesFromIntent: " + e);
1253 return null;
1254 }
1255
1256 if (messages == null) {
1257 Rlog.e(TAG, "pdus does not exist in the intent");
1258 return null;
1259 }
1260
1261 String format = intent.getStringExtra("format");
1262 int subId = intent.getIntExtra(PhoneConstants.SUBSCRIPTION_KEY,
1263 SubscriptionManager.getDefaultSmsSubscriptionId());
1264
1265 Rlog.v(TAG, " getMessagesFromIntent sub_id : " + subId);
1266
1267 int pduCount = messages.length;
1268 SmsMessage[] msgs = new SmsMessage[pduCount];
1269
1270 for (int i = 0; i < pduCount; i++) {
1271 byte[] pdu = (byte[]) messages[i];
1272 msgs[i] = SmsMessage.createFromPdu(pdu, format);
1273 if (msgs[i] != null) msgs[i].setSubId(subId);
1274 }
1275 return msgs;
1276 }
1277 }
1278 }
1279
1280 /**
pkanwar16b8a0d2017-06-07 10:59:41 -07001281 * Base column for the table that contain Carrier Public key.
1282 * @hide
1283 */
1284 public interface CarrierColumns extends BaseColumns {
1285
1286 public static final String MCC = "mcc";
1287 public static final String MNC = "mnc";
1288 public static final String KEY_TYPE = "key_type";
1289 public static final String MVNO_TYPE = "mvno_type";
1290 public static final String MVNO_MATCH_DATA = "mvno_match_data";
1291 public static final String PUBLIC_KEY = "public_key";
1292 public static final String KEY_IDENTIFIER = "key_identifier";
1293 public static final String EXPIRATION_TIME = "expiration_time";
1294 public static final String LAST_MODIFIED = "last_modified";
1295
1296 /**
1297 * The {@code content://} style URL for this table.
1298 * @hide
1299 */
1300 public static final Uri CONTENT_URI = Uri.parse("content://carrier_information/carrier");
1301 }
1302
1303 /**
Dan Willemsen4980bf42017-02-14 14:17:12 -08001304 * Base columns for tables that contain MMSs.
1305 */
1306 public interface BaseMmsColumns extends BaseColumns {
1307
1308 /** Message box: all messages. */
1309 public static final int MESSAGE_BOX_ALL = 0;
1310 /** Message box: inbox. */
1311 public static final int MESSAGE_BOX_INBOX = 1;
1312 /** Message box: sent messages. */
1313 public static final int MESSAGE_BOX_SENT = 2;
1314 /** Message box: drafts. */
1315 public static final int MESSAGE_BOX_DRAFTS = 3;
1316 /** Message box: outbox. */
1317 public static final int MESSAGE_BOX_OUTBOX = 4;
1318 /** Message box: failed. */
1319 public static final int MESSAGE_BOX_FAILED = 5;
1320
1321 /**
1322 * The thread ID of the message.
1323 * <P>Type: INTEGER (long)</P>
1324 */
1325 public static final String THREAD_ID = "thread_id";
1326
1327 /**
1328 * The date the message was received.
1329 * <P>Type: INTEGER (long)</P>
1330 */
1331 public static final String DATE = "date";
1332
1333 /**
1334 * The date the message was sent.
1335 * <P>Type: INTEGER (long)</P>
1336 */
1337 public static final String DATE_SENT = "date_sent";
1338
1339 /**
1340 * The box which the message belongs to, e.g. {@link #MESSAGE_BOX_INBOX}.
1341 * <P>Type: INTEGER</P>
1342 */
1343 public static final String MESSAGE_BOX = "msg_box";
1344
1345 /**
1346 * Has the message been read?
1347 * <P>Type: INTEGER (boolean)</P>
1348 */
1349 public static final String READ = "read";
1350
1351 /**
1352 * Has the message been seen by the user? The "seen" flag determines
1353 * whether we need to show a new message notification.
1354 * <P>Type: INTEGER (boolean)</P>
1355 */
1356 public static final String SEEN = "seen";
1357
1358 /**
1359 * Does the message have only a text part (can also have a subject) with
1360 * no picture, slideshow, sound, etc. parts?
1361 * <P>Type: INTEGER (boolean)</P>
1362 */
1363 public static final String TEXT_ONLY = "text_only";
1364
1365 /**
1366 * The {@code Message-ID} of the message.
1367 * <P>Type: TEXT</P>
1368 */
1369 public static final String MESSAGE_ID = "m_id";
1370
1371 /**
1372 * The subject of the message, if present.
1373 * <P>Type: TEXT</P>
1374 */
1375 public static final String SUBJECT = "sub";
1376
1377 /**
1378 * The character set of the subject, if present.
1379 * <P>Type: INTEGER</P>
1380 */
1381 public static final String SUBJECT_CHARSET = "sub_cs";
1382
1383 /**
1384 * The {@code Content-Type} of the message.
1385 * <P>Type: TEXT</P>
1386 */
1387 public static final String CONTENT_TYPE = "ct_t";
1388
1389 /**
1390 * The {@code Content-Location} of the message.
1391 * <P>Type: TEXT</P>
1392 */
1393 public static final String CONTENT_LOCATION = "ct_l";
1394
1395 /**
1396 * The expiry time of the message.
1397 * <P>Type: INTEGER (long)</P>
1398 */
1399 public static final String EXPIRY = "exp";
1400
1401 /**
1402 * The class of the message.
1403 * <P>Type: TEXT</P>
1404 */
1405 public static final String MESSAGE_CLASS = "m_cls";
1406
1407 /**
1408 * The type of the message defined by MMS spec.
1409 * <P>Type: INTEGER</P>
1410 */
1411 public static final String MESSAGE_TYPE = "m_type";
1412
1413 /**
1414 * The version of the specification that this message conforms to.
1415 * <P>Type: INTEGER</P>
1416 */
1417 public static final String MMS_VERSION = "v";
1418
1419 /**
1420 * The size of the message.
1421 * <P>Type: INTEGER</P>
1422 */
1423 public static final String MESSAGE_SIZE = "m_size";
1424
1425 /**
1426 * The priority of the message.
1427 * <P>Type: INTEGER</P>
1428 */
1429 public static final String PRIORITY = "pri";
1430
1431 /**
1432 * The {@code read-report} of the message.
1433 * <P>Type: INTEGER (boolean)</P>
1434 */
1435 public static final String READ_REPORT = "rr";
1436
1437 /**
1438 * Is read report allowed?
1439 * <P>Type: INTEGER (boolean)</P>
1440 */
1441 public static final String REPORT_ALLOWED = "rpt_a";
1442
1443 /**
1444 * The {@code response-status} of the message.
1445 * <P>Type: INTEGER</P>
1446 */
1447 public static final String RESPONSE_STATUS = "resp_st";
1448
1449 /**
1450 * The {@code status} of the message.
1451 * <P>Type: INTEGER</P>
1452 */
1453 public static final String STATUS = "st";
1454
1455 /**
1456 * The {@code transaction-id} of the message.
1457 * <P>Type: TEXT</P>
1458 */
1459 public static final String TRANSACTION_ID = "tr_id";
1460
1461 /**
1462 * The {@code retrieve-status} of the message.
1463 * <P>Type: INTEGER</P>
1464 */
1465 public static final String RETRIEVE_STATUS = "retr_st";
1466
1467 /**
1468 * The {@code retrieve-text} of the message.
1469 * <P>Type: TEXT</P>
1470 */
1471 public static final String RETRIEVE_TEXT = "retr_txt";
1472
1473 /**
1474 * The character set of the retrieve-text.
1475 * <P>Type: INTEGER</P>
1476 */
1477 public static final String RETRIEVE_TEXT_CHARSET = "retr_txt_cs";
1478
1479 /**
1480 * The {@code read-status} of the message.
1481 * <P>Type: INTEGER</P>
1482 */
1483 public static final String READ_STATUS = "read_status";
1484
1485 /**
1486 * The {@code content-class} of the message.
1487 * <P>Type: INTEGER</P>
1488 */
1489 public static final String CONTENT_CLASS = "ct_cls";
1490
1491 /**
1492 * The {@code delivery-report} of the message.
1493 * <P>Type: INTEGER</P>
1494 */
1495 public static final String DELIVERY_REPORT = "d_rpt";
1496
1497 /**
1498 * The {@code delivery-time-token} of the message.
1499 * <P>Type: INTEGER</P>
1500 * @deprecated this column is no longer supported.
1501 * @hide
1502 */
1503 @Deprecated
1504 public static final String DELIVERY_TIME_TOKEN = "d_tm_tok";
1505
1506 /**
1507 * The {@code delivery-time} of the message.
1508 * <P>Type: INTEGER</P>
1509 */
1510 public static final String DELIVERY_TIME = "d_tm";
1511
1512 /**
1513 * The {@code response-text} of the message.
1514 * <P>Type: TEXT</P>
1515 */
1516 public static final String RESPONSE_TEXT = "resp_txt";
1517
1518 /**
1519 * The {@code sender-visibility} of the message.
1520 * <P>Type: TEXT</P>
1521 * @deprecated this column is no longer supported.
1522 * @hide
1523 */
1524 @Deprecated
1525 public static final String SENDER_VISIBILITY = "s_vis";
1526
1527 /**
1528 * The {@code reply-charging} of the message.
1529 * <P>Type: INTEGER</P>
1530 * @deprecated this column is no longer supported.
1531 * @hide
1532 */
1533 @Deprecated
1534 public static final String REPLY_CHARGING = "r_chg";
1535
1536 /**
1537 * The {@code reply-charging-deadline-token} of the message.
1538 * <P>Type: INTEGER</P>
1539 * @deprecated this column is no longer supported.
1540 * @hide
1541 */
1542 @Deprecated
1543 public static final String REPLY_CHARGING_DEADLINE_TOKEN = "r_chg_dl_tok";
1544
1545 /**
1546 * The {@code reply-charging-deadline} of the message.
1547 * <P>Type: INTEGER</P>
1548 * @deprecated this column is no longer supported.
1549 * @hide
1550 */
1551 @Deprecated
1552 public static final String REPLY_CHARGING_DEADLINE = "r_chg_dl";
1553
1554 /**
1555 * The {@code reply-charging-id} of the message.
1556 * <P>Type: TEXT</P>
1557 * @deprecated this column is no longer supported.
1558 * @hide
1559 */
1560 @Deprecated
1561 public static final String REPLY_CHARGING_ID = "r_chg_id";
1562
1563 /**
1564 * The {@code reply-charging-size} of the message.
1565 * <P>Type: INTEGER</P>
1566 * @deprecated this column is no longer supported.
1567 * @hide
1568 */
1569 @Deprecated
1570 public static final String REPLY_CHARGING_SIZE = "r_chg_sz";
1571
1572 /**
1573 * The {@code previously-sent-by} of the message.
1574 * <P>Type: TEXT</P>
1575 * @deprecated this column is no longer supported.
1576 * @hide
1577 */
1578 @Deprecated
1579 public static final String PREVIOUSLY_SENT_BY = "p_s_by";
1580
1581 /**
1582 * The {@code previously-sent-date} of the message.
1583 * <P>Type: INTEGER</P>
1584 * @deprecated this column is no longer supported.
1585 * @hide
1586 */
1587 @Deprecated
1588 public static final String PREVIOUSLY_SENT_DATE = "p_s_d";
1589
1590 /**
1591 * The {@code store} of the message.
1592 * <P>Type: TEXT</P>
1593 * @deprecated this column is no longer supported.
1594 * @hide
1595 */
1596 @Deprecated
1597 public static final String STORE = "store";
1598
1599 /**
1600 * The {@code mm-state} of the message.
1601 * <P>Type: INTEGER</P>
1602 * @deprecated this column is no longer supported.
1603 * @hide
1604 */
1605 @Deprecated
1606 public static final String MM_STATE = "mm_st";
1607
1608 /**
1609 * The {@code mm-flags-token} of the message.
1610 * <P>Type: INTEGER</P>
1611 * @deprecated this column is no longer supported.
1612 * @hide
1613 */
1614 @Deprecated
1615 public static final String MM_FLAGS_TOKEN = "mm_flg_tok";
1616
1617 /**
1618 * The {@code mm-flags} of the message.
1619 * <P>Type: TEXT</P>
1620 * @deprecated this column is no longer supported.
1621 * @hide
1622 */
1623 @Deprecated
1624 public static final String MM_FLAGS = "mm_flg";
1625
1626 /**
1627 * The {@code store-status} of the message.
1628 * <P>Type: TEXT</P>
1629 * @deprecated this column is no longer supported.
1630 * @hide
1631 */
1632 @Deprecated
1633 public static final String STORE_STATUS = "store_st";
1634
1635 /**
1636 * The {@code store-status-text} of the message.
1637 * <P>Type: TEXT</P>
1638 * @deprecated this column is no longer supported.
1639 * @hide
1640 */
1641 @Deprecated
1642 public static final String STORE_STATUS_TEXT = "store_st_txt";
1643
1644 /**
1645 * The {@code stored} of the message.
1646 * <P>Type: TEXT</P>
1647 * @deprecated this column is no longer supported.
1648 * @hide
1649 */
1650 @Deprecated
1651 public static final String STORED = "stored";
1652
1653 /**
1654 * The {@code totals} of the message.
1655 * <P>Type: TEXT</P>
1656 * @deprecated this column is no longer supported.
1657 * @hide
1658 */
1659 @Deprecated
1660 public static final String TOTALS = "totals";
1661
1662 /**
1663 * The {@code mbox-totals} of the message.
1664 * <P>Type: TEXT</P>
1665 * @deprecated this column is no longer supported.
1666 * @hide
1667 */
1668 @Deprecated
1669 public static final String MBOX_TOTALS = "mb_t";
1670
1671 /**
1672 * The {@code mbox-totals-token} of the message.
1673 * <P>Type: INTEGER</P>
1674 * @deprecated this column is no longer supported.
1675 * @hide
1676 */
1677 @Deprecated
1678 public static final String MBOX_TOTALS_TOKEN = "mb_t_tok";
1679
1680 /**
1681 * The {@code quotas} of the message.
1682 * <P>Type: TEXT</P>
1683 * @deprecated this column is no longer supported.
1684 * @hide
1685 */
1686 @Deprecated
1687 public static final String QUOTAS = "qt";
1688
1689 /**
1690 * The {@code mbox-quotas} of the message.
1691 * <P>Type: TEXT</P>
1692 * @deprecated this column is no longer supported.
1693 * @hide
1694 */
1695 @Deprecated
1696 public static final String MBOX_QUOTAS = "mb_qt";
1697
1698 /**
1699 * The {@code mbox-quotas-token} of the message.
1700 * <P>Type: INTEGER</P>
1701 * @deprecated this column is no longer supported.
1702 * @hide
1703 */
1704 @Deprecated
1705 public static final String MBOX_QUOTAS_TOKEN = "mb_qt_tok";
1706
1707 /**
1708 * The {@code message-count} of the message.
1709 * <P>Type: INTEGER</P>
1710 * @deprecated this column is no longer supported.
1711 * @hide
1712 */
1713 @Deprecated
1714 public static final String MESSAGE_COUNT = "m_cnt";
1715
1716 /**
1717 * The {@code start} of the message.
1718 * <P>Type: INTEGER</P>
1719 * @deprecated this column is no longer supported.
1720 * @hide
1721 */
1722 @Deprecated
1723 public static final String START = "start";
1724
1725 /**
1726 * The {@code distribution-indicator} of the message.
1727 * <P>Type: TEXT</P>
1728 * @deprecated this column is no longer supported.
1729 * @hide
1730 */
1731 @Deprecated
1732 public static final String DISTRIBUTION_INDICATOR = "d_ind";
1733
1734 /**
1735 * The {@code element-descriptor} of the message.
1736 * <P>Type: TEXT</P>
1737 * @deprecated this column is no longer supported.
1738 * @hide
1739 */
1740 @Deprecated
1741 public static final String ELEMENT_DESCRIPTOR = "e_des";
1742
1743 /**
1744 * The {@code limit} of the message.
1745 * <P>Type: INTEGER</P>
1746 * @deprecated this column is no longer supported.
1747 * @hide
1748 */
1749 @Deprecated
1750 public static final String LIMIT = "limit";
1751
1752 /**
1753 * The {@code recommended-retrieval-mode} of the message.
1754 * <P>Type: INTEGER</P>
1755 * @deprecated this column is no longer supported.
1756 * @hide
1757 */
1758 @Deprecated
1759 public static final String RECOMMENDED_RETRIEVAL_MODE = "r_r_mod";
1760
1761 /**
1762 * The {@code recommended-retrieval-mode-text} of the message.
1763 * <P>Type: TEXT</P>
1764 * @deprecated this column is no longer supported.
1765 * @hide
1766 */
1767 @Deprecated
1768 public static final String RECOMMENDED_RETRIEVAL_MODE_TEXT = "r_r_mod_txt";
1769
1770 /**
1771 * The {@code status-text} of the message.
1772 * <P>Type: TEXT</P>
1773 * @deprecated this column is no longer supported.
1774 * @hide
1775 */
1776 @Deprecated
1777 public static final String STATUS_TEXT = "st_txt";
1778
1779 /**
1780 * The {@code applic-id} of the message.
1781 * <P>Type: TEXT</P>
1782 * @deprecated this column is no longer supported.
1783 * @hide
1784 */
1785 @Deprecated
1786 public static final String APPLIC_ID = "apl_id";
1787
1788 /**
1789 * The {@code reply-applic-id} of the message.
1790 * <P>Type: TEXT</P>
1791 * @deprecated this column is no longer supported.
1792 * @hide
1793 */
1794 @Deprecated
1795 public static final String REPLY_APPLIC_ID = "r_apl_id";
1796
1797 /**
1798 * The {@code aux-applic-id} of the message.
1799 * <P>Type: TEXT</P>
1800 * @deprecated this column is no longer supported.
1801 * @hide
1802 */
1803 @Deprecated
1804 public static final String AUX_APPLIC_ID = "aux_apl_id";
1805
1806 /**
1807 * The {@code drm-content} of the message.
1808 * <P>Type: TEXT</P>
1809 * @deprecated this column is no longer supported.
1810 * @hide
1811 */
1812 @Deprecated
1813 public static final String DRM_CONTENT = "drm_c";
1814
1815 /**
1816 * The {@code adaptation-allowed} of the message.
1817 * <P>Type: TEXT</P>
1818 * @deprecated this column is no longer supported.
1819 * @hide
1820 */
1821 @Deprecated
1822 public static final String ADAPTATION_ALLOWED = "adp_a";
1823
1824 /**
1825 * The {@code replace-id} of the message.
1826 * <P>Type: TEXT</P>
1827 * @deprecated this column is no longer supported.
1828 * @hide
1829 */
1830 @Deprecated
1831 public static final String REPLACE_ID = "repl_id";
1832
1833 /**
1834 * The {@code cancel-id} of the message.
1835 * <P>Type: TEXT</P>
1836 * @deprecated this column is no longer supported.
1837 * @hide
1838 */
1839 @Deprecated
1840 public static final String CANCEL_ID = "cl_id";
1841
1842 /**
1843 * The {@code cancel-status} of the message.
1844 * <P>Type: INTEGER</P>
1845 * @deprecated this column is no longer supported.
1846 * @hide
1847 */
1848 @Deprecated
1849 public static final String CANCEL_STATUS = "cl_st";
1850
1851 /**
1852 * Is the message locked?
1853 * <P>Type: INTEGER (boolean)</P>
1854 */
1855 public static final String LOCKED = "locked";
1856
1857 /**
1858 * The subscription to which the message belongs to. Its value will be
1859 * < 0 if the sub id cannot be determined.
1860 * <p>Type: INTEGER (long)</p>
1861 */
1862 public static final String SUBSCRIPTION_ID = "sub_id";
1863
1864 /**
1865 * The identity of the sender of a sent message. It is
1866 * usually the package name of the app which sends the message.
1867 * <p class="note"><strong>Note:</strong>
1868 * This column is read-only. It is set by the provider and can not be changed by apps.
1869 * <p>Type: TEXT</p>
1870 */
1871 public static final String CREATOR = "creator";
1872 }
1873
1874 /**
1875 * Columns for the "canonical_addresses" table used by MMS and SMS.
1876 */
1877 public interface CanonicalAddressesColumns extends BaseColumns {
1878 /**
1879 * An address used in MMS or SMS. Email addresses are
1880 * converted to lower case and are compared by string
1881 * equality. Other addresses are compared using
1882 * PHONE_NUMBERS_EQUAL.
1883 * <P>Type: TEXT</P>
1884 */
1885 public static final String ADDRESS = "address";
1886 }
1887
1888 /**
1889 * Columns for the "threads" table used by MMS and SMS.
1890 */
1891 public interface ThreadsColumns extends BaseColumns {
1892
1893 /**
1894 * The date at which the thread was created.
1895 * <P>Type: INTEGER (long)</P>
1896 */
1897 public static final String DATE = "date";
1898
1899 /**
1900 * A string encoding of the recipient IDs of the recipients of
1901 * the message, in numerical order and separated by spaces.
1902 * <P>Type: TEXT</P>
1903 */
1904 public static final String RECIPIENT_IDS = "recipient_ids";
1905
1906 /**
1907 * The message count of the thread.
1908 * <P>Type: INTEGER</P>
1909 */
1910 public static final String MESSAGE_COUNT = "message_count";
1911
1912 /**
1913 * Indicates whether all messages of the thread have been read.
1914 * <P>Type: INTEGER</P>
1915 */
1916 public static final String READ = "read";
1917
1918 /**
1919 * The snippet of the latest message in the thread.
1920 * <P>Type: TEXT</P>
1921 */
1922 public static final String SNIPPET = "snippet";
1923
1924 /**
1925 * The charset of the snippet.
1926 * <P>Type: INTEGER</P>
1927 */
1928 public static final String SNIPPET_CHARSET = "snippet_cs";
1929
1930 /**
1931 * Type of the thread, either {@link Threads#COMMON_THREAD} or
1932 * {@link Threads#BROADCAST_THREAD}.
1933 * <P>Type: INTEGER</P>
1934 */
1935 public static final String TYPE = "type";
1936
1937 /**
1938 * Indicates whether there is a transmission error in the thread.
1939 * <P>Type: INTEGER</P>
1940 */
1941 public static final String ERROR = "error";
1942
1943 /**
1944 * Indicates whether this thread contains any attachments.
1945 * <P>Type: INTEGER</P>
1946 */
1947 public static final String HAS_ATTACHMENT = "has_attachment";
1948
1949 /**
1950 * If the thread is archived
1951 * <P>Type: INTEGER (boolean)</P>
1952 */
1953 public static final String ARCHIVED = "archived";
1954 }
1955
1956 /**
1957 * Helper functions for the "threads" table used by MMS and SMS.
Leland Millerc445b2b2019-01-09 17:00:09 -08001958 *
1959 * Thread IDs are determined by the participants in a conversation and can be used to match
1960 * both SMS and MMS messages.
1961 *
1962 * To avoid issues where applications might cache a thread ID, the thread ID of a deleted thread
1963 * must not be reused to point at a new thread.
Dan Willemsen4980bf42017-02-14 14:17:12 -08001964 */
1965 public static final class Threads implements ThreadsColumns {
1966
Mathew Inwoodba503112018-08-10 09:37:35 +01001967 @UnsupportedAppUsage
Dan Willemsen4980bf42017-02-14 14:17:12 -08001968 private static final String[] ID_PROJECTION = { BaseColumns._ID };
1969
1970 /**
1971 * Private {@code content://} style URL for this table. Used by
1972 * {@link #getOrCreateThreadId(android.content.Context, java.util.Set)}.
1973 */
Mathew Inwoodba503112018-08-10 09:37:35 +01001974 @UnsupportedAppUsage
Dan Willemsen4980bf42017-02-14 14:17:12 -08001975 private static final Uri THREAD_ID_CONTENT_URI = Uri.parse(
1976 "content://mms-sms/threadID");
1977
1978 /**
1979 * The {@code content://} style URL for this table, by conversation.
1980 */
1981 public static final Uri CONTENT_URI = Uri.withAppendedPath(
1982 MmsSms.CONTENT_URI, "conversations");
1983
1984 /**
1985 * The {@code content://} style URL for this table, for obsolete threads.
1986 */
1987 public static final Uri OBSOLETE_THREADS_URI = Uri.withAppendedPath(
1988 CONTENT_URI, "obsolete");
1989
1990 /** Thread type: common thread. */
1991 public static final int COMMON_THREAD = 0;
1992
1993 /** Thread type: broadcast thread. */
1994 public static final int BROADCAST_THREAD = 1;
1995
1996 /**
1997 * Not instantiable.
1998 * @hide
1999 */
2000 private Threads() {
2001 }
2002
2003 /**
2004 * This is a single-recipient version of {@code getOrCreateThreadId}.
2005 * It's convenient for use with SMS messages.
2006 * @param context the context object to use.
2007 * @param recipient the recipient to send to.
2008 */
2009 public static long getOrCreateThreadId(Context context, String recipient) {
2010 Set<String> recipients = new HashSet<String>();
2011
2012 recipients.add(recipient);
2013 return getOrCreateThreadId(context, recipients);
2014 }
2015
2016 /**
Leland Millerc445b2b2019-01-09 17:00:09 -08002017 * Given a set of recipients return its thread ID.
2018 * <p>
2019 * If a thread exists containing the provided participants, return its thread ID. Otherwise,
2020 * this will create a new thread containing the provided participants and return its ID.
Dan Willemsen4980bf42017-02-14 14:17:12 -08002021 */
2022 public static long getOrCreateThreadId(
2023 Context context, Set<String> recipients) {
2024 Uri.Builder uriBuilder = THREAD_ID_CONTENT_URI.buildUpon();
2025
2026 for (String recipient : recipients) {
2027 if (Mms.isEmailAddress(recipient)) {
2028 recipient = Mms.extractAddrSpec(recipient);
2029 }
2030
2031 uriBuilder.appendQueryParameter("recipient", recipient);
2032 }
2033
2034 Uri uri = uriBuilder.build();
2035 //if (DEBUG) Rlog.v(TAG, "getOrCreateThreadId uri: " + uri);
2036
2037 Cursor cursor = SqliteWrapper.query(context, context.getContentResolver(),
2038 uri, ID_PROJECTION, null, null, null);
2039 if (cursor != null) {
2040 try {
2041 if (cursor.moveToFirst()) {
2042 return cursor.getLong(0);
2043 } else {
2044 Rlog.e(TAG, "getOrCreateThreadId returned no rows!");
2045 }
2046 } finally {
2047 cursor.close();
2048 }
2049 }
2050
2051 Rlog.e(TAG, "getOrCreateThreadId failed with " + recipients.size() + " recipients");
2052 throw new IllegalArgumentException("Unable to find or allocate a thread ID.");
2053 }
2054 }
2055
2056 /**
2057 * Contains all MMS messages.
2058 */
2059 public static final class Mms implements BaseMmsColumns {
2060
2061 /**
2062 * Not instantiable.
2063 * @hide
2064 */
2065 private Mms() {
2066 }
2067
2068 /**
2069 * The {@code content://} URI for this table.
2070 */
2071 public static final Uri CONTENT_URI = Uri.parse("content://mms");
2072
2073 /**
2074 * Content URI for getting MMS report requests.
2075 */
2076 public static final Uri REPORT_REQUEST_URI = Uri.withAppendedPath(
2077 CONTENT_URI, "report-request");
2078
2079 /**
2080 * Content URI for getting MMS report status.
2081 */
2082 public static final Uri REPORT_STATUS_URI = Uri.withAppendedPath(
2083 CONTENT_URI, "report-status");
2084
2085 /**
2086 * The default sort order for this table.
2087 */
2088 public static final String DEFAULT_SORT_ORDER = "date DESC";
2089
2090 /**
2091 * Regex pattern for names and email addresses.
2092 * <ul>
2093 * <li><em>mailbox</em> = {@code name-addr}</li>
2094 * <li><em>name-addr</em> = {@code [display-name] angle-addr}</li>
2095 * <li><em>angle-addr</em> = {@code [CFWS] "<" addr-spec ">" [CFWS]}</li>
2096 * </ul>
2097 * @hide
2098 */
Mathew Inwoodba503112018-08-10 09:37:35 +01002099 @UnsupportedAppUsage
Dan Willemsen4980bf42017-02-14 14:17:12 -08002100 public static final Pattern NAME_ADDR_EMAIL_PATTERN =
2101 Pattern.compile("\\s*(\"[^\"]*\"|[^<>\"]+)\\s*<([^<>]+)>\\s*");
2102
2103 /**
2104 * Helper method to query this table.
2105 * @hide
2106 */
2107 public static Cursor query(
2108 ContentResolver cr, String[] projection) {
2109 return cr.query(CONTENT_URI, projection, null, null, DEFAULT_SORT_ORDER);
2110 }
2111
2112 /**
2113 * Helper method to query this table.
2114 * @hide
2115 */
2116 public static Cursor query(
2117 ContentResolver cr, String[] projection,
2118 String where, String orderBy) {
2119 return cr.query(CONTENT_URI, projection,
2120 where, null, orderBy == null ? DEFAULT_SORT_ORDER : orderBy);
2121 }
2122
2123 /**
2124 * Helper method to extract email address from address string.
2125 * @hide
2126 */
Mathew Inwoodba503112018-08-10 09:37:35 +01002127 @UnsupportedAppUsage
Dan Willemsen4980bf42017-02-14 14:17:12 -08002128 public static String extractAddrSpec(String address) {
2129 Matcher match = NAME_ADDR_EMAIL_PATTERN.matcher(address);
2130
2131 if (match.matches()) {
2132 return match.group(2);
2133 }
2134 return address;
2135 }
2136
2137 /**
2138 * Is the specified address an email address?
2139 *
2140 * @param address the input address to test
2141 * @return true if address is an email address; false otherwise.
2142 * @hide
2143 */
Mathew Inwoodba503112018-08-10 09:37:35 +01002144 @UnsupportedAppUsage
Dan Willemsen4980bf42017-02-14 14:17:12 -08002145 public static boolean isEmailAddress(String address) {
2146 if (TextUtils.isEmpty(address)) {
2147 return false;
2148 }
2149
2150 String s = extractAddrSpec(address);
2151 Matcher match = Patterns.EMAIL_ADDRESS.matcher(s);
2152 return match.matches();
2153 }
2154
2155 /**
2156 * Is the specified number a phone number?
2157 *
2158 * @param number the input number to test
2159 * @return true if number is a phone number; false otherwise.
2160 * @hide
2161 */
Mathew Inwoodba503112018-08-10 09:37:35 +01002162 @UnsupportedAppUsage
Dan Willemsen4980bf42017-02-14 14:17:12 -08002163 public static boolean isPhoneNumber(String number) {
2164 if (TextUtils.isEmpty(number)) {
2165 return false;
2166 }
2167
2168 Matcher match = Patterns.PHONE.matcher(number);
2169 return match.matches();
2170 }
2171
2172 /**
2173 * Contains all MMS messages in the MMS app inbox.
2174 */
2175 public static final class Inbox implements BaseMmsColumns {
2176
2177 /**
2178 * Not instantiable.
2179 * @hide
2180 */
2181 private Inbox() {
2182 }
2183
2184 /**
2185 * The {@code content://} style URL for this table.
2186 */
2187 public static final Uri
2188 CONTENT_URI = Uri.parse("content://mms/inbox");
2189
2190 /**
2191 * The default sort order for this table.
2192 */
2193 public static final String DEFAULT_SORT_ORDER = "date DESC";
2194 }
2195
2196 /**
2197 * Contains all MMS messages in the MMS app sent folder.
2198 */
2199 public static final class Sent implements BaseMmsColumns {
2200
2201 /**
2202 * Not instantiable.
2203 * @hide
2204 */
2205 private Sent() {
2206 }
2207
2208 /**
2209 * The {@code content://} style URL for this table.
2210 */
2211 public static final Uri
2212 CONTENT_URI = Uri.parse("content://mms/sent");
2213
2214 /**
2215 * The default sort order for this table.
2216 */
2217 public static final String DEFAULT_SORT_ORDER = "date DESC";
2218 }
2219
2220 /**
2221 * Contains all MMS messages in the MMS app drafts folder.
2222 */
2223 public static final class Draft implements BaseMmsColumns {
2224
2225 /**
2226 * Not instantiable.
2227 * @hide
2228 */
2229 private Draft() {
2230 }
2231
2232 /**
2233 * The {@code content://} style URL for this table.
2234 */
2235 public static final Uri
2236 CONTENT_URI = Uri.parse("content://mms/drafts");
2237
2238 /**
2239 * The default sort order for this table.
2240 */
2241 public static final String DEFAULT_SORT_ORDER = "date DESC";
2242 }
2243
2244 /**
2245 * Contains all MMS messages in the MMS app outbox.
2246 */
2247 public static final class Outbox implements BaseMmsColumns {
2248
2249 /**
2250 * Not instantiable.
2251 * @hide
2252 */
2253 private Outbox() {
2254 }
2255
2256 /**
2257 * The {@code content://} style URL for this table.
2258 */
2259 public static final Uri
2260 CONTENT_URI = Uri.parse("content://mms/outbox");
2261
2262 /**
2263 * The default sort order for this table.
2264 */
2265 public static final String DEFAULT_SORT_ORDER = "date DESC";
2266 }
2267
2268 /**
2269 * Contains address information for an MMS message.
2270 */
2271 public static final class Addr implements BaseColumns {
2272
2273 /**
2274 * Not instantiable.
2275 * @hide
2276 */
2277 private Addr() {
2278 }
2279
2280 /**
2281 * The ID of MM which this address entry belongs to.
2282 * <P>Type: INTEGER (long)</P>
2283 */
2284 public static final String MSG_ID = "msg_id";
2285
2286 /**
2287 * The ID of contact entry in Phone Book.
2288 * <P>Type: INTEGER (long)</P>
2289 */
2290 public static final String CONTACT_ID = "contact_id";
2291
2292 /**
2293 * The address text.
2294 * <P>Type: TEXT</P>
2295 */
2296 public static final String ADDRESS = "address";
2297
2298 /**
2299 * Type of address: must be one of {@code PduHeaders.BCC},
2300 * {@code PduHeaders.CC}, {@code PduHeaders.FROM}, {@code PduHeaders.TO}.
2301 * <P>Type: INTEGER</P>
2302 */
2303 public static final String TYPE = "type";
2304
2305 /**
2306 * Character set of this entry (MMS charset value).
2307 * <P>Type: INTEGER</P>
2308 */
2309 public static final String CHARSET = "charset";
2310 }
2311
2312 /**
2313 * Contains message parts.
Leland Miller6c753552019-01-22 17:28:55 -08002314 *
2315 * To avoid issues where applications might cache a part ID, the ID of a deleted part must
2316 * not be reused to point at a new part.
Dan Willemsen4980bf42017-02-14 14:17:12 -08002317 */
2318 public static final class Part implements BaseColumns {
2319
2320 /**
2321 * Not instantiable.
2322 * @hide
2323 */
2324 private Part() {
2325 }
2326
2327 /**
Leland Miller6c753552019-01-22 17:28:55 -08002328 * The {@code content://} style URL for this table. Can be appended with a part ID to
2329 * address individual parts.
2330 */
2331 public static final Uri CONTENT_URI = Uri.withAppendedPath(Mms.CONTENT_URI, "part");
2332
2333 /**
Dan Willemsen4980bf42017-02-14 14:17:12 -08002334 * The identifier of the message which this part belongs to.
2335 * <P>Type: INTEGER</P>
2336 */
2337 public static final String MSG_ID = "mid";
2338
2339 /**
2340 * The order of the part.
2341 * <P>Type: INTEGER</P>
2342 */
2343 public static final String SEQ = "seq";
2344
2345 /**
2346 * The content type of the part.
2347 * <P>Type: TEXT</P>
2348 */
2349 public static final String CONTENT_TYPE = "ct";
2350
2351 /**
2352 * The name of the part.
2353 * <P>Type: TEXT</P>
2354 */
2355 public static final String NAME = "name";
2356
2357 /**
2358 * The charset of the part.
2359 * <P>Type: TEXT</P>
2360 */
2361 public static final String CHARSET = "chset";
2362
2363 /**
2364 * The file name of the part.
2365 * <P>Type: TEXT</P>
2366 */
2367 public static final String FILENAME = "fn";
2368
2369 /**
2370 * The content disposition of the part.
2371 * <P>Type: TEXT</P>
2372 */
2373 public static final String CONTENT_DISPOSITION = "cd";
2374
2375 /**
2376 * The content ID of the part.
2377 * <P>Type: INTEGER</P>
2378 */
2379 public static final String CONTENT_ID = "cid";
2380
2381 /**
2382 * The content location of the part.
2383 * <P>Type: INTEGER</P>
2384 */
2385 public static final String CONTENT_LOCATION = "cl";
2386
2387 /**
2388 * The start of content-type of the message.
2389 * <P>Type: INTEGER</P>
2390 */
2391 public static final String CT_START = "ctt_s";
2392
2393 /**
2394 * The type of content-type of the message.
2395 * <P>Type: TEXT</P>
2396 */
2397 public static final String CT_TYPE = "ctt_t";
2398
2399 /**
2400 * The location (on filesystem) of the binary data of the part.
2401 * <P>Type: INTEGER</P>
2402 */
2403 public static final String _DATA = "_data";
2404
2405 /**
2406 * The message text.
2407 * <P>Type: TEXT</P>
2408 */
2409 public static final String TEXT = "text";
2410 }
2411
2412 /**
2413 * Message send rate table.
2414 */
2415 public static final class Rate {
2416
2417 /**
2418 * Not instantiable.
2419 * @hide
2420 */
2421 private Rate() {
2422 }
2423
2424 /**
2425 * The {@code content://} style URL for this table.
2426 */
2427 public static final Uri CONTENT_URI = Uri.withAppendedPath(
2428 Mms.CONTENT_URI, "rate");
2429
2430 /**
2431 * When a message was successfully sent.
2432 * <P>Type: INTEGER (long)</P>
2433 */
2434 public static final String SENT_TIME = "sent_time";
2435 }
2436
2437 /**
2438 * Intents class.
2439 */
2440 public static final class Intents {
2441
2442 /**
2443 * Not instantiable.
2444 * @hide
2445 */
2446 private Intents() {
2447 }
2448
2449 /**
2450 * Indicates that the contents of specified URIs were changed.
2451 * The application which is showing or caching these contents
2452 * should be updated.
2453 */
2454 @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
2455 public static final String CONTENT_CHANGED_ACTION
2456 = "android.intent.action.CONTENT_CHANGED";
2457
2458 /**
2459 * An extra field which stores the URI of deleted contents.
2460 */
2461 public static final String DELETED_CONTENTS = "deleted_contents";
2462 }
2463 }
2464
2465 /**
2466 * Contains all MMS and SMS messages.
2467 */
2468 public static final class MmsSms implements BaseColumns {
2469
2470 /**
2471 * Not instantiable.
2472 * @hide
2473 */
2474 private MmsSms() {
2475 }
2476
2477 /**
2478 * The column to distinguish SMS and MMS messages in query results.
2479 */
2480 public static final String TYPE_DISCRIMINATOR_COLUMN =
2481 "transport_type";
2482
2483 /**
2484 * The {@code content://} style URL for this table.
2485 */
2486 public static final Uri CONTENT_URI = Uri.parse("content://mms-sms/");
2487
2488 /**
2489 * The {@code content://} style URL for this table, by conversation.
2490 */
2491 public static final Uri CONTENT_CONVERSATIONS_URI = Uri.parse(
2492 "content://mms-sms/conversations");
2493
2494 /**
2495 * The {@code content://} style URL for this table, by phone number.
2496 */
2497 public static final Uri CONTENT_FILTER_BYPHONE_URI = Uri.parse(
2498 "content://mms-sms/messages/byphone");
2499
2500 /**
2501 * The {@code content://} style URL for undelivered messages in this table.
2502 */
2503 public static final Uri CONTENT_UNDELIVERED_URI = Uri.parse(
2504 "content://mms-sms/undelivered");
2505
2506 /**
2507 * The {@code content://} style URL for draft messages in this table.
2508 */
2509 public static final Uri CONTENT_DRAFT_URI = Uri.parse(
2510 "content://mms-sms/draft");
2511
2512 /**
2513 * The {@code content://} style URL for locked messages in this table.
2514 */
2515 public static final Uri CONTENT_LOCKED_URI = Uri.parse(
2516 "content://mms-sms/locked");
2517
2518 /**
2519 * Pass in a query parameter called "pattern" which is the text to search for.
2520 * The sort order is fixed to be: {@code thread_id ASC, date DESC}.
2521 */
2522 public static final Uri SEARCH_URI = Uri.parse(
2523 "content://mms-sms/search");
2524
2525 // Constants for message protocol types.
2526
2527 /** SMS protocol type. */
2528 public static final int SMS_PROTO = 0;
2529
2530 /** MMS protocol type. */
2531 public static final int MMS_PROTO = 1;
2532
2533 // Constants for error types of pending messages.
2534
2535 /** Error type: no error. */
2536 public static final int NO_ERROR = 0;
2537
2538 /** Error type: generic transient error. */
2539 public static final int ERR_TYPE_GENERIC = 1;
2540
2541 /** Error type: SMS protocol transient error. */
2542 public static final int ERR_TYPE_SMS_PROTO_TRANSIENT = 2;
2543
2544 /** Error type: MMS protocol transient error. */
2545 public static final int ERR_TYPE_MMS_PROTO_TRANSIENT = 3;
2546
2547 /** Error type: transport failure. */
2548 public static final int ERR_TYPE_TRANSPORT_FAILURE = 4;
2549
2550 /** Error type: permanent error (along with all higher error values). */
2551 public static final int ERR_TYPE_GENERIC_PERMANENT = 10;
2552
2553 /** Error type: SMS protocol permanent error. */
2554 public static final int ERR_TYPE_SMS_PROTO_PERMANENT = 11;
2555
2556 /** Error type: MMS protocol permanent error. */
2557 public static final int ERR_TYPE_MMS_PROTO_PERMANENT = 12;
2558
2559 /**
2560 * Contains pending messages info.
2561 */
2562 public static final class PendingMessages implements BaseColumns {
2563
2564 /**
2565 * Not instantiable.
2566 * @hide
2567 */
2568 private PendingMessages() {
2569 }
2570
2571 public static final Uri CONTENT_URI = Uri.withAppendedPath(
2572 MmsSms.CONTENT_URI, "pending");
2573
2574 /**
2575 * The type of transport protocol (MMS or SMS).
2576 * <P>Type: INTEGER</P>
2577 */
2578 public static final String PROTO_TYPE = "proto_type";
2579
2580 /**
2581 * The ID of the message to be sent or downloaded.
2582 * <P>Type: INTEGER (long)</P>
2583 */
2584 public static final String MSG_ID = "msg_id";
2585
2586 /**
2587 * The type of the message to be sent or downloaded.
2588 * This field is only valid for MM. For SM, its value is always set to 0.
2589 * <P>Type: INTEGER</P>
2590 */
2591 public static final String MSG_TYPE = "msg_type";
2592
2593 /**
2594 * The type of the error code.
2595 * <P>Type: INTEGER</P>
2596 */
2597 public static final String ERROR_TYPE = "err_type";
2598
2599 /**
2600 * The error code of sending/retrieving process.
2601 * <P>Type: INTEGER</P>
2602 */
2603 public static final String ERROR_CODE = "err_code";
2604
2605 /**
2606 * How many times we tried to send or download the message.
2607 * <P>Type: INTEGER</P>
2608 */
2609 public static final String RETRY_INDEX = "retry_index";
2610
2611 /**
2612 * The time to do next retry.
2613 * <P>Type: INTEGER (long)</P>
2614 */
2615 public static final String DUE_TIME = "due_time";
2616
2617 /**
2618 * The time we last tried to send or download the message.
2619 * <P>Type: INTEGER (long)</P>
2620 */
2621 public static final String LAST_TRY = "last_try";
2622
2623 /**
2624 * The subscription to which the message belongs to. Its value will be
2625 * < 0 if the sub id cannot be determined.
2626 * <p>Type: INTEGER (long) </p>
2627 */
2628 public static final String SUBSCRIPTION_ID = "pending_sub_id";
2629 }
2630
2631 /**
2632 * Words table used by provider for full-text searches.
2633 * @hide
2634 */
2635 public static final class WordsTable {
2636
2637 /**
2638 * Not instantiable.
2639 * @hide
2640 */
2641 private WordsTable() {}
2642
2643 /**
2644 * Primary key.
2645 * <P>Type: INTEGER (long)</P>
2646 */
2647 public static final String ID = "_id";
2648
2649 /**
2650 * Source row ID.
2651 * <P>Type: INTEGER (long)</P>
2652 */
2653 public static final String SOURCE_ROW_ID = "source_id";
2654
2655 /**
2656 * Table ID (either 1 or 2).
2657 * <P>Type: INTEGER</P>
2658 */
2659 public static final String TABLE_ID = "table_to_use";
2660
2661 /**
2662 * The words to index.
2663 * <P>Type: TEXT</P>
2664 */
2665 public static final String INDEXED_TEXT = "index_text";
2666 }
2667 }
2668
2669 /**
2670 * Carriers class contains information about APNs, including MMSC information.
2671 */
2672 public static final class Carriers implements BaseColumns {
2673
2674 /**
2675 * Not instantiable.
2676 * @hide
2677 */
2678 private Carriers() {}
2679
2680 /**
2681 * The {@code content://} style URL for this table.
calvinpan5e272372018-12-07 20:03:48 +08002682 * For MSIM, this will return APNs for the default subscription
2683 * {@link SubscriptionManager#getDefaultSubscriptionId()}. To specify subId for MSIM,
2684 * use {@link Uri#withAppendedPath(Uri, String)} to append with subscription id.
Dan Willemsen4980bf42017-02-14 14:17:12 -08002685 */
2686 public static final Uri CONTENT_URI = Uri.parse("content://telephony/carriers");
2687
2688 /**
calvinpan5e272372018-12-07 20:03:48 +08002689 * The {@code content://} style URL for this table. Used for APN query based on current
2690 * subscription. Instead of specifying carrier matching information in the selection,
2691 * this API will return all matching APNs from current subscription carrier and queries
2692 * will be applied on top of that. If there is no match for MVNO (Mobile Virtual Network
2693 * Operator) APNs, return APNs from its MNO (based on mccmnc) instead. For MSIM, this will
2694 * return APNs for the default subscription
2695 * {@link SubscriptionManager#getDefaultSubscriptionId()}. To specify subId for MSIM,
2696 * use {@link Uri#withAppendedPath(Uri, String)} to append with subscription id.
2697 */
2698 public static final Uri SIM_APN_URI = Uri.parse(
2699 "content://telephony/carriers/sim_apn_list");
2700
2701 /**
yuemingw4c0065f2018-01-16 19:48:10 +00002702 * The {@code content://} style URL to be called from DevicePolicyManagerService,
2703 * can manage DPC-owned APNs.
2704 * @hide
2705 */
2706 public static final Uri DPC_URI = Uri.parse("content://telephony/carriers/dpc");
2707
2708 /**
2709 * The {@code content://} style URL to be called from Telephony to query APNs.
2710 * When DPC-owned APNs are enforced, only DPC-owned APNs are returned, otherwise only
calvinpan5e272372018-12-07 20:03:48 +08002711 * non-DPC-owned APNs are returned. For MSIM, this will return APNs for the default
2712 * subscription {@link SubscriptionManager#getDefaultSubscriptionId()}. To specify subId
2713 * for MSIM, use {@link Uri#withAppendedPath(Uri, String)} to append with subscription id.
yuemingw4c0065f2018-01-16 19:48:10 +00002714 * @hide
2715 */
2716 public static final Uri FILTERED_URI = Uri.parse("content://telephony/carriers/filtered");
2717
2718 /**
2719 * The {@code content://} style URL to be called from DevicePolicyManagerService
2720 * or Telephony to manage whether DPC-owned APNs are enforced.
2721 * @hide
2722 */
2723 public static final Uri ENFORCE_MANAGED_URI = Uri.parse(
2724 "content://telephony/carriers/enforce_managed");
2725
2726 /**
2727 * The column name for ENFORCE_MANAGED_URI, indicates whether DPC-owned APNs are enforced.
2728 * @hide
2729 */
2730 public static final String ENFORCE_KEY = "enforced";
2731
2732 /**
Dan Willemsen4980bf42017-02-14 14:17:12 -08002733 * The default sort order for this table.
2734 */
2735 public static final String DEFAULT_SORT_ORDER = "name ASC";
2736
2737 /**
2738 * Entry name.
2739 * <P>Type: TEXT</P>
2740 */
2741 public static final String NAME = "name";
2742
2743 /**
2744 * APN name.
2745 * <P>Type: TEXT</P>
2746 */
2747 public static final String APN = "apn";
2748
2749 /**
2750 * Proxy address.
2751 * <P>Type: TEXT</P>
2752 */
2753 public static final String PROXY = "proxy";
2754
2755 /**
2756 * Proxy port.
2757 * <P>Type: TEXT</P>
2758 */
2759 public static final String PORT = "port";
2760
2761 /**
2762 * MMS proxy address.
2763 * <P>Type: TEXT</P>
2764 */
2765 public static final String MMSPROXY = "mmsproxy";
2766
2767 /**
2768 * MMS proxy port.
2769 * <P>Type: TEXT</P>
2770 */
2771 public static final String MMSPORT = "mmsport";
2772
2773 /**
2774 * Server address.
2775 * <P>Type: TEXT</P>
2776 */
2777 public static final String SERVER = "server";
2778
2779 /**
2780 * APN username.
2781 * <P>Type: TEXT</P>
2782 */
2783 public static final String USER = "user";
2784
2785 /**
2786 * APN password.
2787 * <P>Type: TEXT</P>
2788 */
2789 public static final String PASSWORD = "password";
2790
2791 /**
2792 * MMSC URL.
2793 * <P>Type: TEXT</P>
2794 */
2795 public static final String MMSC = "mmsc";
2796
2797 /**
2798 * Mobile Country Code (MCC).
2799 * <P>Type: TEXT</P>
calvinpan5e272372018-12-07 20:03:48 +08002800 * @deprecated Use {@link #SIM_APN_URI} to query APN instead, this API will return
2801 * matching APNs based on current subscription carrier, thus no need to specify MCC and
2802 * other carrier matching information. In the future, Android will not support MCC for
2803 * APN query.
Dan Willemsen4980bf42017-02-14 14:17:12 -08002804 */
2805 public static final String MCC = "mcc";
2806
2807 /**
2808 * Mobile Network Code (MNC).
2809 * <P>Type: TEXT</P>
calvinpan5e272372018-12-07 20:03:48 +08002810 * @deprecated Use {@link #SIM_APN_URI} to query APN instead, this API will return
2811 * matching APNs based on current subscription carrier, thus no need to specify MNC and
2812 * other carrier matching information. In the future, Android will not support MNC for
2813 * APN query.
Dan Willemsen4980bf42017-02-14 14:17:12 -08002814 */
2815 public static final String MNC = "mnc";
2816
2817 /**
2818 * Numeric operator ID (as String). Usually {@code MCC + MNC}.
2819 * <P>Type: TEXT</P>
calvinpan5e272372018-12-07 20:03:48 +08002820 * @deprecated Use {@link #SIM_APN_URI} to query APN instead, this API will return
2821 * matching APNs based on current subscription carrier, thus no need to specify Numeric
2822 * and other carrier matching information. In the future, Android will not support Numeric
2823 * for APN query.
Dan Willemsen4980bf42017-02-14 14:17:12 -08002824 */
2825 public static final String NUMERIC = "numeric";
2826
2827 /**
2828 * Authentication type.
2829 * <P>Type: INTEGER</P>
2830 */
2831 public static final String AUTH_TYPE = "authtype";
2832
2833 /**
2834 * Comma-delimited list of APN types.
2835 * <P>Type: TEXT</P>
2836 */
2837 public static final String TYPE = "type";
2838
2839 /**
2840 * The protocol to use to connect to this APN.
2841 *
2842 * One of the {@code PDP_type} values in TS 27.007 section 10.1.1.
2843 * For example: {@code IP}, {@code IPV6}, {@code IPV4V6}, or {@code PPP}.
2844 * <P>Type: TEXT</P>
2845 */
2846 public static final String PROTOCOL = "protocol";
2847
2848 /**
2849 * The protocol to use to connect to this APN when roaming.
2850 * The syntax is the same as protocol.
2851 * <P>Type: TEXT</P>
2852 */
2853 public static final String ROAMING_PROTOCOL = "roaming_protocol";
2854
2855 /**
2856 * Is this the current APN?
2857 * <P>Type: INTEGER (boolean)</P>
2858 */
2859 public static final String CURRENT = "current";
2860
2861 /**
2862 * Is this APN enabled?
2863 * <P>Type: INTEGER (boolean)</P>
2864 */
2865 public static final String CARRIER_ENABLED = "carrier_enabled";
2866
2867 /**
2868 * Radio Access Technology info.
2869 * To check what values are allowed, refer to {@link android.telephony.ServiceState}.
2870 * This should be spread to other technologies,
2871 * but is currently only used for LTE (14) and eHRPD (13).
2872 * <P>Type: INTEGER</P>
Cassiee1c88022018-02-22 08:51:03 -08002873 * @deprecated this column is no longer supported, use {@link #NETWORK_TYPE_BITMASK} instead
Dan Willemsen4980bf42017-02-14 14:17:12 -08002874 */
Cassied53df962017-12-05 13:34:33 -08002875 @Deprecated
Dan Willemsen4980bf42017-02-14 14:17:12 -08002876 public static final String BEARER = "bearer";
2877
2878 /**
2879 * Radio Access Technology bitmask.
2880 * To check what values can be contained, refer to {@link android.telephony.ServiceState}.
2881 * 0 indicates all techs otherwise first bit refers to RAT/bearer 1, second bit refers to
2882 * RAT/bearer 2 and so on.
2883 * Bitmask for a radio tech R is (1 << (R - 1))
2884 * <P>Type: INTEGER</P>
2885 * @hide
Cassiee1c88022018-02-22 08:51:03 -08002886 * @deprecated this column is no longer supported, use {@link #NETWORK_TYPE_BITMASK} instead
Dan Willemsen4980bf42017-02-14 14:17:12 -08002887 */
Cassied53df962017-12-05 13:34:33 -08002888 @Deprecated
Dan Willemsen4980bf42017-02-14 14:17:12 -08002889 public static final String BEARER_BITMASK = "bearer_bitmask";
2890
2891 /**
Cassied53df962017-12-05 13:34:33 -08002892 * Radio technology (network type) bitmask.
Cassiee1c88022018-02-22 08:51:03 -08002893 * To check what values can be contained, refer to the NETWORK_TYPE_ constants in
Cassied53df962017-12-05 13:34:33 -08002894 * {@link android.telephony.TelephonyManager}.
2895 * Bitmask for a radio tech R is (1 << (R - 1))
2896 * <P>Type: INTEGER</P>
2897 */
2898 public static final String NETWORK_TYPE_BITMASK = "network_type_bitmask";
2899
2900 /**
Dan Willemsen4980bf42017-02-14 14:17:12 -08002901 * MVNO type:
2902 * {@code SPN (Service Provider Name), IMSI, GID (Group Identifier Level 1)}.
2903 * <P>Type: TEXT</P>
calvinpan5e272372018-12-07 20:03:48 +08002904 * @deprecated Use {@link #SIM_APN_URI} to query APN instead, this API will return
2905 * matching APNs based on current subscription carrier, thus no need to specify MVNO_TYPE
2906 * and other carrier matching information. In the future, Android will not support MVNO_TYPE
2907 * for APN query.
Dan Willemsen4980bf42017-02-14 14:17:12 -08002908 */
2909 public static final String MVNO_TYPE = "mvno_type";
2910
2911 /**
2912 * MVNO data.
2913 * Use the following examples.
2914 * <ul>
2915 * <li>SPN: A MOBILE, BEN NL, ...</li>
2916 * <li>IMSI: 302720x94, 2060188, ...</li>
2917 * <li>GID: 4E, 33, ...</li>
2918 * </ul>
2919 * <P>Type: TEXT</P>
calvinpan5e272372018-12-07 20:03:48 +08002920 * @deprecated Use {@link #SIM_APN_URI} to query APN instead, this API will return
2921 * matching APNs based on current subscription carrier, thus no need to specify
2922 * MVNO_MATCH_DATA and other carrier matching information. In the future, Android will not
2923 * support MVNO_MATCH_DATA for APN query.
Dan Willemsen4980bf42017-02-14 14:17:12 -08002924 */
2925 public static final String MVNO_MATCH_DATA = "mvno_match_data";
2926
2927 /**
2928 * The subscription to which the APN belongs to
2929 * <p>Type: INTEGER (long) </p>
2930 */
2931 public static final String SUBSCRIPTION_ID = "sub_id";
2932
2933 /**
chen xu85100482018-10-12 15:30:34 -07002934 * The profile_id to which the APN saved in modem.
Dan Willemsen4980bf42017-02-14 14:17:12 -08002935 * <p>Type: INTEGER</p>
2936 *@hide
2937 */
2938 public static final String PROFILE_ID = "profile_id";
2939
2940 /**
chen xu85100482018-10-12 15:30:34 -07002941 * If set to {@code true}, then the APN setting will persist to the modem.
2942 * <p>Type: INTEGER (boolean)</p>
Dan Willemsen4980bf42017-02-14 14:17:12 -08002943 *@hide
2944 */
chen xu85100482018-10-12 15:30:34 -07002945 @SystemApi
chen xu7ebcd782018-11-28 00:21:50 -08002946 public static final String MODEM_PERSIST = "modem_cognitive";
Dan Willemsen4980bf42017-02-14 14:17:12 -08002947
2948 /**
chen xu7ebcd782018-11-28 00:21:50 -08002949 * The max number of connections of this APN.
Dan Willemsen4980bf42017-02-14 14:17:12 -08002950 * <p>Type: INTEGER</p>
2951 *@hide
2952 */
chen xu85100482018-10-12 15:30:34 -07002953 @SystemApi
chen xu7ebcd782018-11-28 00:21:50 -08002954 public static final String MAX_CONNECTIONS = "max_conns";
Dan Willemsen4980bf42017-02-14 14:17:12 -08002955
2956 /**
chen xu7ebcd782018-11-28 00:21:50 -08002957 * The wait time for retrying the APN, in milliseconds.
Dan Willemsen4980bf42017-02-14 14:17:12 -08002958 * <p>Type: INTEGER</p>
2959 *@hide
2960 */
chen xu85100482018-10-12 15:30:34 -07002961 @SystemApi
chen xu7ebcd782018-11-28 00:21:50 -08002962 public static final String WAIT_TIME_RETRY = "wait_time";
Dan Willemsen4980bf42017-02-14 14:17:12 -08002963
2964 /**
chen xu7ebcd782018-11-28 00:21:50 -08002965 * The max number of seconds this APN will support its maximum number of connections
2966 * as defined in {@link #MAX_CONNECTIONS}.
Dan Willemsen4980bf42017-02-14 14:17:12 -08002967 * <p>Type: INTEGER</p>
2968 *@hide
2969 */
chen xu85100482018-10-12 15:30:34 -07002970 @SystemApi
chen xu7ebcd782018-11-28 00:21:50 -08002971 public static final String TIME_LIMIT_FOR_MAX_CONNECTIONS = "max_conns_time";
Dan Willemsen4980bf42017-02-14 14:17:12 -08002972
2973 /**
chen xu7ebcd782018-11-28 00:21:50 -08002974 * The MTU (maximum transmit unit) size of the mobile interface to which the APN is
2975 * connected, in bytes.
Dan Willemsen4980bf42017-02-14 14:17:12 -08002976 * <p>Type: INTEGER </p>
2977 * @hide
2978 */
chen xu85100482018-10-12 15:30:34 -07002979 @SystemApi
Dan Willemsen4980bf42017-02-14 14:17:12 -08002980 public static final String MTU = "mtu";
2981
2982 /**
chen xu85100482018-10-12 15:30:34 -07002983 * APN edit status. APN could be added/edited/deleted by a user or carrier.
chen xu7ebcd782018-11-28 00:21:50 -08002984 * see all possible returned APN edit status.
2985 * <ul>
2986 * <li>{@link #UNEDITED}</li>
2987 * <li>{@link #USER_EDITED}</li>
2988 * <li>{@link #USER_DELETED}</li>
2989 * <li>{@link #CARRIER_EDITED}</li>
2990 * <li>{@link #CARRIER_DELETED}</li>
2991 * </ul>
Dan Willemsen4980bf42017-02-14 14:17:12 -08002992 * <p>Type: INTEGER </p>
2993 * @hide
2994 */
chen xu85100482018-10-12 15:30:34 -07002995 @SystemApi
chen xu7ebcd782018-11-28 00:21:50 -08002996 public static final String EDITED_STATUS = "edited";
Dan Willemsen4980bf42017-02-14 14:17:12 -08002997
2998 /**
chen xu85100482018-10-12 15:30:34 -07002999 * {@code true} if this APN visible to the user, {@code false} otherwise.
3000 * <p>Type: INTEGER (boolean)</p>
Dan Willemsen4980bf42017-02-14 14:17:12 -08003001 * @hide
3002 */
chen xu85100482018-10-12 15:30:34 -07003003 @SystemApi
Dan Willemsen4980bf42017-02-14 14:17:12 -08003004 public static final String USER_VISIBLE = "user_visible";
3005
3006 /**
chen xu85100482018-10-12 15:30:34 -07003007 * {@code true} if the user allowed to edit this APN, {@code false} otherwise.
3008 * <p>Type: INTEGER (boolean)</p>
Amit Mahajand4977942017-07-17 14:46:39 -07003009 * @hide
3010 */
chen xu85100482018-10-12 15:30:34 -07003011 @SystemApi
Amit Mahajand4977942017-07-17 14:46:39 -07003012 public static final String USER_EDITABLE = "user_editable";
3013
3014 /**
chen xu7ebcd782018-11-28 00:21:50 -08003015 * {@link #EDITED_STATUS APN edit status} indicates that this APN has not been edited or
3016 * fails to edit.
chen xu85100482018-10-12 15:30:34 -07003017 * <p>Type: INTEGER </p>
Dan Willemsen4980bf42017-02-14 14:17:12 -08003018 * @hide
3019 */
chen xu85100482018-10-12 15:30:34 -07003020 @SystemApi
chen xu7ebcd782018-11-28 00:21:50 -08003021 public static final @EditStatus int UNEDITED = 0;
chen xu85100482018-10-12 15:30:34 -07003022
Dan Willemsen4980bf42017-02-14 14:17:12 -08003023 /**
chen xu7ebcd782018-11-28 00:21:50 -08003024 * {@link #EDITED_STATUS APN edit status} indicates that this APN has been edited by users.
chen xu85100482018-10-12 15:30:34 -07003025 * <p>Type: INTEGER </p>
3026 * @hide
Dan Willemsen4980bf42017-02-14 14:17:12 -08003027 */
chen xu85100482018-10-12 15:30:34 -07003028 @SystemApi
chen xu7ebcd782018-11-28 00:21:50 -08003029 public static final @EditStatus int USER_EDITED = 1;
chen xu85100482018-10-12 15:30:34 -07003030
Dan Willemsen4980bf42017-02-14 14:17:12 -08003031 /**
chen xu7ebcd782018-11-28 00:21:50 -08003032 * {@link #EDITED_STATUS APN edit status} indicates that this APN has been deleted by users.
chen xu85100482018-10-12 15:30:34 -07003033 * <p>Type: INTEGER </p>
3034 * @hide
Dan Willemsen4980bf42017-02-14 14:17:12 -08003035 */
chen xu85100482018-10-12 15:30:34 -07003036 @SystemApi
chen xu7ebcd782018-11-28 00:21:50 -08003037 public static final @EditStatus int USER_DELETED = 2;
chen xu85100482018-10-12 15:30:34 -07003038
Dan Willemsen4980bf42017-02-14 14:17:12 -08003039 /**
chen xu7ebcd782018-11-28 00:21:50 -08003040 * {@link #EDITED_STATUS APN edit status} is an intermediate value used to indicate that an
3041 * entry deleted by the user is still present in the new APN database and therefore must
3042 * remain tagged as user deleted rather than completely removed from the database.
Dan Willemsen4980bf42017-02-14 14:17:12 -08003043 * @hide
3044 */
3045 public static final int USER_DELETED_BUT_PRESENT_IN_XML = 3;
chen xu85100482018-10-12 15:30:34 -07003046
Dan Willemsen4980bf42017-02-14 14:17:12 -08003047 /**
chen xu7ebcd782018-11-28 00:21:50 -08003048 * {@link #EDITED_STATUS APN edit status} indicates that this APN has been edited by
3049 * carriers.
chen xu85100482018-10-12 15:30:34 -07003050 * <p>Type: INTEGER </p>
3051 * @hide
Dan Willemsen4980bf42017-02-14 14:17:12 -08003052 */
chen xu85100482018-10-12 15:30:34 -07003053 @SystemApi
chen xu7ebcd782018-11-28 00:21:50 -08003054 public static final @EditStatus int CARRIER_EDITED = 4;
chen xu85100482018-10-12 15:30:34 -07003055
Dan Willemsen4980bf42017-02-14 14:17:12 -08003056 /**
chen xu7ebcd782018-11-28 00:21:50 -08003057 * {@link #EDITED_STATUS APN edit status} indicates that this APN has been deleted by
3058 * carriers. CARRIER_DELETED values are currently not used as there is no use case.
3059 * If they are used, delete() will have to change accordingly. Currently it is hardcoded to
3060 * USER_DELETED.
chen xu85100482018-10-12 15:30:34 -07003061 * <p>Type: INTEGER </p>
Dan Willemsen4980bf42017-02-14 14:17:12 -08003062 * @hide
3063 */
chen xu7ebcd782018-11-28 00:21:50 -08003064 public static final @EditStatus int CARRIER_DELETED = 5;
chen xu85100482018-10-12 15:30:34 -07003065
Dan Willemsen4980bf42017-02-14 14:17:12 -08003066 /**
chen xu7ebcd782018-11-28 00:21:50 -08003067 * {@link #EDITED_STATUS APN edit status} is an intermediate value used to indicate that an
3068 * entry deleted by the carrier is still present in the new APN database and therefore must
3069 * remain tagged as user deleted rather than completely removed from the database.
chen xu85100482018-10-12 15:30:34 -07003070 * @hide
Dan Willemsen4980bf42017-02-14 14:17:12 -08003071 */
3072 public static final int CARRIER_DELETED_BUT_PRESENT_IN_XML = 6;
yuemingwcf263eb2017-11-08 13:12:18 +00003073
3074 /**
3075 * The owner of the APN.
3076 * <p>Type: INTEGER</p>
3077 * @hide
3078 */
3079 public static final String OWNED_BY = "owned_by";
3080
3081 /**
3082 * Possible value for the OWNED_BY field.
3083 * APN is owned by DPC.
3084 * @hide
3085 */
3086 public static final int OWNED_BY_DPC = 0;
Jordan Liu40617152018-04-06 11:10:12 -07003087
yuemingwcf263eb2017-11-08 13:12:18 +00003088 /**
3089 * Possible value for the OWNED_BY field.
3090 * APN is owned by other sources.
3091 * @hide
3092 */
3093 public static final int OWNED_BY_OTHERS = 1;
Jordan Liu40617152018-04-06 11:10:12 -07003094
3095 /**
3096 * The APN set id. When the user manually selects an APN or the framework sets an APN as
3097 * preferred, all APNs with the same set id as the selected APN should be prioritized over
3098 * APNs in other sets.
chen xu85100482018-10-12 15:30:34 -07003099 * <p>Type: INTEGER</p>
Jordan Liu40617152018-04-06 11:10:12 -07003100 * @hide
3101 */
chen xu85100482018-10-12 15:30:34 -07003102 @SystemApi
Jordan Liu40617152018-04-06 11:10:12 -07003103 public static final String APN_SET_ID = "apn_set_id";
3104
3105 /**
chen xu7ebcd782018-11-28 00:21:50 -08003106 * Possible value for the {@link #APN_SET_ID} field. By default APNs will not belong to a
3107 * set. If the user manually selects an APN without apn set id, there is no need to
3108 * prioritize any specific APN set ids.
chen xu85100482018-10-12 15:30:34 -07003109 * <p>Type: INTEGER</p>
Jordan Liu40617152018-04-06 11:10:12 -07003110 * @hide
3111 */
chen xu85100482018-10-12 15:30:34 -07003112 @SystemApi
chen xu7ebcd782018-11-28 00:21:50 -08003113 public static final int NO_APN_SET_ID = 0;
Jordan Liu40617152018-04-06 11:10:12 -07003114
calvinpan3689c962018-10-19 15:11:22 +08003115 /**
3116 * A unique carrier id associated with this APN
3117 * {@see TelephonyManager#getSimCarrierId()}
3118 * <p>Type: STRING</p>
3119 */
3120 public static final String CARRIER_ID = "carrier_id";
3121
chen xu7ebcd782018-11-28 00:21:50 -08003122 /** @hide */
3123 @IntDef({
3124 UNEDITED,
3125 USER_EDITED,
3126 USER_DELETED,
3127 CARRIER_DELETED,
3128 CARRIER_EDITED,
3129 })
3130 @Retention(RetentionPolicy.SOURCE)
3131 public @interface EditStatus {}
Dan Willemsen4980bf42017-02-14 14:17:12 -08003132 }
3133
3134 /**
3135 * Contains received SMS cell broadcast messages.
3136 * @hide
3137 */
3138 public static final class CellBroadcasts implements BaseColumns {
3139
3140 /**
3141 * Not instantiable.
3142 * @hide
3143 */
3144 private CellBroadcasts() {}
3145
3146 /**
3147 * The {@code content://} URI for this table.
3148 */
3149 public static final Uri CONTENT_URI = Uri.parse("content://cellbroadcasts");
3150
3151 /**
3152 * Message geographical scope.
3153 * <P>Type: INTEGER</P>
3154 */
3155 public static final String GEOGRAPHICAL_SCOPE = "geo_scope";
3156
3157 /**
3158 * Message serial number.
3159 * <P>Type: INTEGER</P>
3160 */
3161 public static final String SERIAL_NUMBER = "serial_number";
3162
3163 /**
3164 * PLMN of broadcast sender. {@code SERIAL_NUMBER + PLMN + LAC + CID} uniquely identifies
3165 * a broadcast for duplicate detection purposes.
3166 * <P>Type: TEXT</P>
3167 */
3168 public static final String PLMN = "plmn";
3169
3170 /**
3171 * Location Area (GSM) or Service Area (UMTS) of broadcast sender. Unused for CDMA.
3172 * Only included if Geographical Scope of message is not PLMN wide (01).
3173 * <P>Type: INTEGER</P>
3174 */
3175 public static final String LAC = "lac";
3176
3177 /**
3178 * Cell ID of message sender (GSM/UMTS). Unused for CDMA. Only included when the
3179 * Geographical Scope of message is cell wide (00 or 11).
3180 * <P>Type: INTEGER</P>
3181 */
3182 public static final String CID = "cid";
3183
3184 /**
3185 * Message code. <em>OBSOLETE: merged into SERIAL_NUMBER.</em>
3186 * <P>Type: INTEGER</P>
3187 */
3188 public static final String V1_MESSAGE_CODE = "message_code";
3189
3190 /**
3191 * Message identifier. <em>OBSOLETE: renamed to SERVICE_CATEGORY.</em>
3192 * <P>Type: INTEGER</P>
3193 */
3194 public static final String V1_MESSAGE_IDENTIFIER = "message_id";
3195
3196 /**
3197 * Service category (GSM/UMTS: message identifier; CDMA: service category).
3198 * <P>Type: INTEGER</P>
3199 */
3200 public static final String SERVICE_CATEGORY = "service_category";
3201
3202 /**
3203 * Message language code.
3204 * <P>Type: TEXT</P>
3205 */
3206 public static final String LANGUAGE_CODE = "language";
3207
3208 /**
3209 * Message body.
3210 * <P>Type: TEXT</P>
3211 */
3212 public static final String MESSAGE_BODY = "body";
3213
3214 /**
3215 * Message delivery time.
3216 * <P>Type: INTEGER (long)</P>
3217 */
3218 public static final String DELIVERY_TIME = "date";
3219
3220 /**
3221 * Has the message been viewed?
3222 * <P>Type: INTEGER (boolean)</P>
3223 */
3224 public static final String MESSAGE_READ = "read";
3225
3226 /**
3227 * Message format (3GPP or 3GPP2).
3228 * <P>Type: INTEGER</P>
3229 */
3230 public static final String MESSAGE_FORMAT = "format";
3231
3232 /**
3233 * Message priority (including emergency).
3234 * <P>Type: INTEGER</P>
3235 */
3236 public static final String MESSAGE_PRIORITY = "priority";
3237
3238 /**
3239 * ETWS warning type (ETWS alerts only).
3240 * <P>Type: INTEGER</P>
3241 */
3242 public static final String ETWS_WARNING_TYPE = "etws_warning_type";
3243
3244 /**
3245 * CMAS message class (CMAS alerts only).
3246 * <P>Type: INTEGER</P>
3247 */
3248 public static final String CMAS_MESSAGE_CLASS = "cmas_message_class";
3249
3250 /**
3251 * CMAS category (CMAS alerts only).
3252 * <P>Type: INTEGER</P>
3253 */
3254 public static final String CMAS_CATEGORY = "cmas_category";
3255
3256 /**
3257 * CMAS response type (CMAS alerts only).
3258 * <P>Type: INTEGER</P>
3259 */
3260 public static final String CMAS_RESPONSE_TYPE = "cmas_response_type";
3261
3262 /**
3263 * CMAS severity (CMAS alerts only).
3264 * <P>Type: INTEGER</P>
3265 */
3266 public static final String CMAS_SEVERITY = "cmas_severity";
3267
3268 /**
3269 * CMAS urgency (CMAS alerts only).
3270 * <P>Type: INTEGER</P>
3271 */
3272 public static final String CMAS_URGENCY = "cmas_urgency";
3273
3274 /**
3275 * CMAS certainty (CMAS alerts only).
3276 * <P>Type: INTEGER</P>
3277 */
3278 public static final String CMAS_CERTAINTY = "cmas_certainty";
3279
3280 /** The default sort order for this table. */
3281 public static final String DEFAULT_SORT_ORDER = DELIVERY_TIME + " DESC";
3282
3283 /**
3284 * Query columns for instantiating {@link android.telephony.CellBroadcastMessage} objects.
3285 */
3286 public static final String[] QUERY_COLUMNS = {
3287 _ID,
3288 GEOGRAPHICAL_SCOPE,
3289 PLMN,
3290 LAC,
3291 CID,
3292 SERIAL_NUMBER,
3293 SERVICE_CATEGORY,
3294 LANGUAGE_CODE,
3295 MESSAGE_BODY,
3296 DELIVERY_TIME,
3297 MESSAGE_READ,
3298 MESSAGE_FORMAT,
3299 MESSAGE_PRIORITY,
3300 ETWS_WARNING_TYPE,
3301 CMAS_MESSAGE_CLASS,
3302 CMAS_CATEGORY,
3303 CMAS_RESPONSE_TYPE,
3304 CMAS_SEVERITY,
3305 CMAS_URGENCY,
3306 CMAS_CERTAINTY
3307 };
3308 }
Jordan Liub9b75ed2017-02-28 18:15:07 -08003309
3310 /**
3311 * Constants for interfacing with the ServiceStateProvider and the different fields of the
3312 * {@link ServiceState} class accessible through the provider.
3313 */
3314 public static final class ServiceStateTable {
3315
3316 /**
3317 * Not instantiable.
3318 * @hide
3319 */
3320 private ServiceStateTable() {}
3321
3322 /**
3323 * The authority string for the ServiceStateProvider
3324 */
3325 public static final String AUTHORITY = "service-state";
3326
3327 /**
3328 * The {@code content://} style URL for the ServiceStateProvider
3329 */
3330 public static final Uri CONTENT_URI = Uri.parse("content://service-state/");
3331
3332 /**
3333 * Generates a content {@link Uri} used to receive updates on a specific field in the
3334 * ServiceState provider.
3335 * <p>
3336 * Use this {@link Uri} with a {@link ContentObserver} to be notified of changes to the
3337 * {@link ServiceState} while your app is running. You can also use a {@link JobService} to
3338 * ensure your app is notified of changes to the {@link Uri} even when it is not running.
3339 * Note, however, that using a {@link JobService} does not guarantee timely delivery of
3340 * updates to the {@link Uri}.
3341 *
Jordan Liu0f332522017-04-19 14:25:29 -07003342 * @param subscriptionId the subscriptionId to receive updates on
Jordan Liub9b75ed2017-02-28 18:15:07 -08003343 * @param field the ServiceState field to receive updates on
3344 * @return the Uri used to observe {@link ServiceState} changes
3345 */
Jordan Liu0f332522017-04-19 14:25:29 -07003346 public static Uri getUriForSubscriptionIdAndField(int subscriptionId, String field) {
3347 return CONTENT_URI.buildUpon().appendEncodedPath(String.valueOf(subscriptionId))
Jordan Liub9b75ed2017-02-28 18:15:07 -08003348 .appendEncodedPath(field).build();
3349 }
3350
3351 /**
3352 * Generates a content {@link Uri} used to receive updates on every field in the
3353 * ServiceState provider.
3354 * <p>
3355 * Use this {@link Uri} with a {@link ContentObserver} to be notified of changes to the
3356 * {@link ServiceState} while your app is running. You can also use a {@link JobService} to
3357 * ensure your app is notified of changes to the {@link Uri} even when it is not running.
3358 * Note, however, that using a {@link JobService} does not guarantee timely delivery of
3359 * updates to the {@link Uri}.
3360 *
Jordan Liu0f332522017-04-19 14:25:29 -07003361 * @param subscriptionId the subscriptionId to receive updates on
Jordan Liub9b75ed2017-02-28 18:15:07 -08003362 * @return the Uri used to observe {@link ServiceState} changes
3363 */
Jordan Liu0f332522017-04-19 14:25:29 -07003364 public static Uri getUriForSubscriptionId(int subscriptionId) {
3365 return CONTENT_URI.buildUpon().appendEncodedPath(String.valueOf(subscriptionId)).build();
Jordan Liub9b75ed2017-02-28 18:15:07 -08003366 }
3367
3368 /**
3369 * Used to insert a ServiceState into the ServiceStateProvider as a ContentValues instance.
3370 *
3371 * @param state the ServiceState to convert into ContentValues
3372 * @return the convertedContentValues instance
3373 * @hide
3374 */
3375 public static ContentValues getContentValuesForServiceState(ServiceState state) {
3376 ContentValues values = new ContentValues();
3377 values.put(VOICE_REG_STATE, state.getVoiceRegState());
3378 values.put(DATA_REG_STATE, state.getDataRegState());
3379 values.put(VOICE_ROAMING_TYPE, state.getVoiceRoamingType());
3380 values.put(DATA_ROAMING_TYPE, state.getDataRoamingType());
3381 values.put(VOICE_OPERATOR_ALPHA_LONG, state.getVoiceOperatorAlphaLong());
3382 values.put(VOICE_OPERATOR_ALPHA_SHORT, state.getVoiceOperatorAlphaShort());
3383 values.put(VOICE_OPERATOR_NUMERIC, state.getVoiceOperatorNumeric());
3384 values.put(DATA_OPERATOR_ALPHA_LONG, state.getDataOperatorAlphaLong());
3385 values.put(DATA_OPERATOR_ALPHA_SHORT, state.getDataOperatorAlphaShort());
3386 values.put(DATA_OPERATOR_NUMERIC, state.getDataOperatorNumeric());
3387 values.put(IS_MANUAL_NETWORK_SELECTION, state.getIsManualSelection());
3388 values.put(RIL_VOICE_RADIO_TECHNOLOGY, state.getRilVoiceRadioTechnology());
3389 values.put(RIL_DATA_RADIO_TECHNOLOGY, state.getRilDataRadioTechnology());
3390 values.put(CSS_INDICATOR, state.getCssIndicator());
Jack Yu2661fac2018-03-15 13:51:05 -07003391 values.put(NETWORK_ID, state.getCdmaNetworkId());
3392 values.put(SYSTEM_ID, state.getCdmaSystemId());
Jordan Liub9b75ed2017-02-28 18:15:07 -08003393 values.put(CDMA_ROAMING_INDICATOR, state.getCdmaRoamingIndicator());
3394 values.put(CDMA_DEFAULT_ROAMING_INDICATOR, state.getCdmaDefaultRoamingIndicator());
3395 values.put(CDMA_ERI_ICON_INDEX, state.getCdmaEriIconIndex());
3396 values.put(CDMA_ERI_ICON_MODE, state.getCdmaEriIconMode());
3397 values.put(IS_EMERGENCY_ONLY, state.isEmergencyOnly());
Jordan Liub9b75ed2017-02-28 18:15:07 -08003398 values.put(IS_USING_CARRIER_AGGREGATION, state.isUsingCarrierAggregation());
3399 return values;
3400 }
3401
3402 /**
3403 * An integer value indicating the current voice service state.
3404 * <p>
3405 * Valid values: {@link ServiceState#STATE_IN_SERVICE},
3406 * {@link ServiceState#STATE_OUT_OF_SERVICE}, {@link ServiceState#STATE_EMERGENCY_ONLY},
3407 * {@link ServiceState#STATE_POWER_OFF}.
3408 * <p>
3409 * This is the same as {@link ServiceState#getState()}.
3410 */
3411 public static final String VOICE_REG_STATE = "voice_reg_state";
3412
3413 /**
3414 * An integer value indicating the current data service state.
3415 * <p>
3416 * Valid values: {@link ServiceState#STATE_IN_SERVICE},
3417 * {@link ServiceState#STATE_OUT_OF_SERVICE}, {@link ServiceState#STATE_EMERGENCY_ONLY},
3418 * {@link ServiceState#STATE_POWER_OFF}.
3419 * <p>
3420 * This is the same as {@link ServiceState#getDataRegState()}.
3421 * @hide
3422 */
3423 public static final String DATA_REG_STATE = "data_reg_state";
3424
3425 /**
3426 * An integer value indicating the current voice roaming type.
3427 * <p>
3428 * This is the same as {@link ServiceState#getVoiceRoamingType()}.
3429 * @hide
3430 */
3431 public static final String VOICE_ROAMING_TYPE = "voice_roaming_type";
3432
3433 /**
3434 * An integer value indicating the current data roaming type.
3435 * <p>
3436 * This is the same as {@link ServiceState#getDataRoamingType()}.
3437 * @hide
3438 */
3439 public static final String DATA_ROAMING_TYPE = "data_roaming_type";
3440
3441 /**
3442 * The current registered voice network operator name in long alphanumeric format.
3443 * <p>
3444 * This is the same as {@link ServiceState#getVoiceOperatorAlphaLong()}.
3445 * @hide
3446 */
3447 public static final String VOICE_OPERATOR_ALPHA_LONG = "voice_operator_alpha_long";
3448
3449 /**
3450 * The current registered operator name in short alphanumeric format.
3451 * <p>
3452 * In GSM/UMTS, short format can be up to 8 characters long. The current registered voice
3453 * network operator name in long alphanumeric format.
3454 * <p>
3455 * This is the same as {@link ServiceState#getVoiceOperatorAlphaShort()}.
3456 * @hide
3457 */
3458 public static final String VOICE_OPERATOR_ALPHA_SHORT = "voice_operator_alpha_short";
3459
3460
3461 /**
3462 * The current registered operator numeric id.
3463 * <p>
3464 * In GSM/UMTS, numeric format is 3 digit country code plus 2 or 3 digit
3465 * network code.
3466 * <p>
3467 * This is the same as {@link ServiceState#getOperatorNumeric()}.
3468 */
3469 public static final String VOICE_OPERATOR_NUMERIC = "voice_operator_numeric";
3470
3471 /**
3472 * The current registered data network operator name in long alphanumeric format.
3473 * <p>
3474 * This is the same as {@link ServiceState#getDataOperatorAlphaLong()}.
3475 * @hide
3476 */
3477 public static final String DATA_OPERATOR_ALPHA_LONG = "data_operator_alpha_long";
3478
3479 /**
3480 * The current registered data network operator name in short alphanumeric format.
3481 * <p>
3482 * This is the same as {@link ServiceState#getDataOperatorAlphaShort()}.
3483 * @hide
3484 */
3485 public static final String DATA_OPERATOR_ALPHA_SHORT = "data_operator_alpha_short";
3486
3487 /**
3488 * The current registered data network operator numeric id.
3489 * <p>
3490 * This is the same as {@link ServiceState#getDataOperatorNumeric()}.
3491 * @hide
3492 */
3493 public static final String DATA_OPERATOR_NUMERIC = "data_operator_numeric";
3494
3495 /**
3496 * The current network selection mode.
3497 * <p>
3498 * This is the same as {@link ServiceState#getIsManualSelection()}.
3499 */
3500 public static final String IS_MANUAL_NETWORK_SELECTION = "is_manual_network_selection";
3501
3502 /**
3503 * This is the same as {@link ServiceState#getRilVoiceRadioTechnology()}.
3504 * @hide
3505 */
3506 public static final String RIL_VOICE_RADIO_TECHNOLOGY = "ril_voice_radio_technology";
3507
3508 /**
3509 * This is the same as {@link ServiceState#getRilDataRadioTechnology()}.
3510 * @hide
3511 */
3512 public static final String RIL_DATA_RADIO_TECHNOLOGY = "ril_data_radio_technology";
3513
3514 /**
3515 * This is the same as {@link ServiceState#getCssIndicator()}.
3516 * @hide
3517 */
3518 public static final String CSS_INDICATOR = "css_indicator";
3519
3520 /**
Jack Yu2661fac2018-03-15 13:51:05 -07003521 * This is the same as {@link ServiceState#getCdmaNetworkId()}.
Jordan Liub9b75ed2017-02-28 18:15:07 -08003522 * @hide
3523 */
3524 public static final String NETWORK_ID = "network_id";
3525
3526 /**
Jack Yu2661fac2018-03-15 13:51:05 -07003527 * This is the same as {@link ServiceState#getCdmaSystemId()}.
Jordan Liub9b75ed2017-02-28 18:15:07 -08003528 * @hide
3529 */
3530 public static final String SYSTEM_ID = "system_id";
3531
3532 /**
3533 * This is the same as {@link ServiceState#getCdmaRoamingIndicator()}.
3534 * @hide
3535 */
3536 public static final String CDMA_ROAMING_INDICATOR = "cdma_roaming_indicator";
3537
3538 /**
3539 * This is the same as {@link ServiceState#getCdmaDefaultRoamingIndicator()}.
3540 * @hide
3541 */
3542 public static final String CDMA_DEFAULT_ROAMING_INDICATOR =
3543 "cdma_default_roaming_indicator";
3544
3545 /**
3546 * This is the same as {@link ServiceState#getCdmaEriIconIndex()}.
3547 * @hide
3548 */
3549 public static final String CDMA_ERI_ICON_INDEX = "cdma_eri_icon_index";
3550
3551 /**
3552 * This is the same as {@link ServiceState#getCdmaEriIconMode()}.
3553 * @hide
3554 */
3555 public static final String CDMA_ERI_ICON_MODE = "cdma_eri_icon_mode";
3556
3557 /**
3558 * This is the same as {@link ServiceState#isEmergencyOnly()}.
3559 * @hide
3560 */
3561 public static final String IS_EMERGENCY_ONLY = "is_emergency_only";
3562
3563 /**
3564 * This is the same as {@link ServiceState#getDataRoamingFromRegistration()}.
3565 * @hide
3566 */
3567 public static final String IS_DATA_ROAMING_FROM_REGISTRATION =
3568 "is_data_roaming_from_registration";
3569
3570 /**
3571 * This is the same as {@link ServiceState#isUsingCarrierAggregation()}.
3572 * @hide
3573 */
3574 public static final String IS_USING_CARRIER_AGGREGATION = "is_using_carrier_aggregation";
3575 }
fionaxu3d0ad1f2017-10-25 23:09:36 -07003576
3577 /**
fionaxu58278be2018-01-29 14:08:12 -08003578 * Contains carrier identification information for the current subscriptions.
3579 * @see SubscriptionManager#getActiveSubscriptionIdList()
fionaxu3d0ad1f2017-10-25 23:09:36 -07003580 */
fionaxu62bc7472018-02-28 11:18:45 -08003581 public static final class CarrierId implements BaseColumns {
fionaxu3d0ad1f2017-10-25 23:09:36 -07003582 /**
fionaxu58278be2018-01-29 14:08:12 -08003583 * Not instantiable.
3584 * @hide
fionaxu3d0ad1f2017-10-25 23:09:36 -07003585 */
fionaxu62bc7472018-02-28 11:18:45 -08003586 private CarrierId() {}
fionaxu3d0ad1f2017-10-25 23:09:36 -07003587
3588 /**
fionaxu58278be2018-01-29 14:08:12 -08003589 * The {@code content://} style URI for this provider.
fionaxu3d0ad1f2017-10-25 23:09:36 -07003590 */
fionaxu62bc7472018-02-28 11:18:45 -08003591 public static final Uri CONTENT_URI = Uri.parse("content://carrier_id");
fionaxu3d0ad1f2017-10-25 23:09:36 -07003592
3593 /**
fionaxu62bc7472018-02-28 11:18:45 -08003594 * The authority string for the CarrierId Provider
fionaxu58278be2018-01-29 14:08:12 -08003595 * @hide
fionaxu3d0ad1f2017-10-25 23:09:36 -07003596 */
fionaxu62bc7472018-02-28 11:18:45 -08003597 public static final String AUTHORITY = "carrier_id";
fionaxu58278be2018-01-29 14:08:12 -08003598
fionaxu3d0ad1f2017-10-25 23:09:36 -07003599
3600 /**
fionaxu58278be2018-01-29 14:08:12 -08003601 * Generates a content {@link Uri} used to receive updates on carrier identity change
3602 * on the given subscriptionId
3603 * <p>
3604 * Use this {@link Uri} with a {@link ContentObserver} to be notified of changes to the
fionaxuc8d483e2018-03-07 21:52:05 -08003605 * carrier identity {@link TelephonyManager#getSimCarrierId()}
fionaxu58278be2018-01-29 14:08:12 -08003606 * while your app is running. You can also use a {@link JobService} to ensure your app
3607 * is notified of changes to the {@link Uri} even when it is not running.
3608 * Note, however, that using a {@link JobService} does not guarantee timely delivery of
3609 * updates to the {@link Uri}.
3610 *
3611 * @param subscriptionId the subscriptionId to receive updates on
3612 * @return the Uri used to observe carrier identity changes
fionaxu3d0ad1f2017-10-25 23:09:36 -07003613 */
fionaxu58278be2018-01-29 14:08:12 -08003614 public static Uri getUriForSubscriptionId(int subscriptionId) {
3615 return CONTENT_URI.buildUpon().appendEncodedPath(
3616 String.valueOf(subscriptionId)).build();
3617 }
fionaxu3d0ad1f2017-10-25 23:09:36 -07003618
3619 /**
chen xua8d3d482018-11-02 17:49:57 -07003620 * Generates a content {@link Uri} used to receive updates on precise carrier identity
chen xu64c1d7642018-12-06 15:34:05 -08003621 * change on the given subscriptionId returned by
3622 * {@link TelephonyManager#getSimPreciseCarrierId()}.
3623 * @see TelephonyManager#ACTION_SUBSCRIPTION_PRECISE_CARRIER_IDENTITY_CHANGED
chen xua8d3d482018-11-02 17:49:57 -07003624 * <p>
3625 * Use this {@link Uri} with a {@link ContentObserver} to be notified of changes to the
3626 * precise carrier identity {@link TelephonyManager#getSimPreciseCarrierId()}
3627 * while your app is running. You can also use a {@link JobService} to ensure your app
3628 * is notified of changes to the {@link Uri} even when it is not running.
3629 * Note, however, that using a {@link JobService} does not guarantee timely delivery of
3630 * updates to the {@link Uri}.
3631 *
3632 * @param subscriptionId the subscriptionId to receive updates on
3633 * @return the Uri used to observe precise carrier identity changes
chen xua8d3d482018-11-02 17:49:57 -07003634 */
3635 public static Uri getPreciseCarrierIdUriForSubscriptionId(int subscriptionId) {
3636 return Uri.withAppendedPath(Uri.withAppendedPath(CONTENT_URI, "precise"),
3637 String.valueOf(subscriptionId));
3638 }
3639
3640 /**
fionaxu58278be2018-01-29 14:08:12 -08003641 * A user facing carrier name.
fionaxuc8d483e2018-03-07 21:52:05 -08003642 * @see TelephonyManager#getSimCarrierIdName()
fionaxu3d0ad1f2017-10-25 23:09:36 -07003643 * <P>Type: TEXT </P>
3644 */
fionaxu62bc7472018-02-28 11:18:45 -08003645 public static final String CARRIER_NAME = "carrier_name";
fionaxu3d0ad1f2017-10-25 23:09:36 -07003646
3647 /**
3648 * A unique carrier id
fionaxuc8d483e2018-03-07 21:52:05 -08003649 * @see TelephonyManager#getSimCarrierId()
fionaxu3d0ad1f2017-10-25 23:09:36 -07003650 * <P>Type: INTEGER </P>
3651 */
fionaxu62bc7472018-02-28 11:18:45 -08003652 public static final String CARRIER_ID = "carrier_id";
fionaxu3d0ad1f2017-10-25 23:09:36 -07003653
3654 /**
chen xua8d3d482018-11-02 17:49:57 -07003655 * A fine-grained carrier id.
3656 * @see TelephonyManager#getSimPreciseCarrierId()
3657 * This is not a database column, only used to notify content observers for
3658 * {@link #getPreciseCarrierIdUriForSubscriptionId(int)}
chen xua8d3d482018-11-02 17:49:57 -07003659 */
3660 public static final String PRECISE_CARRIER_ID = "precise_carrier_id";
3661
3662 /**
chen xu64c1d7642018-12-06 15:34:05 -08003663 * A user facing carrier name for precise carrier id {@link #PRECISE_CARRIER_ID}.
3664 * @see TelephonyManager#getSimPreciseCarrierIdName()
3665 * This is not a database column, only used to notify content observers for
3666 * {@link #getPreciseCarrierIdUriForSubscriptionId(int)}
3667 */
3668 public static final String PRECISE_CARRIER_ID_NAME = "precise_carrier_id_name";
3669
3670 /**
chen xua8d3d482018-11-02 17:49:57 -07003671 * A unique parent carrier id. The parent-child
3672 * relationship can be used to further differentiate a single carrier by different networks,
3673 * by prepaid v.s. postpaid or even by 4G v.s. 3G plan. It's an optional field.
3674 * A carrier id with a valid parent_carrier_id is considered fine-grained carrier id, will
3675 * not be returned as {@link #CARRIER_ID} but {@link #PRECISE_CARRIER_ID}.
3676 * <P>Type: INTEGER </P>
3677 * @hide
3678 */
3679 public static final String PARENT_CARRIER_ID = "parent_carrier_id";
3680
3681 /**
fionaxu58278be2018-01-29 14:08:12 -08003682 * Contains mappings between matching rules with carrier id for all carriers.
3683 * @hide
fionaxu3d0ad1f2017-10-25 23:09:36 -07003684 */
fionaxu58278be2018-01-29 14:08:12 -08003685 public static final class All implements BaseColumns {
3686 /**
3687 * Numeric operator ID (as String). {@code MCC + MNC}
3688 * <P>Type: TEXT </P>
3689 */
3690 public static final String MCCMNC = "mccmnc";
3691
3692 /**
3693 * Group id level 1 (as String).
3694 * <P>Type: TEXT </P>
3695 */
3696 public static final String GID1 = "gid1";
3697
3698 /**
3699 * Group id level 2 (as String).
3700 * <P>Type: TEXT </P>
3701 */
3702 public static final String GID2 = "gid2";
3703
3704 /**
3705 * Public Land Mobile Network name.
3706 * <P>Type: TEXT </P>
3707 */
3708 public static final String PLMN = "plmn";
3709
3710 /**
3711 * Prefix xpattern of IMSI (International Mobile Subscriber Identity).
3712 * <P>Type: TEXT </P>
3713 */
3714 public static final String IMSI_PREFIX_XPATTERN = "imsi_prefix_xpattern";
3715
3716 /**
3717 * Service Provider Name.
3718 * <P>Type: TEXT </P>
3719 */
3720 public static final String SPN = "spn";
3721
3722 /**
3723 * Prefer APN name.
3724 * <P>Type: TEXT </P>
3725 */
3726 public static final String APN = "apn";
3727
3728 /**
3729 * Prefix of Integrated Circuit Card Identifier.
3730 * <P>Type: TEXT </P>
3731 */
3732 public static final String ICCID_PREFIX = "iccid_prefix";
3733
3734 /**
fionaxue9c6da72018-06-08 16:55:25 -07003735 * Certificate for carrier privilege access rules.
3736 * <P>Type: TEXT in hex string </P>
3737 */
3738 public static final String PRIVILEGE_ACCESS_RULE = "privilege_access_rule";
3739
3740 /**
fionaxu58278be2018-01-29 14:08:12 -08003741 * The {@code content://} URI for this table.
3742 */
fionaxu62bc7472018-02-28 11:18:45 -08003743 public static final Uri CONTENT_URI = Uri.parse("content://carrier_id/all");
fionaxu58278be2018-01-29 14:08:12 -08003744 }
fionaxu3d0ad1f2017-10-25 23:09:36 -07003745 }
Dan Willemsen4980bf42017-02-14 14:17:12 -08003746}