blob: 51532bc8ca5ca5d109bb5fd1e675ddcf01c71cc0 [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.
2314 */
2315 public static final class Part implements BaseColumns {
2316
2317 /**
2318 * Not instantiable.
2319 * @hide
2320 */
2321 private Part() {
2322 }
2323
2324 /**
2325 * The identifier of the message which this part belongs to.
2326 * <P>Type: INTEGER</P>
2327 */
2328 public static final String MSG_ID = "mid";
2329
2330 /**
2331 * The order of the part.
2332 * <P>Type: INTEGER</P>
2333 */
2334 public static final String SEQ = "seq";
2335
2336 /**
2337 * The content type of the part.
2338 * <P>Type: TEXT</P>
2339 */
2340 public static final String CONTENT_TYPE = "ct";
2341
2342 /**
2343 * The name of the part.
2344 * <P>Type: TEXT</P>
2345 */
2346 public static final String NAME = "name";
2347
2348 /**
2349 * The charset of the part.
2350 * <P>Type: TEXT</P>
2351 */
2352 public static final String CHARSET = "chset";
2353
2354 /**
2355 * The file name of the part.
2356 * <P>Type: TEXT</P>
2357 */
2358 public static final String FILENAME = "fn";
2359
2360 /**
2361 * The content disposition of the part.
2362 * <P>Type: TEXT</P>
2363 */
2364 public static final String CONTENT_DISPOSITION = "cd";
2365
2366 /**
2367 * The content ID of the part.
2368 * <P>Type: INTEGER</P>
2369 */
2370 public static final String CONTENT_ID = "cid";
2371
2372 /**
2373 * The content location of the part.
2374 * <P>Type: INTEGER</P>
2375 */
2376 public static final String CONTENT_LOCATION = "cl";
2377
2378 /**
2379 * The start of content-type of the message.
2380 * <P>Type: INTEGER</P>
2381 */
2382 public static final String CT_START = "ctt_s";
2383
2384 /**
2385 * The type of content-type of the message.
2386 * <P>Type: TEXT</P>
2387 */
2388 public static final String CT_TYPE = "ctt_t";
2389
2390 /**
2391 * The location (on filesystem) of the binary data of the part.
2392 * <P>Type: INTEGER</P>
2393 */
2394 public static final String _DATA = "_data";
2395
2396 /**
2397 * The message text.
2398 * <P>Type: TEXT</P>
2399 */
2400 public static final String TEXT = "text";
2401 }
2402
2403 /**
2404 * Message send rate table.
2405 */
2406 public static final class Rate {
2407
2408 /**
2409 * Not instantiable.
2410 * @hide
2411 */
2412 private Rate() {
2413 }
2414
2415 /**
2416 * The {@code content://} style URL for this table.
2417 */
2418 public static final Uri CONTENT_URI = Uri.withAppendedPath(
2419 Mms.CONTENT_URI, "rate");
2420
2421 /**
2422 * When a message was successfully sent.
2423 * <P>Type: INTEGER (long)</P>
2424 */
2425 public static final String SENT_TIME = "sent_time";
2426 }
2427
2428 /**
2429 * Intents class.
2430 */
2431 public static final class Intents {
2432
2433 /**
2434 * Not instantiable.
2435 * @hide
2436 */
2437 private Intents() {
2438 }
2439
2440 /**
2441 * Indicates that the contents of specified URIs were changed.
2442 * The application which is showing or caching these contents
2443 * should be updated.
2444 */
2445 @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
2446 public static final String CONTENT_CHANGED_ACTION
2447 = "android.intent.action.CONTENT_CHANGED";
2448
2449 /**
2450 * An extra field which stores the URI of deleted contents.
2451 */
2452 public static final String DELETED_CONTENTS = "deleted_contents";
2453 }
2454 }
2455
2456 /**
2457 * Contains all MMS and SMS messages.
2458 */
2459 public static final class MmsSms implements BaseColumns {
2460
2461 /**
2462 * Not instantiable.
2463 * @hide
2464 */
2465 private MmsSms() {
2466 }
2467
2468 /**
2469 * The column to distinguish SMS and MMS messages in query results.
2470 */
2471 public static final String TYPE_DISCRIMINATOR_COLUMN =
2472 "transport_type";
2473
2474 /**
2475 * The {@code content://} style URL for this table.
2476 */
2477 public static final Uri CONTENT_URI = Uri.parse("content://mms-sms/");
2478
2479 /**
2480 * The {@code content://} style URL for this table, by conversation.
2481 */
2482 public static final Uri CONTENT_CONVERSATIONS_URI = Uri.parse(
2483 "content://mms-sms/conversations");
2484
2485 /**
2486 * The {@code content://} style URL for this table, by phone number.
2487 */
2488 public static final Uri CONTENT_FILTER_BYPHONE_URI = Uri.parse(
2489 "content://mms-sms/messages/byphone");
2490
2491 /**
2492 * The {@code content://} style URL for undelivered messages in this table.
2493 */
2494 public static final Uri CONTENT_UNDELIVERED_URI = Uri.parse(
2495 "content://mms-sms/undelivered");
2496
2497 /**
2498 * The {@code content://} style URL for draft messages in this table.
2499 */
2500 public static final Uri CONTENT_DRAFT_URI = Uri.parse(
2501 "content://mms-sms/draft");
2502
2503 /**
2504 * The {@code content://} style URL for locked messages in this table.
2505 */
2506 public static final Uri CONTENT_LOCKED_URI = Uri.parse(
2507 "content://mms-sms/locked");
2508
2509 /**
2510 * Pass in a query parameter called "pattern" which is the text to search for.
2511 * The sort order is fixed to be: {@code thread_id ASC, date DESC}.
2512 */
2513 public static final Uri SEARCH_URI = Uri.parse(
2514 "content://mms-sms/search");
2515
2516 // Constants for message protocol types.
2517
2518 /** SMS protocol type. */
2519 public static final int SMS_PROTO = 0;
2520
2521 /** MMS protocol type. */
2522 public static final int MMS_PROTO = 1;
2523
2524 // Constants for error types of pending messages.
2525
2526 /** Error type: no error. */
2527 public static final int NO_ERROR = 0;
2528
2529 /** Error type: generic transient error. */
2530 public static final int ERR_TYPE_GENERIC = 1;
2531
2532 /** Error type: SMS protocol transient error. */
2533 public static final int ERR_TYPE_SMS_PROTO_TRANSIENT = 2;
2534
2535 /** Error type: MMS protocol transient error. */
2536 public static final int ERR_TYPE_MMS_PROTO_TRANSIENT = 3;
2537
2538 /** Error type: transport failure. */
2539 public static final int ERR_TYPE_TRANSPORT_FAILURE = 4;
2540
2541 /** Error type: permanent error (along with all higher error values). */
2542 public static final int ERR_TYPE_GENERIC_PERMANENT = 10;
2543
2544 /** Error type: SMS protocol permanent error. */
2545 public static final int ERR_TYPE_SMS_PROTO_PERMANENT = 11;
2546
2547 /** Error type: MMS protocol permanent error. */
2548 public static final int ERR_TYPE_MMS_PROTO_PERMANENT = 12;
2549
2550 /**
2551 * Contains pending messages info.
2552 */
2553 public static final class PendingMessages implements BaseColumns {
2554
2555 /**
2556 * Not instantiable.
2557 * @hide
2558 */
2559 private PendingMessages() {
2560 }
2561
2562 public static final Uri CONTENT_URI = Uri.withAppendedPath(
2563 MmsSms.CONTENT_URI, "pending");
2564
2565 /**
2566 * The type of transport protocol (MMS or SMS).
2567 * <P>Type: INTEGER</P>
2568 */
2569 public static final String PROTO_TYPE = "proto_type";
2570
2571 /**
2572 * The ID of the message to be sent or downloaded.
2573 * <P>Type: INTEGER (long)</P>
2574 */
2575 public static final String MSG_ID = "msg_id";
2576
2577 /**
2578 * The type of the message to be sent or downloaded.
2579 * This field is only valid for MM. For SM, its value is always set to 0.
2580 * <P>Type: INTEGER</P>
2581 */
2582 public static final String MSG_TYPE = "msg_type";
2583
2584 /**
2585 * The type of the error code.
2586 * <P>Type: INTEGER</P>
2587 */
2588 public static final String ERROR_TYPE = "err_type";
2589
2590 /**
2591 * The error code of sending/retrieving process.
2592 * <P>Type: INTEGER</P>
2593 */
2594 public static final String ERROR_CODE = "err_code";
2595
2596 /**
2597 * How many times we tried to send or download the message.
2598 * <P>Type: INTEGER</P>
2599 */
2600 public static final String RETRY_INDEX = "retry_index";
2601
2602 /**
2603 * The time to do next retry.
2604 * <P>Type: INTEGER (long)</P>
2605 */
2606 public static final String DUE_TIME = "due_time";
2607
2608 /**
2609 * The time we last tried to send or download the message.
2610 * <P>Type: INTEGER (long)</P>
2611 */
2612 public static final String LAST_TRY = "last_try";
2613
2614 /**
2615 * The subscription to which the message belongs to. Its value will be
2616 * < 0 if the sub id cannot be determined.
2617 * <p>Type: INTEGER (long) </p>
2618 */
2619 public static final String SUBSCRIPTION_ID = "pending_sub_id";
2620 }
2621
2622 /**
2623 * Words table used by provider for full-text searches.
2624 * @hide
2625 */
2626 public static final class WordsTable {
2627
2628 /**
2629 * Not instantiable.
2630 * @hide
2631 */
2632 private WordsTable() {}
2633
2634 /**
2635 * Primary key.
2636 * <P>Type: INTEGER (long)</P>
2637 */
2638 public static final String ID = "_id";
2639
2640 /**
2641 * Source row ID.
2642 * <P>Type: INTEGER (long)</P>
2643 */
2644 public static final String SOURCE_ROW_ID = "source_id";
2645
2646 /**
2647 * Table ID (either 1 or 2).
2648 * <P>Type: INTEGER</P>
2649 */
2650 public static final String TABLE_ID = "table_to_use";
2651
2652 /**
2653 * The words to index.
2654 * <P>Type: TEXT</P>
2655 */
2656 public static final String INDEXED_TEXT = "index_text";
2657 }
2658 }
2659
2660 /**
2661 * Carriers class contains information about APNs, including MMSC information.
2662 */
2663 public static final class Carriers implements BaseColumns {
2664
2665 /**
2666 * Not instantiable.
2667 * @hide
2668 */
2669 private Carriers() {}
2670
2671 /**
2672 * The {@code content://} style URL for this table.
calvinpan5e272372018-12-07 20:03:48 +08002673 * For MSIM, this will return APNs for the default subscription
2674 * {@link SubscriptionManager#getDefaultSubscriptionId()}. To specify subId for MSIM,
2675 * use {@link Uri#withAppendedPath(Uri, String)} to append with subscription id.
Dan Willemsen4980bf42017-02-14 14:17:12 -08002676 */
2677 public static final Uri CONTENT_URI = Uri.parse("content://telephony/carriers");
2678
2679 /**
calvinpan5e272372018-12-07 20:03:48 +08002680 * The {@code content://} style URL for this table. Used for APN query based on current
2681 * subscription. Instead of specifying carrier matching information in the selection,
2682 * this API will return all matching APNs from current subscription carrier and queries
2683 * will be applied on top of that. If there is no match for MVNO (Mobile Virtual Network
2684 * Operator) APNs, return APNs from its MNO (based on mccmnc) instead. For MSIM, this will
2685 * return APNs for the default subscription
2686 * {@link SubscriptionManager#getDefaultSubscriptionId()}. To specify subId for MSIM,
2687 * use {@link Uri#withAppendedPath(Uri, String)} to append with subscription id.
2688 */
2689 public static final Uri SIM_APN_URI = Uri.parse(
2690 "content://telephony/carriers/sim_apn_list");
2691
2692 /**
yuemingw4c0065f2018-01-16 19:48:10 +00002693 * The {@code content://} style URL to be called from DevicePolicyManagerService,
2694 * can manage DPC-owned APNs.
2695 * @hide
2696 */
2697 public static final Uri DPC_URI = Uri.parse("content://telephony/carriers/dpc");
2698
2699 /**
2700 * The {@code content://} style URL to be called from Telephony to query APNs.
2701 * When DPC-owned APNs are enforced, only DPC-owned APNs are returned, otherwise only
calvinpan5e272372018-12-07 20:03:48 +08002702 * non-DPC-owned APNs are returned. For MSIM, this will return APNs for the default
2703 * subscription {@link SubscriptionManager#getDefaultSubscriptionId()}. To specify subId
2704 * for MSIM, use {@link Uri#withAppendedPath(Uri, String)} to append with subscription id.
yuemingw4c0065f2018-01-16 19:48:10 +00002705 * @hide
2706 */
2707 public static final Uri FILTERED_URI = Uri.parse("content://telephony/carriers/filtered");
2708
2709 /**
2710 * The {@code content://} style URL to be called from DevicePolicyManagerService
2711 * or Telephony to manage whether DPC-owned APNs are enforced.
2712 * @hide
2713 */
2714 public static final Uri ENFORCE_MANAGED_URI = Uri.parse(
2715 "content://telephony/carriers/enforce_managed");
2716
2717 /**
2718 * The column name for ENFORCE_MANAGED_URI, indicates whether DPC-owned APNs are enforced.
2719 * @hide
2720 */
2721 public static final String ENFORCE_KEY = "enforced";
2722
2723 /**
Dan Willemsen4980bf42017-02-14 14:17:12 -08002724 * The default sort order for this table.
2725 */
2726 public static final String DEFAULT_SORT_ORDER = "name ASC";
2727
2728 /**
2729 * Entry name.
2730 * <P>Type: TEXT</P>
2731 */
2732 public static final String NAME = "name";
2733
2734 /**
2735 * APN name.
2736 * <P>Type: TEXT</P>
2737 */
2738 public static final String APN = "apn";
2739
2740 /**
2741 * Proxy address.
2742 * <P>Type: TEXT</P>
2743 */
2744 public static final String PROXY = "proxy";
2745
2746 /**
2747 * Proxy port.
2748 * <P>Type: TEXT</P>
2749 */
2750 public static final String PORT = "port";
2751
2752 /**
2753 * MMS proxy address.
2754 * <P>Type: TEXT</P>
2755 */
2756 public static final String MMSPROXY = "mmsproxy";
2757
2758 /**
2759 * MMS proxy port.
2760 * <P>Type: TEXT</P>
2761 */
2762 public static final String MMSPORT = "mmsport";
2763
2764 /**
2765 * Server address.
2766 * <P>Type: TEXT</P>
2767 */
2768 public static final String SERVER = "server";
2769
2770 /**
2771 * APN username.
2772 * <P>Type: TEXT</P>
2773 */
2774 public static final String USER = "user";
2775
2776 /**
2777 * APN password.
2778 * <P>Type: TEXT</P>
2779 */
2780 public static final String PASSWORD = "password";
2781
2782 /**
2783 * MMSC URL.
2784 * <P>Type: TEXT</P>
2785 */
2786 public static final String MMSC = "mmsc";
2787
2788 /**
2789 * Mobile Country Code (MCC).
2790 * <P>Type: TEXT</P>
calvinpan5e272372018-12-07 20:03:48 +08002791 * @deprecated Use {@link #SIM_APN_URI} to query APN instead, this API will return
2792 * matching APNs based on current subscription carrier, thus no need to specify MCC and
2793 * other carrier matching information. In the future, Android will not support MCC for
2794 * APN query.
Dan Willemsen4980bf42017-02-14 14:17:12 -08002795 */
2796 public static final String MCC = "mcc";
2797
2798 /**
2799 * Mobile Network Code (MNC).
2800 * <P>Type: TEXT</P>
calvinpan5e272372018-12-07 20:03:48 +08002801 * @deprecated Use {@link #SIM_APN_URI} to query APN instead, this API will return
2802 * matching APNs based on current subscription carrier, thus no need to specify MNC and
2803 * other carrier matching information. In the future, Android will not support MNC for
2804 * APN query.
Dan Willemsen4980bf42017-02-14 14:17:12 -08002805 */
2806 public static final String MNC = "mnc";
2807
2808 /**
2809 * Numeric operator ID (as String). Usually {@code MCC + MNC}.
2810 * <P>Type: TEXT</P>
calvinpan5e272372018-12-07 20:03:48 +08002811 * @deprecated Use {@link #SIM_APN_URI} to query APN instead, this API will return
2812 * matching APNs based on current subscription carrier, thus no need to specify Numeric
2813 * and other carrier matching information. In the future, Android will not support Numeric
2814 * for APN query.
Dan Willemsen4980bf42017-02-14 14:17:12 -08002815 */
2816 public static final String NUMERIC = "numeric";
2817
2818 /**
2819 * Authentication type.
2820 * <P>Type: INTEGER</P>
2821 */
2822 public static final String AUTH_TYPE = "authtype";
2823
2824 /**
2825 * Comma-delimited list of APN types.
2826 * <P>Type: TEXT</P>
2827 */
2828 public static final String TYPE = "type";
2829
2830 /**
2831 * The protocol to use to connect to this APN.
2832 *
2833 * One of the {@code PDP_type} values in TS 27.007 section 10.1.1.
2834 * For example: {@code IP}, {@code IPV6}, {@code IPV4V6}, or {@code PPP}.
2835 * <P>Type: TEXT</P>
2836 */
2837 public static final String PROTOCOL = "protocol";
2838
2839 /**
2840 * The protocol to use to connect to this APN when roaming.
2841 * The syntax is the same as protocol.
2842 * <P>Type: TEXT</P>
2843 */
2844 public static final String ROAMING_PROTOCOL = "roaming_protocol";
2845
2846 /**
2847 * Is this the current APN?
2848 * <P>Type: INTEGER (boolean)</P>
2849 */
2850 public static final String CURRENT = "current";
2851
2852 /**
2853 * Is this APN enabled?
2854 * <P>Type: INTEGER (boolean)</P>
2855 */
2856 public static final String CARRIER_ENABLED = "carrier_enabled";
2857
2858 /**
2859 * Radio Access Technology info.
2860 * To check what values are allowed, refer to {@link android.telephony.ServiceState}.
2861 * This should be spread to other technologies,
2862 * but is currently only used for LTE (14) and eHRPD (13).
2863 * <P>Type: INTEGER</P>
Cassiee1c88022018-02-22 08:51:03 -08002864 * @deprecated this column is no longer supported, use {@link #NETWORK_TYPE_BITMASK} instead
Dan Willemsen4980bf42017-02-14 14:17:12 -08002865 */
Cassied53df962017-12-05 13:34:33 -08002866 @Deprecated
Dan Willemsen4980bf42017-02-14 14:17:12 -08002867 public static final String BEARER = "bearer";
2868
2869 /**
2870 * Radio Access Technology bitmask.
2871 * To check what values can be contained, refer to {@link android.telephony.ServiceState}.
2872 * 0 indicates all techs otherwise first bit refers to RAT/bearer 1, second bit refers to
2873 * RAT/bearer 2 and so on.
2874 * Bitmask for a radio tech R is (1 << (R - 1))
2875 * <P>Type: INTEGER</P>
2876 * @hide
Cassiee1c88022018-02-22 08:51:03 -08002877 * @deprecated this column is no longer supported, use {@link #NETWORK_TYPE_BITMASK} instead
Dan Willemsen4980bf42017-02-14 14:17:12 -08002878 */
Cassied53df962017-12-05 13:34:33 -08002879 @Deprecated
Dan Willemsen4980bf42017-02-14 14:17:12 -08002880 public static final String BEARER_BITMASK = "bearer_bitmask";
2881
2882 /**
Cassied53df962017-12-05 13:34:33 -08002883 * Radio technology (network type) bitmask.
Cassiee1c88022018-02-22 08:51:03 -08002884 * To check what values can be contained, refer to the NETWORK_TYPE_ constants in
Cassied53df962017-12-05 13:34:33 -08002885 * {@link android.telephony.TelephonyManager}.
2886 * Bitmask for a radio tech R is (1 << (R - 1))
2887 * <P>Type: INTEGER</P>
2888 */
2889 public static final String NETWORK_TYPE_BITMASK = "network_type_bitmask";
2890
2891 /**
Dan Willemsen4980bf42017-02-14 14:17:12 -08002892 * MVNO type:
2893 * {@code SPN (Service Provider Name), IMSI, GID (Group Identifier Level 1)}.
2894 * <P>Type: TEXT</P>
calvinpan5e272372018-12-07 20:03:48 +08002895 * @deprecated Use {@link #SIM_APN_URI} to query APN instead, this API will return
2896 * matching APNs based on current subscription carrier, thus no need to specify MVNO_TYPE
2897 * and other carrier matching information. In the future, Android will not support MVNO_TYPE
2898 * for APN query.
Dan Willemsen4980bf42017-02-14 14:17:12 -08002899 */
2900 public static final String MVNO_TYPE = "mvno_type";
2901
2902 /**
2903 * MVNO data.
2904 * Use the following examples.
2905 * <ul>
2906 * <li>SPN: A MOBILE, BEN NL, ...</li>
2907 * <li>IMSI: 302720x94, 2060188, ...</li>
2908 * <li>GID: 4E, 33, ...</li>
2909 * </ul>
2910 * <P>Type: TEXT</P>
calvinpan5e272372018-12-07 20:03:48 +08002911 * @deprecated Use {@link #SIM_APN_URI} to query APN instead, this API will return
2912 * matching APNs based on current subscription carrier, thus no need to specify
2913 * MVNO_MATCH_DATA and other carrier matching information. In the future, Android will not
2914 * support MVNO_MATCH_DATA for APN query.
Dan Willemsen4980bf42017-02-14 14:17:12 -08002915 */
2916 public static final String MVNO_MATCH_DATA = "mvno_match_data";
2917
2918 /**
2919 * The subscription to which the APN belongs to
2920 * <p>Type: INTEGER (long) </p>
2921 */
2922 public static final String SUBSCRIPTION_ID = "sub_id";
2923
2924 /**
chen xu85100482018-10-12 15:30:34 -07002925 * The profile_id to which the APN saved in modem.
Dan Willemsen4980bf42017-02-14 14:17:12 -08002926 * <p>Type: INTEGER</p>
2927 *@hide
2928 */
2929 public static final String PROFILE_ID = "profile_id";
2930
2931 /**
chen xu85100482018-10-12 15:30:34 -07002932 * If set to {@code true}, then the APN setting will persist to the modem.
2933 * <p>Type: INTEGER (boolean)</p>
Dan Willemsen4980bf42017-02-14 14:17:12 -08002934 *@hide
2935 */
chen xu85100482018-10-12 15:30:34 -07002936 @SystemApi
chen xu7ebcd782018-11-28 00:21:50 -08002937 public static final String MODEM_PERSIST = "modem_cognitive";
Dan Willemsen4980bf42017-02-14 14:17:12 -08002938
2939 /**
chen xu7ebcd782018-11-28 00:21:50 -08002940 * The max number of connections of this APN.
Dan Willemsen4980bf42017-02-14 14:17:12 -08002941 * <p>Type: INTEGER</p>
2942 *@hide
2943 */
chen xu85100482018-10-12 15:30:34 -07002944 @SystemApi
chen xu7ebcd782018-11-28 00:21:50 -08002945 public static final String MAX_CONNECTIONS = "max_conns";
Dan Willemsen4980bf42017-02-14 14:17:12 -08002946
2947 /**
chen xu7ebcd782018-11-28 00:21:50 -08002948 * The wait time for retrying the APN, in milliseconds.
Dan Willemsen4980bf42017-02-14 14:17:12 -08002949 * <p>Type: INTEGER</p>
2950 *@hide
2951 */
chen xu85100482018-10-12 15:30:34 -07002952 @SystemApi
chen xu7ebcd782018-11-28 00:21:50 -08002953 public static final String WAIT_TIME_RETRY = "wait_time";
Dan Willemsen4980bf42017-02-14 14:17:12 -08002954
2955 /**
chen xu7ebcd782018-11-28 00:21:50 -08002956 * The max number of seconds this APN will support its maximum number of connections
2957 * as defined in {@link #MAX_CONNECTIONS}.
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 TIME_LIMIT_FOR_MAX_CONNECTIONS = "max_conns_time";
Dan Willemsen4980bf42017-02-14 14:17:12 -08002963
2964 /**
chen xu7ebcd782018-11-28 00:21:50 -08002965 * The MTU (maximum transmit unit) size of the mobile interface to which the APN is
2966 * connected, in bytes.
Dan Willemsen4980bf42017-02-14 14:17:12 -08002967 * <p>Type: INTEGER </p>
2968 * @hide
2969 */
chen xu85100482018-10-12 15:30:34 -07002970 @SystemApi
Dan Willemsen4980bf42017-02-14 14:17:12 -08002971 public static final String MTU = "mtu";
2972
2973 /**
chen xu85100482018-10-12 15:30:34 -07002974 * APN edit status. APN could be added/edited/deleted by a user or carrier.
chen xu7ebcd782018-11-28 00:21:50 -08002975 * see all possible returned APN edit status.
2976 * <ul>
2977 * <li>{@link #UNEDITED}</li>
2978 * <li>{@link #USER_EDITED}</li>
2979 * <li>{@link #USER_DELETED}</li>
2980 * <li>{@link #CARRIER_EDITED}</li>
2981 * <li>{@link #CARRIER_DELETED}</li>
2982 * </ul>
Dan Willemsen4980bf42017-02-14 14:17:12 -08002983 * <p>Type: INTEGER </p>
2984 * @hide
2985 */
chen xu85100482018-10-12 15:30:34 -07002986 @SystemApi
chen xu7ebcd782018-11-28 00:21:50 -08002987 public static final String EDITED_STATUS = "edited";
Dan Willemsen4980bf42017-02-14 14:17:12 -08002988
2989 /**
chen xu85100482018-10-12 15:30:34 -07002990 * {@code true} if this APN visible to the user, {@code false} otherwise.
2991 * <p>Type: INTEGER (boolean)</p>
Dan Willemsen4980bf42017-02-14 14:17:12 -08002992 * @hide
2993 */
chen xu85100482018-10-12 15:30:34 -07002994 @SystemApi
Dan Willemsen4980bf42017-02-14 14:17:12 -08002995 public static final String USER_VISIBLE = "user_visible";
2996
2997 /**
chen xu85100482018-10-12 15:30:34 -07002998 * {@code true} if the user allowed to edit this APN, {@code false} otherwise.
2999 * <p>Type: INTEGER (boolean)</p>
Amit Mahajand4977942017-07-17 14:46:39 -07003000 * @hide
3001 */
chen xu85100482018-10-12 15:30:34 -07003002 @SystemApi
Amit Mahajand4977942017-07-17 14:46:39 -07003003 public static final String USER_EDITABLE = "user_editable";
3004
3005 /**
chen xu7ebcd782018-11-28 00:21:50 -08003006 * {@link #EDITED_STATUS APN edit status} indicates that this APN has not been edited or
3007 * fails to edit.
chen xu85100482018-10-12 15:30:34 -07003008 * <p>Type: INTEGER </p>
Dan Willemsen4980bf42017-02-14 14:17:12 -08003009 * @hide
3010 */
chen xu85100482018-10-12 15:30:34 -07003011 @SystemApi
chen xu7ebcd782018-11-28 00:21:50 -08003012 public static final @EditStatus int UNEDITED = 0;
chen xu85100482018-10-12 15:30:34 -07003013
Dan Willemsen4980bf42017-02-14 14:17:12 -08003014 /**
chen xu7ebcd782018-11-28 00:21:50 -08003015 * {@link #EDITED_STATUS APN edit status} indicates that this APN has been edited by users.
chen xu85100482018-10-12 15:30:34 -07003016 * <p>Type: INTEGER </p>
3017 * @hide
Dan Willemsen4980bf42017-02-14 14:17:12 -08003018 */
chen xu85100482018-10-12 15:30:34 -07003019 @SystemApi
chen xu7ebcd782018-11-28 00:21:50 -08003020 public static final @EditStatus int USER_EDITED = 1;
chen xu85100482018-10-12 15:30:34 -07003021
Dan Willemsen4980bf42017-02-14 14:17:12 -08003022 /**
chen xu7ebcd782018-11-28 00:21:50 -08003023 * {@link #EDITED_STATUS APN edit status} indicates that this APN has been deleted by users.
chen xu85100482018-10-12 15:30:34 -07003024 * <p>Type: INTEGER </p>
3025 * @hide
Dan Willemsen4980bf42017-02-14 14:17:12 -08003026 */
chen xu85100482018-10-12 15:30:34 -07003027 @SystemApi
chen xu7ebcd782018-11-28 00:21:50 -08003028 public static final @EditStatus int USER_DELETED = 2;
chen xu85100482018-10-12 15:30:34 -07003029
Dan Willemsen4980bf42017-02-14 14:17:12 -08003030 /**
chen xu7ebcd782018-11-28 00:21:50 -08003031 * {@link #EDITED_STATUS APN edit status} is an intermediate value used to indicate that an
3032 * entry deleted by the user is still present in the new APN database and therefore must
3033 * remain tagged as user deleted rather than completely removed from the database.
Dan Willemsen4980bf42017-02-14 14:17:12 -08003034 * @hide
3035 */
3036 public static final int USER_DELETED_BUT_PRESENT_IN_XML = 3;
chen xu85100482018-10-12 15:30:34 -07003037
Dan Willemsen4980bf42017-02-14 14:17:12 -08003038 /**
chen xu7ebcd782018-11-28 00:21:50 -08003039 * {@link #EDITED_STATUS APN edit status} indicates that this APN has been edited by
3040 * carriers.
chen xu85100482018-10-12 15:30:34 -07003041 * <p>Type: INTEGER </p>
3042 * @hide
Dan Willemsen4980bf42017-02-14 14:17:12 -08003043 */
chen xu85100482018-10-12 15:30:34 -07003044 @SystemApi
chen xu7ebcd782018-11-28 00:21:50 -08003045 public static final @EditStatus int CARRIER_EDITED = 4;
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 deleted by
3049 * carriers. CARRIER_DELETED values are currently not used as there is no use case.
3050 * If they are used, delete() will have to change accordingly. Currently it is hardcoded to
3051 * USER_DELETED.
chen xu85100482018-10-12 15:30:34 -07003052 * <p>Type: INTEGER </p>
Dan Willemsen4980bf42017-02-14 14:17:12 -08003053 * @hide
3054 */
chen xu7ebcd782018-11-28 00:21:50 -08003055 public static final @EditStatus int CARRIER_DELETED = 5;
chen xu85100482018-10-12 15:30:34 -07003056
Dan Willemsen4980bf42017-02-14 14:17:12 -08003057 /**
chen xu7ebcd782018-11-28 00:21:50 -08003058 * {@link #EDITED_STATUS APN edit status} is an intermediate value used to indicate that an
3059 * entry deleted by the carrier is still present in the new APN database and therefore must
3060 * remain tagged as user deleted rather than completely removed from the database.
chen xu85100482018-10-12 15:30:34 -07003061 * @hide
Dan Willemsen4980bf42017-02-14 14:17:12 -08003062 */
3063 public static final int CARRIER_DELETED_BUT_PRESENT_IN_XML = 6;
yuemingwcf263eb2017-11-08 13:12:18 +00003064
3065 /**
3066 * The owner of the APN.
3067 * <p>Type: INTEGER</p>
3068 * @hide
3069 */
3070 public static final String OWNED_BY = "owned_by";
3071
3072 /**
3073 * Possible value for the OWNED_BY field.
3074 * APN is owned by DPC.
3075 * @hide
3076 */
3077 public static final int OWNED_BY_DPC = 0;
Jordan Liu40617152018-04-06 11:10:12 -07003078
yuemingwcf263eb2017-11-08 13:12:18 +00003079 /**
3080 * Possible value for the OWNED_BY field.
3081 * APN is owned by other sources.
3082 * @hide
3083 */
3084 public static final int OWNED_BY_OTHERS = 1;
Jordan Liu40617152018-04-06 11:10:12 -07003085
3086 /**
3087 * The APN set id. When the user manually selects an APN or the framework sets an APN as
3088 * preferred, all APNs with the same set id as the selected APN should be prioritized over
3089 * APNs in other sets.
chen xu85100482018-10-12 15:30:34 -07003090 * <p>Type: INTEGER</p>
Jordan Liu40617152018-04-06 11:10:12 -07003091 * @hide
3092 */
chen xu85100482018-10-12 15:30:34 -07003093 @SystemApi
Jordan Liu40617152018-04-06 11:10:12 -07003094 public static final String APN_SET_ID = "apn_set_id";
3095
3096 /**
chen xu7ebcd782018-11-28 00:21:50 -08003097 * Possible value for the {@link #APN_SET_ID} field. By default APNs will not belong to a
3098 * set. If the user manually selects an APN without apn set id, there is no need to
3099 * prioritize any specific APN set ids.
chen xu85100482018-10-12 15:30:34 -07003100 * <p>Type: INTEGER</p>
Jordan Liu40617152018-04-06 11:10:12 -07003101 * @hide
3102 */
chen xu85100482018-10-12 15:30:34 -07003103 @SystemApi
chen xu7ebcd782018-11-28 00:21:50 -08003104 public static final int NO_APN_SET_ID = 0;
Jordan Liu40617152018-04-06 11:10:12 -07003105
calvinpan3689c962018-10-19 15:11:22 +08003106 /**
3107 * A unique carrier id associated with this APN
3108 * {@see TelephonyManager#getSimCarrierId()}
3109 * <p>Type: STRING</p>
3110 */
3111 public static final String CARRIER_ID = "carrier_id";
3112
chen xu7ebcd782018-11-28 00:21:50 -08003113 /** @hide */
3114 @IntDef({
3115 UNEDITED,
3116 USER_EDITED,
3117 USER_DELETED,
3118 CARRIER_DELETED,
3119 CARRIER_EDITED,
3120 })
3121 @Retention(RetentionPolicy.SOURCE)
3122 public @interface EditStatus {}
Dan Willemsen4980bf42017-02-14 14:17:12 -08003123 }
3124
3125 /**
3126 * Contains received SMS cell broadcast messages.
3127 * @hide
3128 */
3129 public static final class CellBroadcasts implements BaseColumns {
3130
3131 /**
3132 * Not instantiable.
3133 * @hide
3134 */
3135 private CellBroadcasts() {}
3136
3137 /**
3138 * The {@code content://} URI for this table.
3139 */
3140 public static final Uri CONTENT_URI = Uri.parse("content://cellbroadcasts");
3141
3142 /**
3143 * Message geographical scope.
3144 * <P>Type: INTEGER</P>
3145 */
3146 public static final String GEOGRAPHICAL_SCOPE = "geo_scope";
3147
3148 /**
3149 * Message serial number.
3150 * <P>Type: INTEGER</P>
3151 */
3152 public static final String SERIAL_NUMBER = "serial_number";
3153
3154 /**
3155 * PLMN of broadcast sender. {@code SERIAL_NUMBER + PLMN + LAC + CID} uniquely identifies
3156 * a broadcast for duplicate detection purposes.
3157 * <P>Type: TEXT</P>
3158 */
3159 public static final String PLMN = "plmn";
3160
3161 /**
3162 * Location Area (GSM) or Service Area (UMTS) of broadcast sender. Unused for CDMA.
3163 * Only included if Geographical Scope of message is not PLMN wide (01).
3164 * <P>Type: INTEGER</P>
3165 */
3166 public static final String LAC = "lac";
3167
3168 /**
3169 * Cell ID of message sender (GSM/UMTS). Unused for CDMA. Only included when the
3170 * Geographical Scope of message is cell wide (00 or 11).
3171 * <P>Type: INTEGER</P>
3172 */
3173 public static final String CID = "cid";
3174
3175 /**
3176 * Message code. <em>OBSOLETE: merged into SERIAL_NUMBER.</em>
3177 * <P>Type: INTEGER</P>
3178 */
3179 public static final String V1_MESSAGE_CODE = "message_code";
3180
3181 /**
3182 * Message identifier. <em>OBSOLETE: renamed to SERVICE_CATEGORY.</em>
3183 * <P>Type: INTEGER</P>
3184 */
3185 public static final String V1_MESSAGE_IDENTIFIER = "message_id";
3186
3187 /**
3188 * Service category (GSM/UMTS: message identifier; CDMA: service category).
3189 * <P>Type: INTEGER</P>
3190 */
3191 public static final String SERVICE_CATEGORY = "service_category";
3192
3193 /**
3194 * Message language code.
3195 * <P>Type: TEXT</P>
3196 */
3197 public static final String LANGUAGE_CODE = "language";
3198
3199 /**
3200 * Message body.
3201 * <P>Type: TEXT</P>
3202 */
3203 public static final String MESSAGE_BODY = "body";
3204
3205 /**
3206 * Message delivery time.
3207 * <P>Type: INTEGER (long)</P>
3208 */
3209 public static final String DELIVERY_TIME = "date";
3210
3211 /**
3212 * Has the message been viewed?
3213 * <P>Type: INTEGER (boolean)</P>
3214 */
3215 public static final String MESSAGE_READ = "read";
3216
3217 /**
3218 * Message format (3GPP or 3GPP2).
3219 * <P>Type: INTEGER</P>
3220 */
3221 public static final String MESSAGE_FORMAT = "format";
3222
3223 /**
3224 * Message priority (including emergency).
3225 * <P>Type: INTEGER</P>
3226 */
3227 public static final String MESSAGE_PRIORITY = "priority";
3228
3229 /**
3230 * ETWS warning type (ETWS alerts only).
3231 * <P>Type: INTEGER</P>
3232 */
3233 public static final String ETWS_WARNING_TYPE = "etws_warning_type";
3234
3235 /**
3236 * CMAS message class (CMAS alerts only).
3237 * <P>Type: INTEGER</P>
3238 */
3239 public static final String CMAS_MESSAGE_CLASS = "cmas_message_class";
3240
3241 /**
3242 * CMAS category (CMAS alerts only).
3243 * <P>Type: INTEGER</P>
3244 */
3245 public static final String CMAS_CATEGORY = "cmas_category";
3246
3247 /**
3248 * CMAS response type (CMAS alerts only).
3249 * <P>Type: INTEGER</P>
3250 */
3251 public static final String CMAS_RESPONSE_TYPE = "cmas_response_type";
3252
3253 /**
3254 * CMAS severity (CMAS alerts only).
3255 * <P>Type: INTEGER</P>
3256 */
3257 public static final String CMAS_SEVERITY = "cmas_severity";
3258
3259 /**
3260 * CMAS urgency (CMAS alerts only).
3261 * <P>Type: INTEGER</P>
3262 */
3263 public static final String CMAS_URGENCY = "cmas_urgency";
3264
3265 /**
3266 * CMAS certainty (CMAS alerts only).
3267 * <P>Type: INTEGER</P>
3268 */
3269 public static final String CMAS_CERTAINTY = "cmas_certainty";
3270
3271 /** The default sort order for this table. */
3272 public static final String DEFAULT_SORT_ORDER = DELIVERY_TIME + " DESC";
3273
3274 /**
3275 * Query columns for instantiating {@link android.telephony.CellBroadcastMessage} objects.
3276 */
3277 public static final String[] QUERY_COLUMNS = {
3278 _ID,
3279 GEOGRAPHICAL_SCOPE,
3280 PLMN,
3281 LAC,
3282 CID,
3283 SERIAL_NUMBER,
3284 SERVICE_CATEGORY,
3285 LANGUAGE_CODE,
3286 MESSAGE_BODY,
3287 DELIVERY_TIME,
3288 MESSAGE_READ,
3289 MESSAGE_FORMAT,
3290 MESSAGE_PRIORITY,
3291 ETWS_WARNING_TYPE,
3292 CMAS_MESSAGE_CLASS,
3293 CMAS_CATEGORY,
3294 CMAS_RESPONSE_TYPE,
3295 CMAS_SEVERITY,
3296 CMAS_URGENCY,
3297 CMAS_CERTAINTY
3298 };
3299 }
Jordan Liub9b75ed2017-02-28 18:15:07 -08003300
3301 /**
3302 * Constants for interfacing with the ServiceStateProvider and the different fields of the
3303 * {@link ServiceState} class accessible through the provider.
3304 */
3305 public static final class ServiceStateTable {
3306
3307 /**
3308 * Not instantiable.
3309 * @hide
3310 */
3311 private ServiceStateTable() {}
3312
3313 /**
3314 * The authority string for the ServiceStateProvider
3315 */
3316 public static final String AUTHORITY = "service-state";
3317
3318 /**
3319 * The {@code content://} style URL for the ServiceStateProvider
3320 */
3321 public static final Uri CONTENT_URI = Uri.parse("content://service-state/");
3322
3323 /**
3324 * Generates a content {@link Uri} used to receive updates on a specific field in the
3325 * ServiceState provider.
3326 * <p>
3327 * Use this {@link Uri} with a {@link ContentObserver} to be notified of changes to the
3328 * {@link ServiceState} while your app is running. You can also use a {@link JobService} to
3329 * ensure your app is notified of changes to the {@link Uri} even when it is not running.
3330 * Note, however, that using a {@link JobService} does not guarantee timely delivery of
3331 * updates to the {@link Uri}.
3332 *
Jordan Liu0f332522017-04-19 14:25:29 -07003333 * @param subscriptionId the subscriptionId to receive updates on
Jordan Liub9b75ed2017-02-28 18:15:07 -08003334 * @param field the ServiceState field to receive updates on
3335 * @return the Uri used to observe {@link ServiceState} changes
3336 */
Jordan Liu0f332522017-04-19 14:25:29 -07003337 public static Uri getUriForSubscriptionIdAndField(int subscriptionId, String field) {
3338 return CONTENT_URI.buildUpon().appendEncodedPath(String.valueOf(subscriptionId))
Jordan Liub9b75ed2017-02-28 18:15:07 -08003339 .appendEncodedPath(field).build();
3340 }
3341
3342 /**
3343 * Generates a content {@link Uri} used to receive updates on every field in the
3344 * ServiceState provider.
3345 * <p>
3346 * Use this {@link Uri} with a {@link ContentObserver} to be notified of changes to the
3347 * {@link ServiceState} while your app is running. You can also use a {@link JobService} to
3348 * ensure your app is notified of changes to the {@link Uri} even when it is not running.
3349 * Note, however, that using a {@link JobService} does not guarantee timely delivery of
3350 * updates to the {@link Uri}.
3351 *
Jordan Liu0f332522017-04-19 14:25:29 -07003352 * @param subscriptionId the subscriptionId to receive updates on
Jordan Liub9b75ed2017-02-28 18:15:07 -08003353 * @return the Uri used to observe {@link ServiceState} changes
3354 */
Jordan Liu0f332522017-04-19 14:25:29 -07003355 public static Uri getUriForSubscriptionId(int subscriptionId) {
3356 return CONTENT_URI.buildUpon().appendEncodedPath(String.valueOf(subscriptionId)).build();
Jordan Liub9b75ed2017-02-28 18:15:07 -08003357 }
3358
3359 /**
3360 * Used to insert a ServiceState into the ServiceStateProvider as a ContentValues instance.
3361 *
3362 * @param state the ServiceState to convert into ContentValues
3363 * @return the convertedContentValues instance
3364 * @hide
3365 */
3366 public static ContentValues getContentValuesForServiceState(ServiceState state) {
3367 ContentValues values = new ContentValues();
3368 values.put(VOICE_REG_STATE, state.getVoiceRegState());
3369 values.put(DATA_REG_STATE, state.getDataRegState());
3370 values.put(VOICE_ROAMING_TYPE, state.getVoiceRoamingType());
3371 values.put(DATA_ROAMING_TYPE, state.getDataRoamingType());
3372 values.put(VOICE_OPERATOR_ALPHA_LONG, state.getVoiceOperatorAlphaLong());
3373 values.put(VOICE_OPERATOR_ALPHA_SHORT, state.getVoiceOperatorAlphaShort());
3374 values.put(VOICE_OPERATOR_NUMERIC, state.getVoiceOperatorNumeric());
3375 values.put(DATA_OPERATOR_ALPHA_LONG, state.getDataOperatorAlphaLong());
3376 values.put(DATA_OPERATOR_ALPHA_SHORT, state.getDataOperatorAlphaShort());
3377 values.put(DATA_OPERATOR_NUMERIC, state.getDataOperatorNumeric());
3378 values.put(IS_MANUAL_NETWORK_SELECTION, state.getIsManualSelection());
3379 values.put(RIL_VOICE_RADIO_TECHNOLOGY, state.getRilVoiceRadioTechnology());
3380 values.put(RIL_DATA_RADIO_TECHNOLOGY, state.getRilDataRadioTechnology());
3381 values.put(CSS_INDICATOR, state.getCssIndicator());
Jack Yu2661fac2018-03-15 13:51:05 -07003382 values.put(NETWORK_ID, state.getCdmaNetworkId());
3383 values.put(SYSTEM_ID, state.getCdmaSystemId());
Jordan Liub9b75ed2017-02-28 18:15:07 -08003384 values.put(CDMA_ROAMING_INDICATOR, state.getCdmaRoamingIndicator());
3385 values.put(CDMA_DEFAULT_ROAMING_INDICATOR, state.getCdmaDefaultRoamingIndicator());
3386 values.put(CDMA_ERI_ICON_INDEX, state.getCdmaEriIconIndex());
3387 values.put(CDMA_ERI_ICON_MODE, state.getCdmaEriIconMode());
3388 values.put(IS_EMERGENCY_ONLY, state.isEmergencyOnly());
Jordan Liub9b75ed2017-02-28 18:15:07 -08003389 values.put(IS_USING_CARRIER_AGGREGATION, state.isUsingCarrierAggregation());
3390 return values;
3391 }
3392
3393 /**
3394 * An integer value indicating the current voice service state.
3395 * <p>
3396 * Valid values: {@link ServiceState#STATE_IN_SERVICE},
3397 * {@link ServiceState#STATE_OUT_OF_SERVICE}, {@link ServiceState#STATE_EMERGENCY_ONLY},
3398 * {@link ServiceState#STATE_POWER_OFF}.
3399 * <p>
3400 * This is the same as {@link ServiceState#getState()}.
3401 */
3402 public static final String VOICE_REG_STATE = "voice_reg_state";
3403
3404 /**
3405 * An integer value indicating the current data service state.
3406 * <p>
3407 * Valid values: {@link ServiceState#STATE_IN_SERVICE},
3408 * {@link ServiceState#STATE_OUT_OF_SERVICE}, {@link ServiceState#STATE_EMERGENCY_ONLY},
3409 * {@link ServiceState#STATE_POWER_OFF}.
3410 * <p>
3411 * This is the same as {@link ServiceState#getDataRegState()}.
3412 * @hide
3413 */
3414 public static final String DATA_REG_STATE = "data_reg_state";
3415
3416 /**
3417 * An integer value indicating the current voice roaming type.
3418 * <p>
3419 * This is the same as {@link ServiceState#getVoiceRoamingType()}.
3420 * @hide
3421 */
3422 public static final String VOICE_ROAMING_TYPE = "voice_roaming_type";
3423
3424 /**
3425 * An integer value indicating the current data roaming type.
3426 * <p>
3427 * This is the same as {@link ServiceState#getDataRoamingType()}.
3428 * @hide
3429 */
3430 public static final String DATA_ROAMING_TYPE = "data_roaming_type";
3431
3432 /**
3433 * The current registered voice network operator name in long alphanumeric format.
3434 * <p>
3435 * This is the same as {@link ServiceState#getVoiceOperatorAlphaLong()}.
3436 * @hide
3437 */
3438 public static final String VOICE_OPERATOR_ALPHA_LONG = "voice_operator_alpha_long";
3439
3440 /**
3441 * The current registered operator name in short alphanumeric format.
3442 * <p>
3443 * In GSM/UMTS, short format can be up to 8 characters long. The current registered voice
3444 * network operator name in long alphanumeric format.
3445 * <p>
3446 * This is the same as {@link ServiceState#getVoiceOperatorAlphaShort()}.
3447 * @hide
3448 */
3449 public static final String VOICE_OPERATOR_ALPHA_SHORT = "voice_operator_alpha_short";
3450
3451
3452 /**
3453 * The current registered operator numeric id.
3454 * <p>
3455 * In GSM/UMTS, numeric format is 3 digit country code plus 2 or 3 digit
3456 * network code.
3457 * <p>
3458 * This is the same as {@link ServiceState#getOperatorNumeric()}.
3459 */
3460 public static final String VOICE_OPERATOR_NUMERIC = "voice_operator_numeric";
3461
3462 /**
3463 * The current registered data network operator name in long alphanumeric format.
3464 * <p>
3465 * This is the same as {@link ServiceState#getDataOperatorAlphaLong()}.
3466 * @hide
3467 */
3468 public static final String DATA_OPERATOR_ALPHA_LONG = "data_operator_alpha_long";
3469
3470 /**
3471 * The current registered data network operator name in short alphanumeric format.
3472 * <p>
3473 * This is the same as {@link ServiceState#getDataOperatorAlphaShort()}.
3474 * @hide
3475 */
3476 public static final String DATA_OPERATOR_ALPHA_SHORT = "data_operator_alpha_short";
3477
3478 /**
3479 * The current registered data network operator numeric id.
3480 * <p>
3481 * This is the same as {@link ServiceState#getDataOperatorNumeric()}.
3482 * @hide
3483 */
3484 public static final String DATA_OPERATOR_NUMERIC = "data_operator_numeric";
3485
3486 /**
3487 * The current network selection mode.
3488 * <p>
3489 * This is the same as {@link ServiceState#getIsManualSelection()}.
3490 */
3491 public static final String IS_MANUAL_NETWORK_SELECTION = "is_manual_network_selection";
3492
3493 /**
3494 * This is the same as {@link ServiceState#getRilVoiceRadioTechnology()}.
3495 * @hide
3496 */
3497 public static final String RIL_VOICE_RADIO_TECHNOLOGY = "ril_voice_radio_technology";
3498
3499 /**
3500 * This is the same as {@link ServiceState#getRilDataRadioTechnology()}.
3501 * @hide
3502 */
3503 public static final String RIL_DATA_RADIO_TECHNOLOGY = "ril_data_radio_technology";
3504
3505 /**
3506 * This is the same as {@link ServiceState#getCssIndicator()}.
3507 * @hide
3508 */
3509 public static final String CSS_INDICATOR = "css_indicator";
3510
3511 /**
Jack Yu2661fac2018-03-15 13:51:05 -07003512 * This is the same as {@link ServiceState#getCdmaNetworkId()}.
Jordan Liub9b75ed2017-02-28 18:15:07 -08003513 * @hide
3514 */
3515 public static final String NETWORK_ID = "network_id";
3516
3517 /**
Jack Yu2661fac2018-03-15 13:51:05 -07003518 * This is the same as {@link ServiceState#getCdmaSystemId()}.
Jordan Liub9b75ed2017-02-28 18:15:07 -08003519 * @hide
3520 */
3521 public static final String SYSTEM_ID = "system_id";
3522
3523 /**
3524 * This is the same as {@link ServiceState#getCdmaRoamingIndicator()}.
3525 * @hide
3526 */
3527 public static final String CDMA_ROAMING_INDICATOR = "cdma_roaming_indicator";
3528
3529 /**
3530 * This is the same as {@link ServiceState#getCdmaDefaultRoamingIndicator()}.
3531 * @hide
3532 */
3533 public static final String CDMA_DEFAULT_ROAMING_INDICATOR =
3534 "cdma_default_roaming_indicator";
3535
3536 /**
3537 * This is the same as {@link ServiceState#getCdmaEriIconIndex()}.
3538 * @hide
3539 */
3540 public static final String CDMA_ERI_ICON_INDEX = "cdma_eri_icon_index";
3541
3542 /**
3543 * This is the same as {@link ServiceState#getCdmaEriIconMode()}.
3544 * @hide
3545 */
3546 public static final String CDMA_ERI_ICON_MODE = "cdma_eri_icon_mode";
3547
3548 /**
3549 * This is the same as {@link ServiceState#isEmergencyOnly()}.
3550 * @hide
3551 */
3552 public static final String IS_EMERGENCY_ONLY = "is_emergency_only";
3553
3554 /**
3555 * This is the same as {@link ServiceState#getDataRoamingFromRegistration()}.
3556 * @hide
3557 */
3558 public static final String IS_DATA_ROAMING_FROM_REGISTRATION =
3559 "is_data_roaming_from_registration";
3560
3561 /**
3562 * This is the same as {@link ServiceState#isUsingCarrierAggregation()}.
3563 * @hide
3564 */
3565 public static final String IS_USING_CARRIER_AGGREGATION = "is_using_carrier_aggregation";
3566 }
fionaxu3d0ad1f2017-10-25 23:09:36 -07003567
3568 /**
fionaxu58278be2018-01-29 14:08:12 -08003569 * Contains carrier identification information for the current subscriptions.
3570 * @see SubscriptionManager#getActiveSubscriptionIdList()
fionaxu3d0ad1f2017-10-25 23:09:36 -07003571 */
fionaxu62bc7472018-02-28 11:18:45 -08003572 public static final class CarrierId implements BaseColumns {
fionaxu3d0ad1f2017-10-25 23:09:36 -07003573 /**
fionaxu58278be2018-01-29 14:08:12 -08003574 * Not instantiable.
3575 * @hide
fionaxu3d0ad1f2017-10-25 23:09:36 -07003576 */
fionaxu62bc7472018-02-28 11:18:45 -08003577 private CarrierId() {}
fionaxu3d0ad1f2017-10-25 23:09:36 -07003578
3579 /**
fionaxu58278be2018-01-29 14:08:12 -08003580 * The {@code content://} style URI for this provider.
fionaxu3d0ad1f2017-10-25 23:09:36 -07003581 */
fionaxu62bc7472018-02-28 11:18:45 -08003582 public static final Uri CONTENT_URI = Uri.parse("content://carrier_id");
fionaxu3d0ad1f2017-10-25 23:09:36 -07003583
3584 /**
fionaxu62bc7472018-02-28 11:18:45 -08003585 * The authority string for the CarrierId Provider
fionaxu58278be2018-01-29 14:08:12 -08003586 * @hide
fionaxu3d0ad1f2017-10-25 23:09:36 -07003587 */
fionaxu62bc7472018-02-28 11:18:45 -08003588 public static final String AUTHORITY = "carrier_id";
fionaxu58278be2018-01-29 14:08:12 -08003589
fionaxu3d0ad1f2017-10-25 23:09:36 -07003590
3591 /**
fionaxu58278be2018-01-29 14:08:12 -08003592 * Generates a content {@link Uri} used to receive updates on carrier identity change
3593 * on the given subscriptionId
3594 * <p>
3595 * Use this {@link Uri} with a {@link ContentObserver} to be notified of changes to the
fionaxuc8d483e2018-03-07 21:52:05 -08003596 * carrier identity {@link TelephonyManager#getSimCarrierId()}
fionaxu58278be2018-01-29 14:08:12 -08003597 * while your app is running. You can also use a {@link JobService} to ensure your app
3598 * is notified of changes to the {@link Uri} even when it is not running.
3599 * Note, however, that using a {@link JobService} does not guarantee timely delivery of
3600 * updates to the {@link Uri}.
3601 *
3602 * @param subscriptionId the subscriptionId to receive updates on
3603 * @return the Uri used to observe carrier identity changes
fionaxu3d0ad1f2017-10-25 23:09:36 -07003604 */
fionaxu58278be2018-01-29 14:08:12 -08003605 public static Uri getUriForSubscriptionId(int subscriptionId) {
3606 return CONTENT_URI.buildUpon().appendEncodedPath(
3607 String.valueOf(subscriptionId)).build();
3608 }
fionaxu3d0ad1f2017-10-25 23:09:36 -07003609
3610 /**
chen xua8d3d482018-11-02 17:49:57 -07003611 * Generates a content {@link Uri} used to receive updates on precise carrier identity
chen xu64c1d7642018-12-06 15:34:05 -08003612 * change on the given subscriptionId returned by
3613 * {@link TelephonyManager#getSimPreciseCarrierId()}.
3614 * @see TelephonyManager#ACTION_SUBSCRIPTION_PRECISE_CARRIER_IDENTITY_CHANGED
chen xua8d3d482018-11-02 17:49:57 -07003615 * <p>
3616 * Use this {@link Uri} with a {@link ContentObserver} to be notified of changes to the
3617 * precise carrier identity {@link TelephonyManager#getSimPreciseCarrierId()}
3618 * while your app is running. You can also use a {@link JobService} to ensure your app
3619 * is notified of changes to the {@link Uri} even when it is not running.
3620 * Note, however, that using a {@link JobService} does not guarantee timely delivery of
3621 * updates to the {@link Uri}.
3622 *
3623 * @param subscriptionId the subscriptionId to receive updates on
3624 * @return the Uri used to observe precise carrier identity changes
chen xua8d3d482018-11-02 17:49:57 -07003625 */
3626 public static Uri getPreciseCarrierIdUriForSubscriptionId(int subscriptionId) {
3627 return Uri.withAppendedPath(Uri.withAppendedPath(CONTENT_URI, "precise"),
3628 String.valueOf(subscriptionId));
3629 }
3630
3631 /**
fionaxu58278be2018-01-29 14:08:12 -08003632 * A user facing carrier name.
fionaxuc8d483e2018-03-07 21:52:05 -08003633 * @see TelephonyManager#getSimCarrierIdName()
fionaxu3d0ad1f2017-10-25 23:09:36 -07003634 * <P>Type: TEXT </P>
3635 */
fionaxu62bc7472018-02-28 11:18:45 -08003636 public static final String CARRIER_NAME = "carrier_name";
fionaxu3d0ad1f2017-10-25 23:09:36 -07003637
3638 /**
3639 * A unique carrier id
fionaxuc8d483e2018-03-07 21:52:05 -08003640 * @see TelephonyManager#getSimCarrierId()
fionaxu3d0ad1f2017-10-25 23:09:36 -07003641 * <P>Type: INTEGER </P>
3642 */
fionaxu62bc7472018-02-28 11:18:45 -08003643 public static final String CARRIER_ID = "carrier_id";
fionaxu3d0ad1f2017-10-25 23:09:36 -07003644
3645 /**
chen xua8d3d482018-11-02 17:49:57 -07003646 * A fine-grained carrier id.
3647 * @see TelephonyManager#getSimPreciseCarrierId()
3648 * This is not a database column, only used to notify content observers for
3649 * {@link #getPreciseCarrierIdUriForSubscriptionId(int)}
chen xua8d3d482018-11-02 17:49:57 -07003650 */
3651 public static final String PRECISE_CARRIER_ID = "precise_carrier_id";
3652
3653 /**
chen xu64c1d7642018-12-06 15:34:05 -08003654 * A user facing carrier name for precise carrier id {@link #PRECISE_CARRIER_ID}.
3655 * @see TelephonyManager#getSimPreciseCarrierIdName()
3656 * This is not a database column, only used to notify content observers for
3657 * {@link #getPreciseCarrierIdUriForSubscriptionId(int)}
3658 */
3659 public static final String PRECISE_CARRIER_ID_NAME = "precise_carrier_id_name";
3660
3661 /**
chen xua8d3d482018-11-02 17:49:57 -07003662 * A unique parent carrier id. The parent-child
3663 * relationship can be used to further differentiate a single carrier by different networks,
3664 * by prepaid v.s. postpaid or even by 4G v.s. 3G plan. It's an optional field.
3665 * A carrier id with a valid parent_carrier_id is considered fine-grained carrier id, will
3666 * not be returned as {@link #CARRIER_ID} but {@link #PRECISE_CARRIER_ID}.
3667 * <P>Type: INTEGER </P>
3668 * @hide
3669 */
3670 public static final String PARENT_CARRIER_ID = "parent_carrier_id";
3671
3672 /**
fionaxu58278be2018-01-29 14:08:12 -08003673 * Contains mappings between matching rules with carrier id for all carriers.
3674 * @hide
fionaxu3d0ad1f2017-10-25 23:09:36 -07003675 */
fionaxu58278be2018-01-29 14:08:12 -08003676 public static final class All implements BaseColumns {
3677 /**
3678 * Numeric operator ID (as String). {@code MCC + MNC}
3679 * <P>Type: TEXT </P>
3680 */
3681 public static final String MCCMNC = "mccmnc";
3682
3683 /**
3684 * Group id level 1 (as String).
3685 * <P>Type: TEXT </P>
3686 */
3687 public static final String GID1 = "gid1";
3688
3689 /**
3690 * Group id level 2 (as String).
3691 * <P>Type: TEXT </P>
3692 */
3693 public static final String GID2 = "gid2";
3694
3695 /**
3696 * Public Land Mobile Network name.
3697 * <P>Type: TEXT </P>
3698 */
3699 public static final String PLMN = "plmn";
3700
3701 /**
3702 * Prefix xpattern of IMSI (International Mobile Subscriber Identity).
3703 * <P>Type: TEXT </P>
3704 */
3705 public static final String IMSI_PREFIX_XPATTERN = "imsi_prefix_xpattern";
3706
3707 /**
3708 * Service Provider Name.
3709 * <P>Type: TEXT </P>
3710 */
3711 public static final String SPN = "spn";
3712
3713 /**
3714 * Prefer APN name.
3715 * <P>Type: TEXT </P>
3716 */
3717 public static final String APN = "apn";
3718
3719 /**
3720 * Prefix of Integrated Circuit Card Identifier.
3721 * <P>Type: TEXT </P>
3722 */
3723 public static final String ICCID_PREFIX = "iccid_prefix";
3724
3725 /**
fionaxue9c6da72018-06-08 16:55:25 -07003726 * Certificate for carrier privilege access rules.
3727 * <P>Type: TEXT in hex string </P>
3728 */
3729 public static final String PRIVILEGE_ACCESS_RULE = "privilege_access_rule";
3730
3731 /**
fionaxu58278be2018-01-29 14:08:12 -08003732 * The {@code content://} URI for this table.
3733 */
fionaxu62bc7472018-02-28 11:18:45 -08003734 public static final Uri CONTENT_URI = Uri.parse("content://carrier_id/all");
fionaxu58278be2018-01-29 14:08:12 -08003735 }
fionaxu3d0ad1f2017-10-25 23:09:36 -07003736 }
Dan Willemsen4980bf42017-02-14 14:17:12 -08003737}