Intent.java revision a53ee35754d22e58978c9fd81396e599e00bac18
15f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer/* 25f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * Copyright (C) 2006 The Android Open Source Project 35f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * 45f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * Licensed under the Apache License, Version 2.0 (the "License"); 50bc735ffcfb223c0186419547abaa5c84482663eChris Lattner * you may not use this file except in compliance with the License. 60bc735ffcfb223c0186419547abaa5c84482663eChris Lattner * You may obtain a copy of the License at 75f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * 85f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * http://www.apache.org/licenses/LICENSE-2.0 95f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * 105f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * Unless required by applicable law or agreed to in writing, software 115f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * distributed under the License is distributed on an "AS IS" BASIS, 125f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 135f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * See the License for the specific language governing permissions and 145f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * limitations under the License. 1549aa7ff1245abd03e6e998e01302df31e4c6f8f6Argyrios Kyrtzidis */ 16980e508ca70d6de75d2abfd96b4681fc98bb2698Steve Naroff 17aaba5e346dffdbad5d1c42765a89e4a7afb0da67Douglas Gregorpackage android.content; 18e91593ef084479340582b2ba177b44be50a717b7Daniel Dunbar 192cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregorimport org.xmlpull.v1.XmlPullParser; 2019cc4abea06a9b49e0e16a50d335c064cd723572Anders Carlssonimport org.xmlpull.v1.XmlPullParserException; 211b63e4f732dbc73d90abf886b4d21f8e3a165f6dChris Lattner 22a9376d470ccb0eac74fe09a6b2a18a890f1d17c4Chris Lattnerimport android.annotation.SdkConstant; 235f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencerimport android.annotation.SdkConstant.SdkConstantType; 2485f9bceab1542aafff012d4d28e998f4ba16e362Anders Carlssonimport android.content.pm.ActivityInfo; 256fe7c8aa8c7546743ecd0ac0138c2cf5d8155386Nate Begemanimport android.content.pm.PackageManager; 26557c5b1717bc8919b1b40cf2064b51491ec53a44Chris Lattnerimport android.content.pm.ResolveInfo; 2729445a0542d128cd7ee587ee52229670b9b54a12Anders Carlssonimport android.content.res.Resources; 2829445a0542d128cd7ee587ee52229670b9b54a12Anders Carlssonimport android.content.res.TypedArray; 295f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencerimport android.graphics.Rect; 305f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencerimport android.net.Uri; 315f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencerimport android.os.Bundle; 325f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencerimport android.os.IBinder; 335f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencerimport android.os.Parcel; 345f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencerimport android.os.Parcelable; 3561710854be2b098428aff5316e64bd34b30fbcb7Chris Lattnerimport android.util.AttributeSet; 3661710854be2b098428aff5316e64bd34b30fbcb7Chris Lattnerimport android.util.Log; 37e91593ef084479340582b2ba177b44be50a717b7Daniel Dunbar 381b63e4f732dbc73d90abf886b4d21f8e3a165f6dChris Lattnerimport com.android.internal.util.XmlUtils; 391b63e4f732dbc73d90abf886b4d21f8e3a165f6dChris Lattner 40ab452ba8323d1985e08bade2bced588cddf2cc28Douglas Gregorimport java.io.IOException; 41782fa308a765aeac2acb39c4e697c937ec21185bMike Stumpimport java.io.Serializable; 42782fa308a765aeac2acb39c4e697c937ec21185bMike Stumpimport java.net.URISyntaxException; 432e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregorimport java.util.ArrayList; 442e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregorimport java.util.HashSet; 45e4f2142d00fa5fdb580c4e2413da91882d955381Chris Lattnerimport java.util.Iterator; 46e91593ef084479340582b2ba177b44be50a717b7Daniel Dunbarimport java.util.Locale; 47e91593ef084479340582b2ba177b44be50a717b7Daniel Dunbarimport java.util.Set; 4814108da7f7fc059772711e4ffee1322a27b152a7Steve Naroff 49e91593ef084479340582b2ba177b44be50a717b7Daniel Dunbar/** 50e91593ef084479340582b2ba177b44be50a717b7Daniel Dunbar * An intent is an abstract description of an operation to be performed. It 515f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * can be used with {@link Context#startActivity(Intent) startActivity} to 525f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * launch an {@link android.app.Activity}, 535f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * {@link android.content.Context#sendBroadcast(Intent) broadcastIntent} to 544b05b1dee6cc65ae61d93dab7edff72710f24589Ted Kremenek * send it to any interested {@link BroadcastReceiver BroadcastReceiver} components, 555f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * and {@link android.content.Context#startService} or 565f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * {@link android.content.Context#bindService} to communicate with a 57b26153c2b06934b6d39886cae2a379988d9c3e2bEli Friedman * background {@link android.app.Service}. 58b74668edbc119880eb0a7e563432314432cb775dNuno Lopes * 59b74668edbc119880eb0a7e563432314432cb775dNuno Lopes * <p>An Intent provides a facility for performing late runtime binding between the code in 60b74668edbc119880eb0a7e563432314432cb775dNuno Lopes * different applications. Its most significant use is in the launching of activities, where it 61b74668edbc119880eb0a7e563432314432cb775dNuno Lopes * can be thought of as the glue between activities. It is basically a passive data structure 62b74668edbc119880eb0a7e563432314432cb775dNuno Lopes * holding an abstract description of an action to be performed.</p> 63b74668edbc119880eb0a7e563432314432cb775dNuno Lopes * 64b74668edbc119880eb0a7e563432314432cb775dNuno Lopes * <div class="special reference"> 65b74668edbc119880eb0a7e563432314432cb775dNuno Lopes * <h3>Developer Guides</h3> 66b74668edbc119880eb0a7e563432314432cb775dNuno Lopes * <p>For information about how to create and resolve intents, read the 67b74668edbc119880eb0a7e563432314432cb775dNuno Lopes * <a href="{@docRoot}guide/topics/intents/intents-filters.html">Intents and Intent Filters</a> 68b2dbbb99e12806eaaf53b7ccabc32f42b5719443Daniel Dunbar * developer guide.</p> 69b2dbbb99e12806eaaf53b7ccabc32f42b5719443Daniel Dunbar * </div> 70b74668edbc119880eb0a7e563432314432cb775dNuno Lopes * 71b74668edbc119880eb0a7e563432314432cb775dNuno Lopes * <a name="IntentStructure"></a> 72b74668edbc119880eb0a7e563432314432cb775dNuno Lopes * <h3>Intent Structure</h3> 73b74668edbc119880eb0a7e563432314432cb775dNuno Lopes * <p>The primary pieces of information in an intent are:</p> 74b74668edbc119880eb0a7e563432314432cb775dNuno Lopes * 75b74668edbc119880eb0a7e563432314432cb775dNuno Lopes * <ul> 76ab452ba8323d1985e08bade2bced588cddf2cc28Douglas Gregor * <li> <p><b>action</b> -- The general action to be performed, such as 771ae0afaf14b7ce9bed33c1fe51077d01a313434dDouglas Gregor * {@link #ACTION_VIEW}, {@link #ACTION_EDIT}, {@link #ACTION_MAIN}, 781ae0afaf14b7ce9bed33c1fe51077d01a313434dDouglas Gregor * etc.</p> 791ae0afaf14b7ce9bed33c1fe51077d01a313434dDouglas Gregor * </li> 80e7dcd782df0e1cc3a63e429a866098e69db39153Douglas Gregor * <li> <p><b>data</b> -- The data to operate on, such as a person record 811ae0afaf14b7ce9bed33c1fe51077d01a313434dDouglas Gregor * in the contacts database, expressed as a {@link android.net.Uri}.</p> 821ae0afaf14b7ce9bed33c1fe51077d01a313434dDouglas Gregor * </li> 83ab452ba8323d1985e08bade2bced588cddf2cc28Douglas Gregor * </ul> 84ab452ba8323d1985e08bade2bced588cddf2cc28Douglas Gregor * 85ab452ba8323d1985e08bade2bced588cddf2cc28Douglas Gregor * 86ab452ba8323d1985e08bade2bced588cddf2cc28Douglas Gregor * <p>Some examples of action/data pairs are:</p> 87b26153c2b06934b6d39886cae2a379988d9c3e2bEli Friedman * 885f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * <ul> 895f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * <li> <p><b>{@link #ACTION_VIEW} <i>content://contacts/people/1</i></b> -- Display 902cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * information about the person whose identifier is "1".</p> 912cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * </li> 922cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * <li> <p><b>{@link #ACTION_DIAL} <i>content://contacts/people/1</i></b> -- Display 932cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * the phone dialer with the person filled in.</p> 942cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * </li> 955f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * <li> <p><b>{@link #ACTION_VIEW} <i>tel:123</i></b> -- Display 965f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * the phone dialer with the given number filled in. Note how the 975f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * VIEW action does what what is considered the most reasonable thing for 987c80bd64032e610c0dbd74fc0ef6ea334447f2fdSebastian Redl * a particular URI.</p> 99dbe833da54e1b6192991b64fc453cd50b5ee7909Douglas Gregor * </li> 100dbe833da54e1b6192991b64fc453cd50b5ee7909Douglas Gregor * <li> <p><b>{@link #ACTION_DIAL} <i>tel:123</i></b> -- Display 101dbe833da54e1b6192991b64fc453cd50b5ee7909Douglas Gregor * the phone dialer with the given number filled in.</p> 102dbe833da54e1b6192991b64fc453cd50b5ee7909Douglas Gregor * </li> 103dbe833da54e1b6192991b64fc453cd50b5ee7909Douglas Gregor * <li> <p><b>{@link #ACTION_EDIT} <i>content://contacts/people/1</i></b> -- Edit 104dbe833da54e1b6192991b64fc453cd50b5ee7909Douglas Gregor * information about the person whose identifier is "1".</p> 105c2ee10d79f70036af652a395ac1f8273f3d04e12Douglas Gregor * </li> 1065f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * <li> <p><b>{@link #ACTION_VIEW} <i>content://contacts/people/</i></b> -- Display 1075f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * a list of people, which the user can browse through. This example is a 108dbe833da54e1b6192991b64fc453cd50b5ee7909Douglas Gregor * typical top-level entry into the Contacts application, showing you the 1095f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * list of people. Selecting a particular person to view would result in a 1105f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * new intent { <b>{@link #ACTION_VIEW} <i>content://contacts/N</i></b> } 111dbe833da54e1b6192991b64fc453cd50b5ee7909Douglas Gregor * being used to start an activity to display that person.</p> 112dbe833da54e1b6192991b64fc453cd50b5ee7909Douglas Gregor * </li> 113dbe833da54e1b6192991b64fc453cd50b5ee7909Douglas Gregor * </ul> 114dbe833da54e1b6192991b64fc453cd50b5ee7909Douglas Gregor * 115dbe833da54e1b6192991b64fc453cd50b5ee7909Douglas Gregor * <p>In addition to these primary attributes, there are a number of secondary 116dbe833da54e1b6192991b64fc453cd50b5ee7909Douglas Gregor * attributes that you can also include with an intent:</p> 117dbe833da54e1b6192991b64fc453cd50b5ee7909Douglas Gregor * 118dbe833da54e1b6192991b64fc453cd50b5ee7909Douglas Gregor * <ul> 119dbe833da54e1b6192991b64fc453cd50b5ee7909Douglas Gregor * <li> <p><b>category</b> -- Gives additional information about the action 120dbe833da54e1b6192991b64fc453cd50b5ee7909Douglas Gregor * to execute. For example, {@link #CATEGORY_LAUNCHER} means it should 121dbe833da54e1b6192991b64fc453cd50b5ee7909Douglas Gregor * appear in the Launcher as a top-level application, while 1222cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * {@link #CATEGORY_ALTERNATIVE} means it should be included in a list 1232cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * of alternative actions the user can perform on a piece of data.</p> 1242cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * <li> <p><b>type</b> -- Specifies an explicit type (a MIME type) of the 1252cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * intent data. Normally the type is inferred from the data itself. 1262cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * By setting this attribute, you disable that evaluation and force 1275f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * an explicit type.</p> 1285f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * <li> <p><b>component</b> -- Specifies an explicit name of a component 1295f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * class to use for the intent. Normally this is determined by looking 1305f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * at the other information in the intent (the action, data/type, and 131f83820bd7a0dc4c253071b31c443a316a49ce5aaSteve Naroff * categories) and matching that with a component that can handle it. 1325f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * If this attribute is set then none of the evaluation is performed, 1335f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * and this component is used exactly as is. By specifying this attribute, 1345f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * all of the other Intent attributes become optional.</p> 1355f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * <li> <p><b>extras</b> -- This is a {@link Bundle} of any additional information. 1365f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * This can be used to provide extended information to the component. 1375f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * For example, if we have a action to send an e-mail message, we could 1385f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * also include extra pieces of data here to supply a subject, body, 1395f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * etc.</p> 1405f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * </ul> 1415f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * 1425f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * <p>Here are some examples of other operations you can specify as intents 14315b91764d08e886391c865c4a444d7b51141c284Eli Friedman * using these additional parameters:</p> 1445f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * 1455f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * <ul> 1465f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * <li> <p><b>{@link #ACTION_MAIN} with category {@link #CATEGORY_HOME}</b> -- 1475f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * Launch the home screen.</p> 1485f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * </li> 1495f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * <li> <p><b>{@link #ACTION_GET_CONTENT} with MIME type 1505f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * <i>{@link android.provider.Contacts.Phones#CONTENT_URI 1515f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * vnd.android.cursor.item/phone}</i></b> 1525f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * -- Display the list of people's phone numbers, allowing the user to 1535f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * browse through them and pick one and return it to the parent activity.</p> 1545f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * </li> 1555f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * <li> <p><b>{@link #ACTION_GET_CONTENT} with MIME type 1565f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * <i>*{@literal /}*</i> and category {@link #CATEGORY_OPENABLE}</b> 1575f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * -- Display all pickers for data that can be opened with 1585f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * {@link ContentResolver#openInputStream(Uri) ContentResolver.openInputStream()}, 1595f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * allowing the user to pick one of them and then some data inside of it 1605f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * and returning the resulting URI to the caller. This can be used, 1615f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * for example, in an e-mail application to allow the user to pick some 1625f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * data to include as an attachment.</p> 1635f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * </li> 1645f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * </ul> 16564c438a4be2a871fa43c78264663ba1e9788b94dArgyrios Kyrtzidis * 1662df9ced9fd1e8c7d7b38443db07e0e811de22571Chris Lattner * <p>There are a variety of standard Intent action and category constants 1672df9ced9fd1e8c7d7b38443db07e0e811de22571Chris Lattner * defined in the Intent class, but applications can also define their own. 1682df9ced9fd1e8c7d7b38443db07e0e811de22571Chris Lattner * These strings use java style scoping, to ensure they are unique -- for 1692df9ced9fd1e8c7d7b38443db07e0e811de22571Chris Lattner * example, the standard {@link #ACTION_VIEW} is called 1703a2503227c3db04a3619735127483263c1075ef7Chris Lattner * "android.intent.action.VIEW".</p> 1713a2503227c3db04a3619735127483263c1075ef7Chris Lattner * 1723a2503227c3db04a3619735127483263c1075ef7Chris Lattner * <p>Put together, the set of actions, data types, categories, and extra data 1733a2503227c3db04a3619735127483263c1075ef7Chris Lattner * defines a language for the system allowing for the expression of phrases 17464c438a4be2a871fa43c78264663ba1e9788b94dArgyrios Kyrtzidis * such as "call john smith's cell". As applications are added to the system, 175f5c209d23b20ada4a9b6235db50317239cbf6ae1Alisdair Meredith * they can extend this language by adding new actions, types, and categories, or 176f5c209d23b20ada4a9b6235db50317239cbf6ae1Alisdair Meredith * they can modify the behavior of existing phrases by supplying their own 177f5c209d23b20ada4a9b6235db50317239cbf6ae1Alisdair Meredith * activities that handle them.</p> 178f5c209d23b20ada4a9b6235db50317239cbf6ae1Alisdair Meredith * 179f5c209d23b20ada4a9b6235db50317239cbf6ae1Alisdair Meredith * <a name="IntentResolution"></a> 180f5c209d23b20ada4a9b6235db50317239cbf6ae1Alisdair Meredith * <h3>Intent Resolution</h3> 181f5c209d23b20ada4a9b6235db50317239cbf6ae1Alisdair Meredith * 182f5c209d23b20ada4a9b6235db50317239cbf6ae1Alisdair Meredith * <p>There are two primary forms of intents you will use. 183f5c209d23b20ada4a9b6235db50317239cbf6ae1Alisdair Meredith * 184f5c209d23b20ada4a9b6235db50317239cbf6ae1Alisdair Meredith * <ul> 1858e9bebdea69c590dedfbf27374114cb76fe12fbdDouglas Gregor * <li> <p><b>Explicit Intents</b> have specified a component (via 186898574e7496ba8fd76290079d3a9d06954992734Douglas Gregor * {@link #setComponent} or {@link #setClass}), which provides the exact 187898574e7496ba8fd76290079d3a9d06954992734Douglas Gregor * class to be run. Often these will not include any other information, 188898574e7496ba8fd76290079d3a9d06954992734Douglas Gregor * simply being a way for an application to launch various internal 189898574e7496ba8fd76290079d3a9d06954992734Douglas Gregor * activities it has as the user interacts with the application. 190898574e7496ba8fd76290079d3a9d06954992734Douglas Gregor * 191898574e7496ba8fd76290079d3a9d06954992734Douglas Gregor * <li> <p><b>Implicit Intents</b> have not specified a component; 192898574e7496ba8fd76290079d3a9d06954992734Douglas Gregor * instead, they must include enough information for the system to 193898574e7496ba8fd76290079d3a9d06954992734Douglas Gregor * determine which of the available components is best to run for that 1948e9bebdea69c590dedfbf27374114cb76fe12fbdDouglas Gregor * intent. 195e89d15944dd3be750a09805ad21222d2fa9321faAnders Carlsson * </ul> 196e89d15944dd3be750a09805ad21222d2fa9321faAnders Carlsson * 197e89d15944dd3be750a09805ad21222d2fa9321faAnders Carlsson * <p>When using implicit intents, given such an arbitrary intent we need to 198e89d15944dd3be750a09805ad21222d2fa9321faAnders Carlsson * know what to do with it. This is handled by the process of <em>Intent 1995f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * resolution</em>, which maps an Intent to an {@link android.app.Activity}, 2005f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * {@link BroadcastReceiver}, or {@link android.app.Service} (or sometimes two or 2015f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * more activities/receivers) that can handle it.</p> 2025f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * 2038e9bebdea69c590dedfbf27374114cb76fe12fbdDouglas Gregor * <p>The intent resolution mechanism basically revolves around matching an 2047e219e47de26346885d667131977bd9ca2d7662aSteve Naroff * Intent against all of the <intent-filter> descriptions in the 20514108da7f7fc059772711e4ffee1322a27b152a7Steve Naroff * installed application packages. (Plus, in the case of broadcasts, any {@link BroadcastReceiver} 206de2e22d33afec98324a66a358dfe0951b3c7259aSteve Naroff * objects explicitly registered with {@link Context#registerReceiver}.) More 207de2e22d33afec98324a66a358dfe0951b3c7259aSteve Naroff * details on this can be found in the documentation on the {@link 208de2e22d33afec98324a66a358dfe0951b3c7259aSteve Naroff * IntentFilter} class.</p> 209de2e22d33afec98324a66a358dfe0951b3c7259aSteve Naroff * 210de2e22d33afec98324a66a358dfe0951b3c7259aSteve Naroff * <p>There are three pieces of information in the Intent that are used for 211de2e22d33afec98324a66a358dfe0951b3c7259aSteve Naroff * resolution: the action, type, and category. Using this information, a query 212de2e22d33afec98324a66a358dfe0951b3c7259aSteve Naroff * is done on the {@link PackageManager} for a component that can handle the 21314108da7f7fc059772711e4ffee1322a27b152a7Steve Naroff * intent. The appropriate component is determined based on the intent 214a526c5c67e5a0473c340903ee542ce570119665fTed Kremenek * information supplied in the <code>AndroidManifest.xml</code> file as 21533e1d64ab5cd5d27f8530ccd056191fe2c9f3f2eFariborz Jahanian * follows:</p> 21633e1d64ab5cd5d27f8530ccd056191fe2c9f3f2eFariborz Jahanian * 21733e1d64ab5cd5d27f8530ccd056191fe2c9f3f2eFariborz Jahanian * <ul> 2186e8ed16ffef02b82995a90bdcf10ffff7d63839aSebastian Redl * <li> <p>The <b>action</b>, if given, must be listed by the component as 2196e8ed16ffef02b82995a90bdcf10ffff7d63839aSebastian Redl * one it handles.</p> 2206e8ed16ffef02b82995a90bdcf10ffff7d63839aSebastian Redl * <li> <p>The <b>type</b> is retrieved from the Intent's data, if not 2215f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * already supplied in the Intent. Like the action, if a type is 2225f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * included in the intent (either explicitly or implicitly in its 2237caa6825f42a0f7e97d6fc06233133c42b218e46Douglas Gregor * data), then this must be listed by the component as one it handles.</p> 2247caa6825f42a0f7e97d6fc06233133c42b218e46Douglas Gregor * <li> For data that is not a <code>content:</code> URI and where no explicit 2257caa6825f42a0f7e97d6fc06233133c42b218e46Douglas Gregor * type is included in the Intent, instead the <b>scheme</b> of the 2267caa6825f42a0f7e97d6fc06233133c42b218e46Douglas Gregor * intent data (such as <code>http:</code> or <code>mailto:</code>) is 2277caa6825f42a0f7e97d6fc06233133c42b218e46Douglas Gregor * considered. Again like the action, if we are matching a scheme it 2287caa6825f42a0f7e97d6fc06233133c42b218e46Douglas Gregor * must be listed by the component as one it can handle. 2297caa6825f42a0f7e97d6fc06233133c42b218e46Douglas Gregor * <li> <p>The <b>categories</b>, if supplied, must <em>all</em> be listed 2307caa6825f42a0f7e97d6fc06233133c42b218e46Douglas Gregor * by the activity as categories it handles. That is, if you include 2317caa6825f42a0f7e97d6fc06233133c42b218e46Douglas Gregor * the categories {@link #CATEGORY_LAUNCHER} and 2327caa6825f42a0f7e97d6fc06233133c42b218e46Douglas Gregor * {@link #CATEGORY_ALTERNATIVE}, then you will only resolve to components 2337caa6825f42a0f7e97d6fc06233133c42b218e46Douglas Gregor * with an intent that lists <em>both</em> of those categories. 2347caa6825f42a0f7e97d6fc06233133c42b218e46Douglas Gregor * Activities will very often need to support the 2357caa6825f42a0f7e97d6fc06233133c42b218e46Douglas Gregor * {@link #CATEGORY_DEFAULT} so that they can be found by 2367caa6825f42a0f7e97d6fc06233133c42b218e46Douglas Gregor * {@link Context#startActivity Context.startActivity()}.</p> 2377caa6825f42a0f7e97d6fc06233133c42b218e46Douglas Gregor * </ul> 2387caa6825f42a0f7e97d6fc06233133c42b218e46Douglas Gregor * 2397caa6825f42a0f7e97d6fc06233133c42b218e46Douglas Gregor * <p>For example, consider the Note Pad sample application that 2407caa6825f42a0f7e97d6fc06233133c42b218e46Douglas Gregor * allows user to browse through a list of notes data and view details about 2417caa6825f42a0f7e97d6fc06233133c42b218e46Douglas Gregor * individual items. Text in italics indicate places were you would replace a 2422e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * name with one specific to your own package.</p> 2432e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * 2442e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <pre> <manifest xmlns:android="http://schemas.android.com/apk/res/android" 2452e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * package="<i>com.android.notepad</i>"> 2462e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <application android:icon="@drawable/app_notes" 2472e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * android:label="@string/app_name"> 2482e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * 2492e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <provider class=".NotePadProvider" 2502e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * android:authorities="<i>com.google.provider.NotePad</i>" /> 2512e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * 2522e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <activity class=".NotesList" android:label="@string/title_notes_list"> 2532e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <intent-filter> 2542e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <action android:name="android.intent.action.MAIN" /> 2552e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <category android:name="android.intent.category.LAUNCHER" /> 2562e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * </intent-filter> 2572e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <intent-filter> 2582e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <action android:name="android.intent.action.VIEW" /> 2592e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <action android:name="android.intent.action.EDIT" /> 2602e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <action android:name="android.intent.action.PICK" /> 2612e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <category android:name="android.intent.category.DEFAULT" /> 2622e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <data android:mimeType="vnd.android.cursor.dir/<i>vnd.google.note</i>" /> 2632e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * </intent-filter> 2642e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <intent-filter> 2652e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <action android:name="android.intent.action.GET_CONTENT" /> 2662e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <category android:name="android.intent.category.DEFAULT" /> 2672e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <data android:mimeType="vnd.android.cursor.item/<i>vnd.google.note</i>" /> 2682e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * </intent-filter> 2692e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * </activity> 2702e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * 2712e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <activity class=".NoteEditor" android:label="@string/title_note"> 2722e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <intent-filter android:label="@string/resolve_edit"> 2732e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <action android:name="android.intent.action.VIEW" /> 2742e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <action android:name="android.intent.action.EDIT" /> 2752e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <category android:name="android.intent.category.DEFAULT" /> 2762e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <data android:mimeType="vnd.android.cursor.item/<i>vnd.google.note</i>" /> 2772e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * </intent-filter> 2782e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * 2792e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <intent-filter> 2802e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <action android:name="android.intent.action.INSERT" /> 2812e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <category android:name="android.intent.category.DEFAULT" /> 2822e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <data android:mimeType="vnd.android.cursor.dir/<i>vnd.google.note</i>" /> 2832e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * </intent-filter> 2842e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * 2852e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * </activity> 2862e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * 2872e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <activity class=".TitleEditor" android:label="@string/title_edit_title" 2882e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * android:theme="@android:style/Theme.Dialog"> 2892e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <intent-filter android:label="@string/resolve_title"> 2902e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <action android:name="<i>com.android.notepad.action.EDIT_TITLE</i>" /> 2912e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <category android:name="android.intent.category.DEFAULT" /> 2922e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <category android:name="android.intent.category.ALTERNATIVE" /> 2932e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <category android:name="android.intent.category.SELECTED_ALTERNATIVE" /> 2942e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <data android:mimeType="vnd.android.cursor.item/<i>vnd.google.note</i>" /> 2952e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * </intent-filter> 2962e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * </activity> 2972e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * 2982e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * </application> 2992e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * </manifest></pre> 3002e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * 3012e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <p>The first activity, 3022e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <code>com.android.notepad.NotesList</code>, serves as our main 3032e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * entry into the app. It can do three things as described by its three intent 3042e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * templates: 3052e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <ol> 3062e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <li><pre> 3072e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <intent-filter> 3082e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <action android:name="{@link #ACTION_MAIN android.intent.action.MAIN}" /> 3092e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <category android:name="{@link #CATEGORY_LAUNCHER android.intent.category.LAUNCHER}" /> 3102e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * </intent-filter></pre> 3112e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <p>This provides a top-level entry into the NotePad application: the standard 3122e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * MAIN action is a main entry point (not requiring any other information in 3132e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * the Intent), and the LAUNCHER category says that this entry point should be 3142e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * listed in the application launcher.</p> 3152e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <li><pre> 3162e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <intent-filter> 3172e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <action android:name="{@link #ACTION_VIEW android.intent.action.VIEW}" /> 3182e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <action android:name="{@link #ACTION_EDIT android.intent.action.EDIT}" /> 3192e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <action android:name="{@link #ACTION_PICK android.intent.action.PICK}" /> 3202e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <category android:name="{@link #CATEGORY_DEFAULT android.intent.category.DEFAULT}" /> 3212e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <data mimeType:name="vnd.android.cursor.dir/<i>vnd.google.note</i>" /> 3222e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * </intent-filter></pre> 3232e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <p>This declares the things that the activity can do on a directory of 3242e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * notes. The type being supported is given with the <type> tag, where 3252e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <code>vnd.android.cursor.dir/vnd.google.note</code> is a URI from which 3262e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * a Cursor of zero or more items (<code>vnd.android.cursor.dir</code>) can 3272e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * be retrieved which holds our note pad data (<code>vnd.google.note</code>). 3282e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * The activity allows the user to view or edit the directory of data (via 3292e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * the VIEW and EDIT actions), or to pick a particular note and return it 3302e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * to the caller (via the PICK action). Note also the DEFAULT category 3312e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * supplied here: this is <em>required</em> for the 3322e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * {@link Context#startActivity Context.startActivity} method to resolve your 3332e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * activity when its component name is not explicitly specified.</p> 3342e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <li><pre> 3352e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <intent-filter> 3362e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <action android:name="{@link #ACTION_GET_CONTENT android.intent.action.GET_CONTENT}" /> 3372e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <category android:name="{@link #CATEGORY_DEFAULT android.intent.category.DEFAULT}" /> 3382e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <data android:mimeType="vnd.android.cursor.item/<i>vnd.google.note</i>" /> 3392e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * </intent-filter></pre> 3402e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <p>This filter describes the ability return to the caller a note selected by 3412e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * the user without needing to know where it came from. The data type 3422e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <code>vnd.android.cursor.item/vnd.google.note</code> is a URI from which 3432e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * a Cursor of exactly one (<code>vnd.android.cursor.item</code>) item can 3442e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * be retrieved which contains our note pad data (<code>vnd.google.note</code>). 3452e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * The GET_CONTENT action is similar to the PICK action, where the activity 3462e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * will return to its caller a piece of data selected by the user. Here, 3472e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * however, the caller specifies the type of data they desire instead of 3482e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * the type of data the user will be picking from.</p> 3492e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * </ol> 3502e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * 3512e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <p>Given these capabilities, the following intents will resolve to the 3522e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * NotesList activity:</p> 3532e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * 3542e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <ul> 3552e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <li> <p><b>{ action=android.app.action.MAIN }</b> matches all of the 3562e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * activities that can be used as top-level entry points into an 3572e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * application.</p> 3582e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <li> <p><b>{ action=android.app.action.MAIN, 3592e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * category=android.app.category.LAUNCHER }</b> is the actual intent 3602e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * used by the Launcher to populate its top-level list.</p> 3612e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <li> <p><b>{ action=android.intent.action.VIEW 3622e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * data=content://com.google.provider.NotePad/notes }</b> 3632e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * displays a list of all the notes under 3642e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * "content://com.google.provider.NotePad/notes", which 3652e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * the user can browse through and see the details on.</p> 3662e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <li> <p><b>{ action=android.app.action.PICK 3672e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * data=content://com.google.provider.NotePad/notes }</b> 3682e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * provides a list of the notes under 3692e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * "content://com.google.provider.NotePad/notes", from which 3702e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * the user can pick a note whose data URL is returned back to the caller.</p> 3712e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <li> <p><b>{ action=android.app.action.GET_CONTENT 3722e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * type=vnd.android.cursor.item/vnd.google.note }</b> 3732e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * is similar to the pick action, but allows the caller to specify the 3742e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * kind of data they want back so that the system can find the appropriate 3752e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * activity to pick something of that data type.</p> 3762e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * </ul> 3772e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * 3782e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <p>The second activity, 3792e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <code>com.android.notepad.NoteEditor</code>, shows the user a single 3802e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * note entry and allows them to edit it. It can do two things as described 3812e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * by its two intent templates: 3822e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <ol> 3832e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <li><pre> 3842e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <intent-filter android:label="@string/resolve_edit"> 3852e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <action android:name="{@link #ACTION_VIEW android.intent.action.VIEW}" /> 3862e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <action android:name="{@link #ACTION_EDIT android.intent.action.EDIT}" /> 3872e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <category android:name="{@link #CATEGORY_DEFAULT android.intent.category.DEFAULT}" /> 3882e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <data android:mimeType="vnd.android.cursor.item/<i>vnd.google.note</i>" /> 3892e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * </intent-filter></pre> 3902e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <p>The first, primary, purpose of this activity is to let the user interact 3912e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * with a single note, as decribed by the MIME type 3922e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <code>vnd.android.cursor.item/vnd.google.note</code>. The activity can 3932e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * either VIEW a note or allow the user to EDIT it. Again we support the 3942e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * DEFAULT category to allow the activity to be launched without explicitly 3952e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * specifying its component.</p> 3962e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <li><pre> 3972e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <intent-filter> 3982e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <action android:name="{@link #ACTION_INSERT android.intent.action.INSERT}" /> 3992e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <category android:name="{@link #CATEGORY_DEFAULT android.intent.category.DEFAULT}" /> 4002e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <data android:mimeType="vnd.android.cursor.dir/<i>vnd.google.note</i>" /> 4012e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * </intent-filter></pre> 4022e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <p>The secondary use of this activity is to insert a new note entry into 4032e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * an existing directory of notes. This is used when the user creates a new 4042e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * note: the INSERT action is executed on the directory of notes, causing 4052e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * this activity to run and have the user create the new note data which 4062e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * it then adds to the content provider.</p> 4072e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * </ol> 4082e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * 4092e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <p>Given these capabilities, the following intents will resolve to the 4102e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * NoteEditor activity:</p> 4112e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * 4122e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <ul> 4132e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <li> <p><b>{ action=android.intent.action.VIEW 4142e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * data=content://com.google.provider.NotePad/notes/<var>{ID}</var> }</b> 4152e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * shows the user the content of note <var>{ID}</var>.</p> 4162e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <li> <p><b>{ action=android.app.action.EDIT 4172e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * data=content://com.google.provider.NotePad/notes/<var>{ID}</var> }</b> 4182e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * allows the user to edit the content of note <var>{ID}</var>.</p> 4192e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <li> <p><b>{ action=android.app.action.INSERT 4202e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * data=content://com.google.provider.NotePad/notes }</b> 4212e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * creates a new, empty note in the notes list at 4222e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * "content://com.google.provider.NotePad/notes" 4232e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * and allows the user to edit it. If they keep their changes, the URI 4242e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * of the newly created note is returned to the caller.</p> 4252e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * </ul> 4262e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * 4272e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <p>The last activity, 4282e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <code>com.android.notepad.TitleEditor</code>, allows the user to 4292e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * edit the title of a note. This could be implemented as a class that the 4302e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * application directly invokes (by explicitly setting its component in 4312e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * the Intent), but here we show a way you can publish alternative 4322e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * operations on existing data:</p> 4332e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * 4342e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <pre> 4352e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <intent-filter android:label="@string/resolve_title"> 4362e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <action android:name="<i>com.android.notepad.action.EDIT_TITLE</i>" /> 4372e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <category android:name="{@link #CATEGORY_DEFAULT android.intent.category.DEFAULT}" /> 4382e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <category android:name="{@link #CATEGORY_ALTERNATIVE android.intent.category.ALTERNATIVE}" /> 4392e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <category android:name="{@link #CATEGORY_SELECTED_ALTERNATIVE android.intent.category.SELECTED_ALTERNATIVE}" /> 4402e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * <data android:mimeType="vnd.android.cursor.item/<i>vnd.google.note</i>" /> 4412e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * </intent-filter></pre> 4422e22253e03e175144aeb9d13350a12fd83f858beDouglas Gregor * 443464175bba1318bef7905122e9fda20cff926df78Chris Lattner * <p>In the single intent template here, we 444464175bba1318bef7905122e9fda20cff926df78Chris Lattner * have created our own private action called 445464175bba1318bef7905122e9fda20cff926df78Chris Lattner * <code>com.android.notepad.action.EDIT_TITLE</code> which means to 446a7674d8a9a69f3f6fe16e70cf2a3b2b15fb7c43dChris Lattner * edit the title of a note. It must be invoked on a specific note 447b7cfe88e88cb4f46308de89cf3f0c81bfe624128Chris Lattner * (data type <code>vnd.android.cursor.item/vnd.google.note</code>) like the previous 448b7cfe88e88cb4f46308de89cf3f0c81bfe624128Chris Lattner * view and edit actions, but here displays and edits the title contained 449b7cfe88e88cb4f46308de89cf3f0c81bfe624128Chris Lattner * in the note data. 450b7cfe88e88cb4f46308de89cf3f0c81bfe624128Chris Lattner * 451b7cfe88e88cb4f46308de89cf3f0c81bfe624128Chris Lattner * <p>In addition to supporting the default category as usual, our title editor 452b7cfe88e88cb4f46308de89cf3f0c81bfe624128Chris Lattner * also supports two other standard categories: ALTERNATIVE and 453b7cfe88e88cb4f46308de89cf3f0c81bfe624128Chris Lattner * SELECTED_ALTERNATIVE. Implementing 454b7cfe88e88cb4f46308de89cf3f0c81bfe624128Chris Lattner * these categories allows others to find the special action it provides 455b7cfe88e88cb4f46308de89cf3f0c81bfe624128Chris Lattner * without directly knowing about it, through the 456b7cfe88e88cb4f46308de89cf3f0c81bfe624128Chris Lattner * {@link android.content.pm.PackageManager#queryIntentActivityOptions} method, or 457b7cfe88e88cb4f46308de89cf3f0c81bfe624128Chris Lattner * more often to build dynamic menu items with 458b7cfe88e88cb4f46308de89cf3f0c81bfe624128Chris Lattner * {@link android.view.Menu#addIntentOptions}. Note that in the intent 459b7cfe88e88cb4f46308de89cf3f0c81bfe624128Chris Lattner * template here was also supply an explicit name for the template 460af707ab8fbb9451e8febb8d766f6c043628125c4Chris Lattner * (via <code>android:label="@string/resolve_title"</code>) to better control 461af707ab8fbb9451e8febb8d766f6c043628125c4Chris Lattner * what the user sees when presented with this activity as an alternative 462af707ab8fbb9451e8febb8d766f6c043628125c4Chris Lattner * action to the data they are viewing. 463b7d0844c887a72064b624dc6df12cbe1441f69d0Daniel Dunbar * 464dcdafb6a701aa9d81edcb088915f58933315dc05Eli Friedman * <p>Given these capabilities, the following intent will resolve to the 465dcdafb6a701aa9d81edcb088915f58933315dc05Eli Friedman * TitleEditor activity:</p> 46640b598eea1310ec9ed554d56ce3e25b34c585458Argyrios Kyrtzidis * 467dcdafb6a701aa9d81edcb088915f58933315dc05Eli Friedman * <ul> 468dcdafb6a701aa9d81edcb088915f58933315dc05Eli Friedman * <li> <p><b>{ action=com.android.notepad.action.EDIT_TITLE 469af707ab8fbb9451e8febb8d766f6c043628125c4Chris Lattner * data=content://com.google.provider.NotePad/notes/<var>{ID}</var> }</b> 470af707ab8fbb9451e8febb8d766f6c043628125c4Chris Lattner * displays and allows the user to edit the title associated 47135366a67baa970c287c714c957cf78a4131cf60dTed Kremenek * with note <var>{ID}</var>.</p> 4724cc2cfd48d7c2d11141871cad590db7b52ce00a0Anders Carlsson * </ul> 473f0930235ce58a91aa3b840bece9052f44d630536Anders Carlsson * 4744cc2cfd48d7c2d11141871cad590db7b52ce00a0Anders Carlsson * <h3>Standard Activity Actions</h3> 4754cc2cfd48d7c2d11141871cad590db7b52ce00a0Anders Carlsson * 476dcdafb6a701aa9d81edcb088915f58933315dc05Eli Friedman * <p>These are the current standard actions that Intent defines for launching 477dcdafb6a701aa9d81edcb088915f58933315dc05Eli Friedman * activities (usually through {@link Context#startActivity}. The most 478dcdafb6a701aa9d81edcb088915f58933315dc05Eli Friedman * important, and by far most frequently used, are {@link #ACTION_MAIN} and 479dcdafb6a701aa9d81edcb088915f58933315dc05Eli Friedman * {@link #ACTION_EDIT}. 480dcdafb6a701aa9d81edcb088915f58933315dc05Eli Friedman * 481af707ab8fbb9451e8febb8d766f6c043628125c4Chris Lattner * <ul> 482dcdafb6a701aa9d81edcb088915f58933315dc05Eli Friedman * <li> {@link #ACTION_MAIN} 483dcdafb6a701aa9d81edcb088915f58933315dc05Eli Friedman * <li> {@link #ACTION_VIEW} 484af707ab8fbb9451e8febb8d766f6c043628125c4Chris Lattner * <li> {@link #ACTION_ATTACH_DATA} 485b7cfe88e88cb4f46308de89cf3f0c81bfe624128Chris Lattner * <li> {@link #ACTION_EDIT} 486a7674d8a9a69f3f6fe16e70cf2a3b2b15fb7c43dChris Lattner * <li> {@link #ACTION_PICK} 487a7674d8a9a69f3f6fe16e70cf2a3b2b15fb7c43dChris Lattner * <li> {@link #ACTION_CHOOSER} 488d2d2a11a91d7ddf468bfb70f66362d24806ed601Chris Lattner * <li> {@link #ACTION_GET_CONTENT} 4891d75118af76cae2bfc06389cde410e14bd0a19fcDaniel Dunbar * <li> {@link #ACTION_DIAL} 4905e301007e31e14c8ff647288e1b8bd8dbf8a5fe4Mike Stump * <li> {@link #ACTION_CALL} 4915e301007e31e14c8ff647288e1b8bd8dbf8a5fe4Mike Stump * <li> {@link #ACTION_SEND} 492a7674d8a9a69f3f6fe16e70cf2a3b2b15fb7c43dChris Lattner * <li> {@link #ACTION_SENDTO} 49372564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor * <li> {@link #ACTION_ANSWER} 49472564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor * <li> {@link #ACTION_INSERT} 49518857644059c45da6776f1a288eec7b4cf3a844aDouglas Gregor * <li> {@link #ACTION_DELETE} 49672564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor * <li> {@link #ACTION_RUN} 49772564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor * <li> {@link #ACTION_SYNC} 49818857644059c45da6776f1a288eec7b4cf3a844aDouglas Gregor * <li> {@link #ACTION_PICK_ACTIVITY} 49972564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor * <li> {@link #ACTION_SEARCH} 50072564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor * <li> {@link #ACTION_WEB_SEARCH} 5015d2a6303467184b1f159bb6556efc434e50e3c28Chris Lattner * <li> {@link #ACTION_FACTORY_TEST} 5025d2a6303467184b1f159bb6556efc434e50e3c28Chris Lattner * </ul> 50318857644059c45da6776f1a288eec7b4cf3a844aDouglas Gregor * 50418857644059c45da6776f1a288eec7b4cf3a844aDouglas Gregor * <h3>Standard Broadcast Actions</h3> 50518857644059c45da6776f1a288eec7b4cf3a844aDouglas Gregor * 50618857644059c45da6776f1a288eec7b4cf3a844aDouglas Gregor * <p>These are the current standard actions that Intent defines for receiving 50718857644059c45da6776f1a288eec7b4cf3a844aDouglas Gregor * broadcasts (usually through {@link Context#registerReceiver} or a 50872564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor * <receiver> tag in a manifest). 509fb22d96692c5240fb8d611290dbf7eeed3759c73Steve Naroff * 51018857644059c45da6776f1a288eec7b4cf3a844aDouglas Gregor * <ul> 51118857644059c45da6776f1a288eec7b4cf3a844aDouglas Gregor * <li> {@link #ACTION_TIME_TICK} 51218857644059c45da6776f1a288eec7b4cf3a844aDouglas Gregor * <li> {@link #ACTION_TIME_CHANGED} 51318857644059c45da6776f1a288eec7b4cf3a844aDouglas Gregor * <li> {@link #ACTION_TIMEZONE_CHANGED} 5147e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor * <li> {@link #ACTION_BOOT_COMPLETED} 5157e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor * <li> {@link #ACTION_PACKAGE_ADDED} 516fb22d96692c5240fb8d611290dbf7eeed3759c73Steve Naroff * <li> {@link #ACTION_PACKAGE_CHANGED} 5171d75118af76cae2bfc06389cde410e14bd0a19fcDaniel Dunbar * <li> {@link #ACTION_PACKAGE_REMOVED} 518030d8846c7e520330007087e949f621989876e3aChris Lattner * <li> {@link #ACTION_PACKAGE_RESTARTED} 51998be4943e8dc4f3905629a7102668960873cf863Chris Lattner * <li> {@link #ACTION_PACKAGE_DATA_CLEARED} 5209e9b6dc3fd413f5341fab54b681420eeb21cd169Chris Lattner * <li> {@link #ACTION_UID_REMOVED} 521030d8846c7e520330007087e949f621989876e3aChris Lattner * <li> {@link #ACTION_BATTERY_CHANGED} 522030d8846c7e520330007087e949f621989876e3aChris Lattner * <li> {@link #ACTION_POWER_CONNECTED} 5235c09a02a5db85e08a432b6eeced9aa656349710dChristopher Lamb * <li> {@link #ACTION_POWER_DISCONNECTED} 524213541a68a3e137d11d2cefb612c6cdb410d7e8eNate Begeman * <li> {@link #ACTION_SHUTDOWN} 525030d8846c7e520330007087e949f621989876e3aChris Lattner * </ul> 526030d8846c7e520330007087e949f621989876e3aChris Lattner * 52798be4943e8dc4f3905629a7102668960873cf863Chris Lattner * <h3>Standard Categories</h3> 5289e9b6dc3fd413f5341fab54b681420eeb21cd169Chris Lattner * 5294bd998bbc228915d2b9cae5b67879de48940d05eEli Friedman * <p>These are the current standard categories that can be used to further 5306fe7c8aa8c7546743ecd0ac0138c2cf5d8155386Nate Begeman * clarify an Intent via {@link #addCategory}. 5316fe7c8aa8c7546743ecd0ac0138c2cf5d8155386Nate Begeman * 5326fe7c8aa8c7546743ecd0ac0138c2cf5d8155386Nate Begeman * <ul> 5336fe7c8aa8c7546743ecd0ac0138c2cf5d8155386Nate Begeman * <li> {@link #CATEGORY_DEFAULT} 534030d8846c7e520330007087e949f621989876e3aChris Lattner * <li> {@link #CATEGORY_BROWSABLE} 535030d8846c7e520330007087e949f621989876e3aChris Lattner * <li> {@link #CATEGORY_TAB} 5365d2a6303467184b1f159bb6556efc434e50e3c28Chris Lattner * <li> {@link #CATEGORY_ALTERNATIVE} 5379e9b6dc3fd413f5341fab54b681420eeb21cd169Chris Lattner * <li> {@link #CATEGORY_SELECTED_ALTERNATIVE} 538a7674d8a9a69f3f6fe16e70cf2a3b2b15fb7c43dChris Lattner * <li> {@link #CATEGORY_LAUNCHER} 539692233e90a99c3a81dd04879d36eb9688f137c44Chris Lattner * <li> {@link #CATEGORY_INFO} 540d2d2a11a91d7ddf468bfb70f66362d24806ed601Chris Lattner * <li> {@link #CATEGORY_HOME} 54118857644059c45da6776f1a288eec7b4cf3a844aDouglas Gregor * <li> {@link #CATEGORY_PREFERENCE} 54218857644059c45da6776f1a288eec7b4cf3a844aDouglas Gregor * <li> {@link #CATEGORY_TEST} 54318857644059c45da6776f1a288eec7b4cf3a844aDouglas Gregor * <li> {@link #CATEGORY_CAR_DOCK} 54418857644059c45da6776f1a288eec7b4cf3a844aDouglas Gregor * <li> {@link #CATEGORY_DESK_DOCK} 54518857644059c45da6776f1a288eec7b4cf3a844aDouglas Gregor * <li> {@link #CATEGORY_LE_DESK_DOCK} 5466f62c2abd8077bf70d2166d37e8caa426b34d8e4Chris Lattner * <li> {@link #CATEGORY_HE_DESK_DOCK} 5479e9b6dc3fd413f5341fab54b681420eeb21cd169Chris Lattner * <li> {@link #CATEGORY_CAR_MODE} 5489e9b6dc3fd413f5341fab54b681420eeb21cd169Chris Lattner * <li> {@link #CATEGORY_APP_MARKET} 5496f62c2abd8077bf70d2166d37e8caa426b34d8e4Chris Lattner * </ul> 550692233e90a99c3a81dd04879d36eb9688f137c44Chris Lattner * 551692233e90a99c3a81dd04879d36eb9688f137c44Chris Lattner * <h3>Standard Extra Data</h3> 552692233e90a99c3a81dd04879d36eb9688f137c44Chris Lattner * 5536f62c2abd8077bf70d2166d37e8caa426b34d8e4Chris Lattner * <p>These are the current standard fields that can be used as extra data via 5549e9b6dc3fd413f5341fab54b681420eeb21cd169Chris Lattner * {@link #putExtra}. 5559e9b6dc3fd413f5341fab54b681420eeb21cd169Chris Lattner * 5566f62c2abd8077bf70d2166d37e8caa426b34d8e4Chris Lattner * <ul> 55764c438a4be2a871fa43c78264663ba1e9788b94dArgyrios Kyrtzidis * <li> {@link #EXTRA_ALARM_COUNT} 55864c438a4be2a871fa43c78264663ba1e9788b94dArgyrios Kyrtzidis * <li> {@link #EXTRA_BCC} 55964c438a4be2a871fa43c78264663ba1e9788b94dArgyrios Kyrtzidis * <li> {@link #EXTRA_CC} 56064c438a4be2a871fa43c78264663ba1e9788b94dArgyrios Kyrtzidis * <li> {@link #EXTRA_CHANGED_COMPONENT_NAME} 561f5c209d23b20ada4a9b6235db50317239cbf6ae1Alisdair Meredith * <li> {@link #EXTRA_DATA_REMOVED} 562f5c209d23b20ada4a9b6235db50317239cbf6ae1Alisdair Meredith * <li> {@link #EXTRA_DOCK_STATE} 563f5c209d23b20ada4a9b6235db50317239cbf6ae1Alisdair Meredith * <li> {@link #EXTRA_DOCK_STATE_HE_DESK} 564f5c209d23b20ada4a9b6235db50317239cbf6ae1Alisdair Meredith * <li> {@link #EXTRA_DOCK_STATE_LE_DESK} 565f5c209d23b20ada4a9b6235db50317239cbf6ae1Alisdair Meredith * <li> {@link #EXTRA_DOCK_STATE_CAR} 566f5c209d23b20ada4a9b6235db50317239cbf6ae1Alisdair Meredith * <li> {@link #EXTRA_DOCK_STATE_DESK} 567f5c209d23b20ada4a9b6235db50317239cbf6ae1Alisdair Meredith * <li> {@link #EXTRA_DOCK_STATE_UNDOCKED} 568f5c209d23b20ada4a9b6235db50317239cbf6ae1Alisdair Meredith * <li> {@link #EXTRA_DONT_KILL_APP} 569692233e90a99c3a81dd04879d36eb9688f137c44Chris Lattner * <li> {@link #EXTRA_EMAIL} 5706f62c2abd8077bf70d2166d37e8caa426b34d8e4Chris Lattner * <li> {@link #EXTRA_INITIAL_INTENTS} 5719e9b6dc3fd413f5341fab54b681420eeb21cd169Chris Lattner * <li> {@link #EXTRA_INTENT} 5729e9b6dc3fd413f5341fab54b681420eeb21cd169Chris Lattner * <li> {@link #EXTRA_KEY_EVENT} 5736f62c2abd8077bf70d2166d37e8caa426b34d8e4Chris Lattner * <li> {@link #EXTRA_ORIGINATING_URI} 574692233e90a99c3a81dd04879d36eb9688f137c44Chris Lattner * <li> {@link #EXTRA_PHONE_NUMBER} 5756f62c2abd8077bf70d2166d37e8caa426b34d8e4Chris Lattner * <li> {@link #EXTRA_REFERRER} 5769e9b6dc3fd413f5341fab54b681420eeb21cd169Chris Lattner * <li> {@link #EXTRA_REMOTE_INTENT_TOKEN} 5779e9b6dc3fd413f5341fab54b681420eeb21cd169Chris Lattner * <li> {@link #EXTRA_REPLACING} 5786f62c2abd8077bf70d2166d37e8caa426b34d8e4Chris Lattner * <li> {@link #EXTRA_SHORTCUT_ICON} 579692233e90a99c3a81dd04879d36eb9688f137c44Chris Lattner * <li> {@link #EXTRA_SHORTCUT_ICON_RESOURCE} 5806f62c2abd8077bf70d2166d37e8caa426b34d8e4Chris Lattner * <li> {@link #EXTRA_SHORTCUT_INTENT} 5819e9b6dc3fd413f5341fab54b681420eeb21cd169Chris Lattner * <li> {@link #EXTRA_STREAM} 5829e9b6dc3fd413f5341fab54b681420eeb21cd169Chris Lattner * <li> {@link #EXTRA_SHORTCUT_NAME} 5836f62c2abd8077bf70d2166d37e8caa426b34d8e4Chris Lattner * <li> {@link #EXTRA_SUBJECT} 584692233e90a99c3a81dd04879d36eb9688f137c44Chris Lattner * <li> {@link #EXTRA_TEMPLATE} 5856f62c2abd8077bf70d2166d37e8caa426b34d8e4Chris Lattner * <li> {@link #EXTRA_TEXT} 5869e9b6dc3fd413f5341fab54b681420eeb21cd169Chris Lattner * <li> {@link #EXTRA_TITLE} 5879e9b6dc3fd413f5341fab54b681420eeb21cd169Chris Lattner * <li> {@link #EXTRA_UID} 5886f62c2abd8077bf70d2166d37e8caa426b34d8e4Chris Lattner * </ul> 589ec16cb9b5a481d62a73ad47fa59034ced4d62022Chris Lattner * 590ec16cb9b5a481d62a73ad47fa59034ced4d62022Chris Lattner * <h3>Flags</h3> 591ec16cb9b5a481d62a73ad47fa59034ced4d62022Chris Lattner * 592ec16cb9b5a481d62a73ad47fa59034ced4d62022Chris Lattner * <p>These are the possible flags that can be used in the Intent via 593ec16cb9b5a481d62a73ad47fa59034ced4d62022Chris Lattner * {@link #setFlags} and {@link #addFlags}. See {@link #setFlags} for a list 5946f62c2abd8077bf70d2166d37e8caa426b34d8e4Chris Lattner * of all possible flags. 5959e9b6dc3fd413f5341fab54b681420eeb21cd169Chris Lattner */ 5969e9b6dc3fd413f5341fab54b681420eeb21cd169Chris Lattnerpublic class Intent implements Parcelable, Cloneable { 5976f62c2abd8077bf70d2166d37e8caa426b34d8e4Chris Lattner // --------------------------------------------------------------------- 5986f62c2abd8077bf70d2166d37e8caa426b34d8e4Chris Lattner // --------------------------------------------------------------------- 5995426bf6456a5aeac416a9150de157904d101c819Chris Lattner // Standard intent activity actions (see action variable). 6005426bf6456a5aeac416a9150de157904d101c819Chris Lattner 6016f62c2abd8077bf70d2166d37e8caa426b34d8e4Chris Lattner /** 6026f62c2abd8077bf70d2166d37e8caa426b34d8e4Chris Lattner * Activity Action: Start as a main entry point, does not expect to 6039e9b6dc3fd413f5341fab54b681420eeb21cd169Chris Lattner * receive data. 6049e9b6dc3fd413f5341fab54b681420eeb21cd169Chris Lattner * <p>Input: nothing 6056f62c2abd8077bf70d2166d37e8caa426b34d8e4Chris Lattner * <p>Output: nothing 6066e8ed16ffef02b82995a90bdcf10ffff7d63839aSebastian Redl */ 6076e8ed16ffef02b82995a90bdcf10ffff7d63839aSebastian Redl @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 6086e8ed16ffef02b82995a90bdcf10ffff7d63839aSebastian Redl public static final String ACTION_MAIN = "android.intent.action.MAIN"; 6091590d9c0fec4c710c2962e4bb71f76979b5163d3Sebastian Redl 610a7674d8a9a69f3f6fe16e70cf2a3b2b15fb7c43dChris Lattner /** 611bfef6d7c67831a135d6ab79931f010f750a730adChris Lattner * Activity Action: Display the data to the user. This is the most common 612f98aba35e6c3da5aae61843fc01334939e4e12ecEli Friedman * action performed on data -- it is the generic action you can use on 613f98aba35e6c3da5aae61843fc01334939e4e12ecEli Friedman * a piece of data to get the most reasonable thing to occur. For example, 614f98aba35e6c3da5aae61843fc01334939e4e12ecEli Friedman * when used on a contacts entry it will view the entry; when used on a 615f98aba35e6c3da5aae61843fc01334939e4e12ecEli Friedman * mailto: URI it will bring up a compose window filled with the information 616736166b38235cf6d0ffb67638960d95fb2afcbd6Chris Lattner * supplied by the URI; when used with a tel: URI it will invoke the 617f98aba35e6c3da5aae61843fc01334939e4e12ecEli Friedman * dialer. 618f98aba35e6c3da5aae61843fc01334939e4e12ecEli Friedman * <p>Input: {@link #getData} is URI from which to retrieve data. 619f11284ac87daa613bc7b30db9f54bd716d123222Fariborz Jahanian * <p>Output: nothing. 62098be4943e8dc4f3905629a7102668960873cf863Chris Lattner */ 62198be4943e8dc4f3905629a7102668960873cf863Chris Lattner @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 622f11284ac87daa613bc7b30db9f54bd716d123222Fariborz Jahanian public static final String ACTION_VIEW = "android.intent.action.VIEW"; 623d1b3c2dd5bc1f3103bee6137957aa7c5f8f2f0bcSteve Naroff 6245426bf6456a5aeac416a9150de157904d101c819Chris Lattner /** 625f72a44330b9d9a4b2d93e9b91cfb8ab7bd4a0643Chris Lattner * A synonym for {@link #ACTION_VIEW}, the "standard" action that is 6266f62c2abd8077bf70d2166d37e8caa426b34d8e4Chris Lattner * performed on a piece of data. 627485eeff9ba73376c8e01179bf1a501b1723446cbSteve Naroff */ 628485eeff9ba73376c8e01179bf1a501b1723446cbSteve Naroff public static final String ACTION_DEFAULT = ACTION_VIEW; 629485eeff9ba73376c8e01179bf1a501b1723446cbSteve Naroff 630485eeff9ba73376c8e01179bf1a501b1723446cbSteve Naroff /** 631485eeff9ba73376c8e01179bf1a501b1723446cbSteve Naroff * Used to indicate that some piece of data should be attached to some other 632485eeff9ba73376c8e01179bf1a501b1723446cbSteve Naroff * place. For example, image data could be attached to a contact. It is up 633f72a44330b9d9a4b2d93e9b91cfb8ab7bd4a0643Chris Lattner * to the recipient to decide where the data should be attached; the intent 634f72a44330b9d9a4b2d93e9b91cfb8ab7bd4a0643Chris Lattner * does not specify the ultimate destination. 6355426bf6456a5aeac416a9150de157904d101c819Chris Lattner * <p>Input: {@link #getData} is URI of data to be attached. 636f72a44330b9d9a4b2d93e9b91cfb8ab7bd4a0643Chris Lattner * <p>Output: nothing. 637f72a44330b9d9a4b2d93e9b91cfb8ab7bd4a0643Chris Lattner */ 638f72a44330b9d9a4b2d93e9b91cfb8ab7bd4a0643Chris Lattner @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 6397c80bd64032e610c0dbd74fc0ef6ea334447f2fdSebastian Redl public static final String ACTION_ATTACH_DATA = "android.intent.action.ATTACH_DATA"; 6407c80bd64032e610c0dbd74fc0ef6ea334447f2fdSebastian Redl 6417ab2ed8e881ffdc84e890f5265c41b930df17ceeChris Lattner /** 6425d2a6303467184b1f159bb6556efc434e50e3c28Chris Lattner * Activity Action: Provide explicit editable access to the given data. 6436f62c2abd8077bf70d2166d37e8caa426b34d8e4Chris Lattner * <p>Input: {@link #getData} is URI of data to be edited. 6446f62c2abd8077bf70d2166d37e8caa426b34d8e4Chris Lattner * <p>Output: nothing. 645bdcd637c29ec1540f912ea6860c88b910e78c329Chris Lattner */ 646f30208ad5b334e93582e846a2a0c92f38a607b8aSebastian Redl @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 6471cca74ef3627a3a0ab14501d23e336548f6611b2Anders Carlsson public static final String ACTION_EDIT = "android.intent.action.EDIT"; 6481cca74ef3627a3a0ab14501d23e336548f6611b2Anders Carlsson 6491cca74ef3627a3a0ab14501d23e336548f6611b2Anders Carlsson /** 6501cca74ef3627a3a0ab14501d23e336548f6611b2Anders Carlsson * Activity Action: Pick an existing item, or insert a new item, and then edit it. 651f30208ad5b334e93582e846a2a0c92f38a607b8aSebastian Redl * <p>Input: {@link #getType} is the desired MIME type of the item to create or edit. 6521cca74ef3627a3a0ab14501d23e336548f6611b2Anders Carlsson * The extras can contain type specific data to pass through to the editing/creating 6531cca74ef3627a3a0ab14501d23e336548f6611b2Anders Carlsson * activity. 6541cca74ef3627a3a0ab14501d23e336548f6611b2Anders Carlsson * <p>Output: The URI of the item that was picked. This must be a content: 655f30208ad5b334e93582e846a2a0c92f38a607b8aSebastian Redl * URI so that any receiver can access it. 656f30208ad5b334e93582e846a2a0c92f38a607b8aSebastian Redl */ 6571cca74ef3627a3a0ab14501d23e336548f6611b2Anders Carlsson @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 6581cca74ef3627a3a0ab14501d23e336548f6611b2Anders Carlsson public static final String ACTION_INSERT_OR_EDIT = "android.intent.action.INSERT_OR_EDIT"; 659f30208ad5b334e93582e846a2a0c92f38a607b8aSebastian Redl 6605d2a6303467184b1f159bb6556efc434e50e3c28Chris Lattner /** 6615d2a6303467184b1f159bb6556efc434e50e3c28Chris Lattner * Activity Action: Pick an item from the data, returning what was selected. 6625d2a6303467184b1f159bb6556efc434e50e3c28Chris Lattner * <p>Input: {@link #getData} is URI containing a directory of data 6635d2a6303467184b1f159bb6556efc434e50e3c28Chris Lattner * (vnd.android.cursor.dir/*) from which to pick an item. 66498be4943e8dc4f3905629a7102668960873cf863Chris Lattner * <p>Output: The URI of the item that was picked. 6659e9b6dc3fd413f5341fab54b681420eeb21cd169Chris Lattner */ 6665d2a6303467184b1f159bb6556efc434e50e3c28Chris Lattner @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 6675d2a6303467184b1f159bb6556efc434e50e3c28Chris Lattner public static final String ACTION_PICK = "android.intent.action.PICK"; 6685d2a6303467184b1f159bb6556efc434e50e3c28Chris Lattner 66944a3dded8080c5c9cfdad208ade8f8f7850d9a4fDevang Patel /** 6701d75118af76cae2bfc06389cde410e14bd0a19fcDaniel Dunbar * Activity Action: Creates a shortcut. 67144a3dded8080c5c9cfdad208ade8f8f7850d9a4fDevang Patel * <p>Input: Nothing.</p> 67244a3dded8080c5c9cfdad208ade8f8f7850d9a4fDevang Patel * <p>Output: An Intent representing the shortcut. The intent must contain three 67344a3dded8080c5c9cfdad208ade8f8f7850d9a4fDevang Patel * extras: SHORTCUT_INTENT (value: Intent), SHORTCUT_NAME (value: String), 67444a3dded8080c5c9cfdad208ade8f8f7850d9a4fDevang Patel * and SHORTCUT_ICON (value: Bitmap) or SHORTCUT_ICON_RESOURCE 67544a3dded8080c5c9cfdad208ade8f8f7850d9a4fDevang Patel * (value: ShortcutIconResource).</p> 67672564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor * 67772564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor * @see #EXTRA_SHORTCUT_INTENT 6781d75118af76cae2bfc06389cde410e14bd0a19fcDaniel Dunbar * @see #EXTRA_SHORTCUT_NAME 6791d75118af76cae2bfc06389cde410e14bd0a19fcDaniel Dunbar * @see #EXTRA_SHORTCUT_ICON 6801d75118af76cae2bfc06389cde410e14bd0a19fcDaniel Dunbar * @see #EXTRA_SHORTCUT_ICON_RESOURCE 6818389eab190afef3462f6418b8d8fb70fb01c4005Chris Lattner * @see android.content.Intent.ShortcutIconResource 6828389eab190afef3462f6418b8d8fb70fb01c4005Chris Lattner */ 6838389eab190afef3462f6418b8d8fb70fb01c4005Chris Lattner @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 6848389eab190afef3462f6418b8d8fb70fb01c4005Chris Lattner public static final String ACTION_CREATE_SHORTCUT = "android.intent.action.CREATE_SHORTCUT"; 6858389eab190afef3462f6418b8d8fb70fb01c4005Chris Lattner 6861d75118af76cae2bfc06389cde410e14bd0a19fcDaniel Dunbar /** 6877176331b0f5cfaaa2b5aa487a6660e859e371119Chris Lattner * The name of the extra used to define the Intent of a shortcut. 6887176331b0f5cfaaa2b5aa487a6660e859e371119Chris Lattner * 6891d75118af76cae2bfc06389cde410e14bd0a19fcDaniel Dunbar * @see #ACTION_CREATE_SHORTCUT 6907176331b0f5cfaaa2b5aa487a6660e859e371119Chris Lattner */ 6917176331b0f5cfaaa2b5aa487a6660e859e371119Chris Lattner public static final String EXTRA_SHORTCUT_INTENT = "android.intent.extra.shortcut.INTENT"; 6927176331b0f5cfaaa2b5aa487a6660e859e371119Chris Lattner /** 693dc0d73e6495404418acf8548875aeaff07791a74Chris Lattner * The name of the extra used to define the name of a shortcut. 694a7674d8a9a69f3f6fe16e70cf2a3b2b15fb7c43dChris Lattner * 6957532dc66648cfe7432c9fe66dec5225f0ab301c6Douglas Gregor * @see #ACTION_CREATE_SHORTCUT 69618857644059c45da6776f1a288eec7b4cf3a844aDouglas Gregor */ 69718857644059c45da6776f1a288eec7b4cf3a844aDouglas Gregor public static final String EXTRA_SHORTCUT_NAME = "android.intent.extra.shortcut.NAME"; 69840b598eea1310ec9ed554d56ce3e25b34c585458Argyrios Kyrtzidis /** 69918857644059c45da6776f1a288eec7b4cf3a844aDouglas Gregor * The name of the extra used to define the icon, as a Bitmap, of a shortcut. 70018857644059c45da6776f1a288eec7b4cf3a844aDouglas Gregor * 70118857644059c45da6776f1a288eec7b4cf3a844aDouglas Gregor * @see #ACTION_CREATE_SHORTCUT 70218857644059c45da6776f1a288eec7b4cf3a844aDouglas Gregor */ 7037532dc66648cfe7432c9fe66dec5225f0ab301c6Douglas Gregor public static final String EXTRA_SHORTCUT_ICON = "android.intent.extra.shortcut.ICON"; 7047176331b0f5cfaaa2b5aa487a6660e859e371119Chris Lattner /** 70518857644059c45da6776f1a288eec7b4cf3a844aDouglas Gregor * The name of the extra used to define the icon, as a ShortcutIconResource, of a shortcut. 70618857644059c45da6776f1a288eec7b4cf3a844aDouglas Gregor * 70718857644059c45da6776f1a288eec7b4cf3a844aDouglas Gregor * @see #ACTION_CREATE_SHORTCUT 70818857644059c45da6776f1a288eec7b4cf3a844aDouglas Gregor * @see android.content.Intent.ShortcutIconResource 70918857644059c45da6776f1a288eec7b4cf3a844aDouglas Gregor */ 71018857644059c45da6776f1a288eec7b4cf3a844aDouglas Gregor public static final String EXTRA_SHORTCUT_ICON_RESOURCE = 71118857644059c45da6776f1a288eec7b4cf3a844aDouglas Gregor "android.intent.extra.shortcut.ICON_RESOURCE"; 71218857644059c45da6776f1a288eec7b4cf3a844aDouglas Gregor 713395b475a4474f1c7574d927ad142ca0c7997cbcaAnders Carlsson /** 714395b475a4474f1c7574d927ad142ca0c7997cbcaAnders Carlsson * Represents a shortcut/live folder icon resource. 715395b475a4474f1c7574d927ad142ca0c7997cbcaAnders Carlsson * 716395b475a4474f1c7574d927ad142ca0c7997cbcaAnders Carlsson * @see Intent#ACTION_CREATE_SHORTCUT 71718857644059c45da6776f1a288eec7b4cf3a844aDouglas Gregor * @see Intent#EXTRA_SHORTCUT_ICON_RESOURCE 71818857644059c45da6776f1a288eec7b4cf3a844aDouglas Gregor * @see android.provider.LiveFolders#ACTION_CREATE_LIVE_FOLDER 71918857644059c45da6776f1a288eec7b4cf3a844aDouglas Gregor * @see android.provider.LiveFolders#EXTRA_LIVE_FOLDER_ICON 72018857644059c45da6776f1a288eec7b4cf3a844aDouglas Gregor */ 72118857644059c45da6776f1a288eec7b4cf3a844aDouglas Gregor public static class ShortcutIconResource implements Parcelable { 72218857644059c45da6776f1a288eec7b4cf3a844aDouglas Gregor /** 72318857644059c45da6776f1a288eec7b4cf3a844aDouglas Gregor * The package name of the application containing the icon. 72418857644059c45da6776f1a288eec7b4cf3a844aDouglas Gregor */ 72518857644059c45da6776f1a288eec7b4cf3a844aDouglas Gregor public String packageName; 72618857644059c45da6776f1a288eec7b4cf3a844aDouglas Gregor 72718857644059c45da6776f1a288eec7b4cf3a844aDouglas Gregor /** 728d2d2a11a91d7ddf468bfb70f66362d24806ed601Chris Lattner * The resource name of the icon, including package, name and type. 729464175bba1318bef7905122e9fda20cff926df78Chris Lattner */ 7309e9b6dc3fd413f5341fab54b681420eeb21cd169Chris Lattner public String resourceName; 731a7674d8a9a69f3f6fe16e70cf2a3b2b15fb7c43dChris Lattner 732a7674d8a9a69f3f6fe16e70cf2a3b2b15fb7c43dChris Lattner /** 73334ebde404dc17d89487b07e6daaf1b47d5dfee39Chris Lattner * Creates a new ShortcutIconResource for the specified context and resource 73434ebde404dc17d89487b07e6daaf1b47d5dfee39Chris Lattner * identifier. 73534ebde404dc17d89487b07e6daaf1b47d5dfee39Chris Lattner * 73634ebde404dc17d89487b07e6daaf1b47d5dfee39Chris Lattner * @param context The context of the application. 73734ebde404dc17d89487b07e6daaf1b47d5dfee39Chris Lattner * @param resourceId The resource idenfitier for the icon. 73834ebde404dc17d89487b07e6daaf1b47d5dfee39Chris Lattner * @return A new ShortcutIconResource with the specified's context package name 7391eed60297ef4701b899c6a3b9680bf08f3403422Eli Friedman * and icon resource idenfitier. 7401eed60297ef4701b899c6a3b9680bf08f3403422Eli Friedman */ 7411eed60297ef4701b899c6a3b9680bf08f3403422Eli Friedman public static ShortcutIconResource fromContext(Context context, int resourceId) { 7421eed60297ef4701b899c6a3b9680bf08f3403422Eli Friedman ShortcutIconResource icon = new ShortcutIconResource(); 7431eed60297ef4701b899c6a3b9680bf08f3403422Eli Friedman icon.packageName = context.getPackageName(); 7441eed60297ef4701b899c6a3b9680bf08f3403422Eli Friedman icon.resourceName = context.getResources().getResourceName(resourceId); 7451eed60297ef4701b899c6a3b9680bf08f3403422Eli Friedman return icon; 7461eed60297ef4701b899c6a3b9680bf08f3403422Eli Friedman } 74734ebde404dc17d89487b07e6daaf1b47d5dfee39Chris Lattner 74834ebde404dc17d89487b07e6daaf1b47d5dfee39Chris Lattner /** 74934ebde404dc17d89487b07e6daaf1b47d5dfee39Chris Lattner * Used to read a ShortcutIconResource from a Parcel. 750a80a0f6398df06c018af779a7ca82a29172c45d1Daniel Dunbar */ 751a80a0f6398df06c018af779a7ca82a29172c45d1Daniel Dunbar public static final Parcelable.Creator<ShortcutIconResource> CREATOR = 752a80a0f6398df06c018af779a7ca82a29172c45d1Daniel Dunbar new Parcelable.Creator<ShortcutIconResource>() { 753a769c004a2874504c17ea8afccbc4ad35fc33c9fFariborz Jahanian 754a769c004a2874504c17ea8afccbc4ad35fc33c9fFariborz Jahanian public ShortcutIconResource createFromParcel(Parcel source) { 755f1690858344968358131f8d5690d9ee458883000Chris Lattner ShortcutIconResource icon = new ShortcutIconResource(); 756a769c004a2874504c17ea8afccbc4ad35fc33c9fFariborz Jahanian icon.packageName = source.readString(); 757a769c004a2874504c17ea8afccbc4ad35fc33c9fFariborz Jahanian icon.resourceName = source.readString(); 758a769c004a2874504c17ea8afccbc4ad35fc33c9fFariborz Jahanian return icon; 759a769c004a2874504c17ea8afccbc4ad35fc33c9fFariborz Jahanian } 760a769c004a2874504c17ea8afccbc4ad35fc33c9fFariborz Jahanian 761a80a0f6398df06c018af779a7ca82a29172c45d1Daniel Dunbar public ShortcutIconResource[] newArray(int size) { 762a80a0f6398df06c018af779a7ca82a29172c45d1Daniel Dunbar return new ShortcutIconResource[size]; 763a80a0f6398df06c018af779a7ca82a29172c45d1Daniel Dunbar } 764a80a0f6398df06c018af779a7ca82a29172c45d1Daniel Dunbar }; 765a80a0f6398df06c018af779a7ca82a29172c45d1Daniel Dunbar 766a80a0f6398df06c018af779a7ca82a29172c45d1Daniel Dunbar /** 767a80a0f6398df06c018af779a7ca82a29172c45d1Daniel Dunbar * No special parcel contents. 7688e6ac1d80055fa37b9b84029c7e751624ba7f84cFariborz Jahanian */ 7698e6ac1d80055fa37b9b84029c7e751624ba7f84cFariborz Jahanian public int describeContents() { 7708e6ac1d80055fa37b9b84029c7e751624ba7f84cFariborz Jahanian return 0; 7718e6ac1d80055fa37b9b84029c7e751624ba7f84cFariborz Jahanian } 7728e6ac1d80055fa37b9b84029c7e751624ba7f84cFariborz Jahanian 7738e6ac1d80055fa37b9b84029c7e751624ba7f84cFariborz Jahanian public void writeToParcel(Parcel dest, int flags) { 7748e6ac1d80055fa37b9b84029c7e751624ba7f84cFariborz Jahanian dest.writeString(packageName); 7758e6ac1d80055fa37b9b84029c7e751624ba7f84cFariborz Jahanian dest.writeString(resourceName); 7768e6ac1d80055fa37b9b84029c7e751624ba7f84cFariborz Jahanian } 7778e6ac1d80055fa37b9b84029c7e751624ba7f84cFariborz Jahanian 7788e6ac1d80055fa37b9b84029c7e751624ba7f84cFariborz Jahanian @Override 7798e6ac1d80055fa37b9b84029c7e751624ba7f84cFariborz Jahanian public String toString() { 7808e6ac1d80055fa37b9b84029c7e751624ba7f84cFariborz Jahanian return resourceName; 7818e6ac1d80055fa37b9b84029c7e751624ba7f84cFariborz Jahanian } 7829820074dd47d37681085e964cd3392ac0b3e67b9Fariborz Jahanian } 7839820074dd47d37681085e964cd3392ac0b3e67b9Fariborz Jahanian 78417945a0f64fe03ff6ec0c2146005a87636e3ac12Argyrios Kyrtzidis /** 78517945a0f64fe03ff6ec0c2146005a87636e3ac12Argyrios Kyrtzidis * Activity Action: Display an activity chooser, allowing the user to pick 7869820074dd47d37681085e964cd3392ac0b3e67b9Fariborz Jahanian * what they want to before proceeding. This can be used as an alternative 7879820074dd47d37681085e964cd3392ac0b3e67b9Fariborz Jahanian * to the standard activity picker that is displayed by the system when 7889820074dd47d37681085e964cd3392ac0b3e67b9Fariborz Jahanian * you try to start an activity with multiple possible matches, with these 7899820074dd47d37681085e964cd3392ac0b3e67b9Fariborz Jahanian * differences in behavior: 7909820074dd47d37681085e964cd3392ac0b3e67b9Fariborz Jahanian * <ul> 7919820074dd47d37681085e964cd3392ac0b3e67b9Fariborz Jahanian * <li>You can specify the title that will appear in the activity chooser. 7929820074dd47d37681085e964cd3392ac0b3e67b9Fariborz Jahanian * <li>The user does not have the option to make one of the matching 7939820074dd47d37681085e964cd3392ac0b3e67b9Fariborz Jahanian * activities a preferred activity, and all possible activities will 7949820074dd47d37681085e964cd3392ac0b3e67b9Fariborz Jahanian * always be shown even if one of them is currently marked as the 7959820074dd47d37681085e964cd3392ac0b3e67b9Fariborz Jahanian * preferred activity. 7969820074dd47d37681085e964cd3392ac0b3e67b9Fariborz Jahanian * </ul> 7979820074dd47d37681085e964cd3392ac0b3e67b9Fariborz Jahanian * <p> 7989820074dd47d37681085e964cd3392ac0b3e67b9Fariborz Jahanian * This action should be used when the user will naturally expect to 7999820074dd47d37681085e964cd3392ac0b3e67b9Fariborz Jahanian * select an activity in order to proceed. An example if when not to use 80017945a0f64fe03ff6ec0c2146005a87636e3ac12Argyrios Kyrtzidis * it is when the user clicks on a "mailto:" link. They would naturally 80117945a0f64fe03ff6ec0c2146005a87636e3ac12Argyrios Kyrtzidis * expect to go directly to their mail app, so startActivity() should be 8029820074dd47d37681085e964cd3392ac0b3e67b9Fariborz Jahanian * called directly: it will 8039820074dd47d37681085e964cd3392ac0b3e67b9Fariborz Jahanian * either launch the current preferred app, or put up a dialog allowing the 8049820074dd47d37681085e964cd3392ac0b3e67b9Fariborz Jahanian * user to pick an app to use and optionally marking that as preferred. 8059820074dd47d37681085e964cd3392ac0b3e67b9Fariborz Jahanian * <p> 8069820074dd47d37681085e964cd3392ac0b3e67b9Fariborz Jahanian * In contrast, if the user is selecting a menu item to send a picture 8079820074dd47d37681085e964cd3392ac0b3e67b9Fariborz Jahanian * they are viewing to someone else, there are many different things they 8089820074dd47d37681085e964cd3392ac0b3e67b9Fariborz Jahanian * may want to do at this point: send it through e-mail, upload it to a 8099820074dd47d37681085e964cd3392ac0b3e67b9Fariborz Jahanian * web service, etc. In this case the CHOOSER action should be used, to 8109820074dd47d37681085e964cd3392ac0b3e67b9Fariborz Jahanian * always present to the user a list of the things they can do, with a 8119820074dd47d37681085e964cd3392ac0b3e67b9Fariborz Jahanian * nice title given by the caller such as "Send this photo with:". 8129820074dd47d37681085e964cd3392ac0b3e67b9Fariborz Jahanian * <p> 8139820074dd47d37681085e964cd3392ac0b3e67b9Fariborz Jahanian * If you need to grant URI permissions through a chooser, you must specify 8148e6ac1d80055fa37b9b84029c7e751624ba7f84cFariborz Jahanian * the permissions to be granted on the ACTION_CHOOSER Intent 8158e6ac1d80055fa37b9b84029c7e751624ba7f84cFariborz Jahanian * <em>in addition</em> to the EXTRA_INTENT inside. This means using 81617945a0f64fe03ff6ec0c2146005a87636e3ac12Argyrios Kyrtzidis * {@link #setClipData} to specify the URIs to be granted as well as 81717945a0f64fe03ff6ec0c2146005a87636e3ac12Argyrios Kyrtzidis * {@link #FLAG_GRANT_READ_URI_PERMISSION} and/or 8188e6ac1d80055fa37b9b84029c7e751624ba7f84cFariborz Jahanian * {@link #FLAG_GRANT_WRITE_URI_PERMISSION} as appropriate. 8198e6ac1d80055fa37b9b84029c7e751624ba7f84cFariborz Jahanian * <p> 8208e6ac1d80055fa37b9b84029c7e751624ba7f84cFariborz Jahanian * As a convenience, an Intent of this form can be created with the 8218e6ac1d80055fa37b9b84029c7e751624ba7f84cFariborz Jahanian * {@link #createChooser} function. 8228e6ac1d80055fa37b9b84029c7e751624ba7f84cFariborz Jahanian * <p> 8238e6ac1d80055fa37b9b84029c7e751624ba7f84cFariborz Jahanian * Input: No data should be specified. get*Extra must have 8248e6ac1d80055fa37b9b84029c7e751624ba7f84cFariborz Jahanian * a {@link #EXTRA_INTENT} field containing the Intent being executed, 8258e6ac1d80055fa37b9b84029c7e751624ba7f84cFariborz Jahanian * and can optionally have a {@link #EXTRA_TITLE} field containing the 8268e6ac1d80055fa37b9b84029c7e751624ba7f84cFariborz Jahanian * title text to display in the chooser. 8278e6ac1d80055fa37b9b84029c7e751624ba7f84cFariborz Jahanian * <p> 8288e6ac1d80055fa37b9b84029c7e751624ba7f84cFariborz Jahanian * Output: Depends on the protocol of {@link #EXTRA_INTENT}. 8298e6ac1d80055fa37b9b84029c7e751624ba7f84cFariborz Jahanian */ 8308e6ac1d80055fa37b9b84029c7e751624ba7f84cFariborz Jahanian @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 83117945a0f64fe03ff6ec0c2146005a87636e3ac12Argyrios Kyrtzidis public static final String ACTION_CHOOSER = "android.intent.action.CHOOSER"; 83217945a0f64fe03ff6ec0c2146005a87636e3ac12Argyrios Kyrtzidis 8338e6ac1d80055fa37b9b84029c7e751624ba7f84cFariborz Jahanian /** 8348e6ac1d80055fa37b9b84029c7e751624ba7f84cFariborz Jahanian * Convenience function for creating a {@link #ACTION_CHOOSER} Intent. 8358e6ac1d80055fa37b9b84029c7e751624ba7f84cFariborz Jahanian * 8368e6ac1d80055fa37b9b84029c7e751624ba7f84cFariborz Jahanian * <p>Builds a new {@link #ACTION_CHOOSER} Intent that wraps the given 8378e6ac1d80055fa37b9b84029c7e751624ba7f84cFariborz Jahanian * target intent, also optionally supplying a title. If the target 8388e6ac1d80055fa37b9b84029c7e751624ba7f84cFariborz Jahanian * intent has specified {@link #FLAG_GRANT_READ_URI_PERMISSION} or 8398e6ac1d80055fa37b9b84029c7e751624ba7f84cFariborz Jahanian * {@link #FLAG_GRANT_WRITE_URI_PERMISSION}, then these flags will also be 8408e6ac1d80055fa37b9b84029c7e751624ba7f84cFariborz Jahanian * set in the returned chooser intent, with its ClipData set appropriately: 8418e6ac1d80055fa37b9b84029c7e751624ba7f84cFariborz Jahanian * either a direct reflection of {@link #getClipData()} if that is non-null, 8428e6ac1d80055fa37b9b84029c7e751624ba7f84cFariborz Jahanian * or a new ClipData build from {@link #getData()}. 8438e6ac1d80055fa37b9b84029c7e751624ba7f84cFariborz Jahanian * 8448e6ac1d80055fa37b9b84029c7e751624ba7f84cFariborz Jahanian * @param target The Intent that the user will be selecting an activity 8458e6ac1d80055fa37b9b84029c7e751624ba7f84cFariborz Jahanian * to perform. 8468a1d722f13df383600f36d77f842957c8adb5f1bArgyrios Kyrtzidis * @param title Optional title that will be displayed in the chooser. 8478a1d722f13df383600f36d77f842957c8adb5f1bArgyrios Kyrtzidis * @return Return a new Intent object that you can hand to 8488a1d722f13df383600f36d77f842957c8adb5f1bArgyrios Kyrtzidis * {@link Context#startActivity(Intent) Context.startActivity()} and 8498a1d722f13df383600f36d77f842957c8adb5f1bArgyrios Kyrtzidis * related methods. 8508a1d722f13df383600f36d77f842957c8adb5f1bArgyrios Kyrtzidis */ 8518a1d722f13df383600f36d77f842957c8adb5f1bArgyrios Kyrtzidis public static Intent createChooser(Intent target, CharSequence title) { 8528a1d722f13df383600f36d77f842957c8adb5f1bArgyrios Kyrtzidis Intent intent = new Intent(ACTION_CHOOSER); 8538a1d722f13df383600f36d77f842957c8adb5f1bArgyrios Kyrtzidis intent.putExtra(EXTRA_INTENT, target); 8548a1d722f13df383600f36d77f842957c8adb5f1bArgyrios Kyrtzidis if (title != null) { 8558a1d722f13df383600f36d77f842957c8adb5f1bArgyrios Kyrtzidis intent.putExtra(EXTRA_TITLE, title); 8568a1d722f13df383600f36d77f842957c8adb5f1bArgyrios Kyrtzidis } 8578a1d722f13df383600f36d77f842957c8adb5f1bArgyrios Kyrtzidis 8588a1d722f13df383600f36d77f842957c8adb5f1bArgyrios Kyrtzidis // Migrate any clip data and flags from target. 8598a1d722f13df383600f36d77f842957c8adb5f1bArgyrios Kyrtzidis int permFlags = target.getFlags() 8608a1d722f13df383600f36d77f842957c8adb5f1bArgyrios Kyrtzidis & (FLAG_GRANT_READ_URI_PERMISSION | FLAG_GRANT_WRITE_URI_PERMISSION); 8618a1d722f13df383600f36d77f842957c8adb5f1bArgyrios Kyrtzidis if (permFlags != 0) { 8628a1d722f13df383600f36d77f842957c8adb5f1bArgyrios Kyrtzidis ClipData targetClipData = target.getClipData(); 8638a1d722f13df383600f36d77f842957c8adb5f1bArgyrios Kyrtzidis if (targetClipData == null && target.getData() != null) { 8648a1d722f13df383600f36d77f842957c8adb5f1bArgyrios Kyrtzidis ClipData.Item item = new ClipData.Item(target.getData()); 8658a1d722f13df383600f36d77f842957c8adb5f1bArgyrios Kyrtzidis String[] mimeTypes; 8668a1d722f13df383600f36d77f842957c8adb5f1bArgyrios Kyrtzidis if (target.getType() != null) { 8678a1d722f13df383600f36d77f842957c8adb5f1bArgyrios Kyrtzidis mimeTypes = new String[] { target.getType() }; 8688a1d722f13df383600f36d77f842957c8adb5f1bArgyrios Kyrtzidis } else { 8698a1d722f13df383600f36d77f842957c8adb5f1bArgyrios Kyrtzidis mimeTypes = new String[] { }; 8708a1d722f13df383600f36d77f842957c8adb5f1bArgyrios Kyrtzidis } 8718a1d722f13df383600f36d77f842957c8adb5f1bArgyrios Kyrtzidis targetClipData = new ClipData(null, mimeTypes, item); 8728a1d722f13df383600f36d77f842957c8adb5f1bArgyrios Kyrtzidis } 8738a1d722f13df383600f36d77f842957c8adb5f1bArgyrios Kyrtzidis if (targetClipData != null) { 8748a1d722f13df383600f36d77f842957c8adb5f1bArgyrios Kyrtzidis intent.setClipData(targetClipData); 8758a1d722f13df383600f36d77f842957c8adb5f1bArgyrios Kyrtzidis intent.addFlags(permFlags); 876b2dbbb99e12806eaaf53b7ccabc32f42b5719443Daniel Dunbar } 877b2dbbb99e12806eaaf53b7ccabc32f42b5719443Daniel Dunbar } 878b2dbbb99e12806eaaf53b7ccabc32f42b5719443Daniel Dunbar 879b2dbbb99e12806eaaf53b7ccabc32f42b5719443Daniel Dunbar return intent; 880b2dbbb99e12806eaaf53b7ccabc32f42b5719443Daniel Dunbar } 88144a3dded8080c5c9cfdad208ade8f8f7850d9a4fDevang Patel 882b2dbbb99e12806eaaf53b7ccabc32f42b5719443Daniel Dunbar /** 883b2dbbb99e12806eaaf53b7ccabc32f42b5719443Daniel Dunbar * Activity Action: Allow the user to select a particular kind of data and 884532d4daa038d972240138e2fd6e1122517340833Daniel Dunbar * return it. This is different than {@link #ACTION_PICK} in that here we 885532d4daa038d972240138e2fd6e1122517340833Daniel Dunbar * just say what kind of data is desired, not a URI of existing data from 88644a3dded8080c5c9cfdad208ade8f8f7850d9a4fDevang Patel * which the user can pick. An ACTION_GET_CONTENT could allow the user to 887d8fd6ff0ea47ba63f836d0f4e6a1bee49863f64aDaniel Dunbar * create the data as it runs (for example taking a picture or recording a 888d8fd6ff0ea47ba63f836d0f4e6a1bee49863f64aDaniel Dunbar * sound), let them browse over the web and download the desired data, 889d8fd6ff0ea47ba63f836d0f4e6a1bee49863f64aDaniel Dunbar * etc. 890d8fd6ff0ea47ba63f836d0f4e6a1bee49863f64aDaniel Dunbar * <p> 89144a3dded8080c5c9cfdad208ade8f8f7850d9a4fDevang Patel * There are two main ways to use this action: if you want a specific kind 892453addbaea98f9678e2f9858057722a028f1ae3cDaniel Dunbar * of data, such as a person contact, you set the MIME type to the kind of 893453addbaea98f9678e2f9858057722a028f1ae3cDaniel Dunbar * data you want and launch it with {@link Context#startActivity(Intent)}. 89429445a0542d128cd7ee587ee52229670b9b54a12Anders Carlsson * The system will then launch the best application to select that kind 8958e6ac1d80055fa37b9b84029c7e751624ba7f84cFariborz Jahanian * of data for you. 8968e6ac1d80055fa37b9b84029c7e751624ba7f84cFariborz Jahanian * <p> 897d8fd6ff0ea47ba63f836d0f4e6a1bee49863f64aDaniel Dunbar * You may also be interested in any of a set of types of content the user 898453addbaea98f9678e2f9858057722a028f1ae3cDaniel Dunbar * can pick. For example, an e-mail application that wants to allow the 899453addbaea98f9678e2f9858057722a028f1ae3cDaniel Dunbar * user to add an attachment to an e-mail message can use this action to 900453addbaea98f9678e2f9858057722a028f1ae3cDaniel Dunbar * bring up a list of all of the types of content the user can attach. 9018e6ac1d80055fa37b9b84029c7e751624ba7f84cFariborz Jahanian * <p> 902453addbaea98f9678e2f9858057722a028f1ae3cDaniel Dunbar * In this case, you should wrap the GET_CONTENT intent with a chooser 903453addbaea98f9678e2f9858057722a028f1ae3cDaniel Dunbar * (through {@link #createChooser}), which will give the proper interface 904453addbaea98f9678e2f9858057722a028f1ae3cDaniel Dunbar * for the user to pick how to send your data and allow you to specify 90529445a0542d128cd7ee587ee52229670b9b54a12Anders Carlsson * a prompt indicating what they are doing. You will usually specify a 90629445a0542d128cd7ee587ee52229670b9b54a12Anders Carlsson * broad MIME type (such as image/* or {@literal *}/*), resulting in a 90729445a0542d128cd7ee587ee52229670b9b54a12Anders Carlsson * broad range of content types the user can select from. 90829445a0542d128cd7ee587ee52229670b9b54a12Anders Carlsson * <p> 90944a3dded8080c5c9cfdad208ade8f8f7850d9a4fDevang Patel * When using such a broad GET_CONTENT action, it is often desirable to 91044a3dded8080c5c9cfdad208ade8f8f7850d9a4fDevang Patel * only pick from data that can be represented as a stream. This is 91144a3dded8080c5c9cfdad208ade8f8f7850d9a4fDevang Patel * accomplished by requiring the {@link #CATEGORY_OPENABLE} in the Intent. 912b2dbbb99e12806eaaf53b7ccabc32f42b5719443Daniel Dunbar * <p> 913b2dbbb99e12806eaaf53b7ccabc32f42b5719443Daniel Dunbar * Callers can optionally specify {@link #EXTRA_LOCAL_ONLY} to request that 914b2dbbb99e12806eaaf53b7ccabc32f42b5719443Daniel Dunbar * the launched content chooser only returns results representing data that 915b2dbbb99e12806eaaf53b7ccabc32f42b5719443Daniel Dunbar * is locally available on the device. For example, if this extra is set 916b2dbbb99e12806eaaf53b7ccabc32f42b5719443Daniel Dunbar * to true then an image picker should not show any pictures that are available 917b2dbbb99e12806eaaf53b7ccabc32f42b5719443Daniel Dunbar * from a remote server but not already on the local device (thus requiring 918b2dbbb99e12806eaaf53b7ccabc32f42b5719443Daniel Dunbar * they be downloaded when opened). 919b2dbbb99e12806eaaf53b7ccabc32f42b5719443Daniel Dunbar * <p> 920b2dbbb99e12806eaaf53b7ccabc32f42b5719443Daniel Dunbar * If the caller can handle multiple returned items (the user performing 921b2dbbb99e12806eaaf53b7ccabc32f42b5719443Daniel Dunbar * multiple selection), then it can specify {@link #EXTRA_ALLOW_MULTIPLE} 92288a981b47c7face1b1fdaa9074256245107b9ca9Devang Patel * to indicate this. 923464175bba1318bef7905122e9fda20cff926df78Chris Lattner * <p> 924464175bba1318bef7905122e9fda20cff926df78Chris Lattner * Input: {@link #getType} is the desired MIME type to retrieve. Note 92598be4943e8dc4f3905629a7102668960873cf863Chris Lattner * that no URI is supplied in the intent, as there are no constraints on 9264b7c98378ae0c1a3635f0b7756848b4a9923f8bcTed Kremenek * where the returned data originally comes from. You may also include the 9274b7c98378ae0c1a3635f0b7756848b4a9923f8bcTed Kremenek * {@link #CATEGORY_OPENABLE} if you can only accept data that can be 9284bd998bbc228915d2b9cae5b67879de48940d05eEli Friedman * opened as a stream. You may use {@link #EXTRA_LOCAL_ONLY} to limit content 929464175bba1318bef7905122e9fda20cff926df78Chris Lattner * selection to local data. You may use {@link #EXTRA_ALLOW_MULTIPLE} to 930ab22c43320ae813e4f6214f48968216b7cb09b90Eli Friedman * allow the user to select multiple items. 931ab22c43320ae813e4f6214f48968216b7cb09b90Eli Friedman * <p> 932ab22c43320ae813e4f6214f48968216b7cb09b90Eli Friedman * Output: The URI of the item that was picked. This must be a content: 933464175bba1318bef7905122e9fda20cff926df78Chris Lattner * URI so that any receiver can access it. 9344bd998bbc228915d2b9cae5b67879de48940d05eEli Friedman */ 93529445a0542d128cd7ee587ee52229670b9b54a12Anders Carlsson @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 93629445a0542d128cd7ee587ee52229670b9b54a12Anders Carlsson public static final String ACTION_GET_CONTENT = "android.intent.action.GET_CONTENT"; 937ab22c43320ae813e4f6214f48968216b7cb09b90Eli Friedman /** 93829445a0542d128cd7ee587ee52229670b9b54a12Anders Carlsson * Activity Action: Dial a number as specified by the data. This shows a 9395d2a6303467184b1f159bb6556efc434e50e3c28Chris Lattner * UI with the number being dialed, allowing the user to explicitly 940464175bba1318bef7905122e9fda20cff926df78Chris Lattner * initiate the call. 941464175bba1318bef7905122e9fda20cff926df78Chris Lattner * <p>Input: If nothing, an empty dialer is started; else {@link #getData} 942a7674d8a9a69f3f6fe16e70cf2a3b2b15fb7c43dChris Lattner * is URI of a phone number to be dialed or a tel: URI of an explicit phone 943a7674d8a9a69f3f6fe16e70cf2a3b2b15fb7c43dChris Lattner * number. 944a7674d8a9a69f3f6fe16e70cf2a3b2b15fb7c43dChris Lattner * <p>Output: nothing. 945a7674d8a9a69f3f6fe16e70cf2a3b2b15fb7c43dChris Lattner */ 946f11284ac87daa613bc7b30db9f54bd716d123222Fariborz Jahanian @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 947f52ab250ff92bc51a9ac9a8e19bd43b63a5f844fChris Lattner public static final String ACTION_DIAL = "android.intent.action.DIAL"; 948f52ab250ff92bc51a9ac9a8e19bd43b63a5f844fChris Lattner /** 949f46699ce225811d8d9dbab9d00189a0e54469457Chris Lattner * Activity Action: Perform a call to someone specified by the data. 950b7d2553edd2532d29b98b9e76bcf6a62bc48b417Chris Lattner * <p>Input: If nothing, an empty dialer is started; else {@link #getData} 951b7d2553edd2532d29b98b9e76bcf6a62bc48b417Chris Lattner * is URI of a phone number to be dialed or a tel: URI of an explicit phone 952b7d2553edd2532d29b98b9e76bcf6a62bc48b417Chris Lattner * number. 953b7d2553edd2532d29b98b9e76bcf6a62bc48b417Chris Lattner * <p>Output: nothing. 954b7d2553edd2532d29b98b9e76bcf6a62bc48b417Chris Lattner * 955b7d2553edd2532d29b98b9e76bcf6a62bc48b417Chris Lattner * <p>Note: there will be restrictions on which applications can initiate a 956b7d2553edd2532d29b98b9e76bcf6a62bc48b417Chris Lattner * call; most applications should use the {@link #ACTION_DIAL}. 957b7d2553edd2532d29b98b9e76bcf6a62bc48b417Chris Lattner * <p>Note: this Intent <strong>cannot</strong> be used to call emergency 958b7d2553edd2532d29b98b9e76bcf6a62bc48b417Chris Lattner * numbers. Applications can <strong>dial</strong> emergency numbers using 959b7d2553edd2532d29b98b9e76bcf6a62bc48b417Chris Lattner * {@link #ACTION_DIAL}, however. 960b7d2553edd2532d29b98b9e76bcf6a62bc48b417Chris Lattner */ 961b7d2553edd2532d29b98b9e76bcf6a62bc48b417Chris Lattner @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 962b7d2553edd2532d29b98b9e76bcf6a62bc48b417Chris Lattner public static final String ACTION_CALL = "android.intent.action.CALL"; 963b7d2553edd2532d29b98b9e76bcf6a62bc48b417Chris Lattner /** 964b7d2553edd2532d29b98b9e76bcf6a62bc48b417Chris Lattner * Activity Action: Perform a call to an emergency number specified by the 965f46699ce225811d8d9dbab9d00189a0e54469457Chris Lattner * data. 966b7d2553edd2532d29b98b9e76bcf6a62bc48b417Chris Lattner * <p>Input: {@link #getData} is URI of a phone number to be dialed or a 967ebb97e98c03f8d7034bd3748a10e35f39a95c289Christopher Lamb * tel: URI of an explicit phone number. 9682455636163fdd18581d7fdae816433f886d88213Mike Stump * <p>Output: nothing. 969ebb97e98c03f8d7034bd3748a10e35f39a95c289Christopher Lamb * @hide 970f11284ac87daa613bc7b30db9f54bd716d123222Fariborz Jahanian */ 971b7d2553edd2532d29b98b9e76bcf6a62bc48b417Chris Lattner public static final String ACTION_CALL_EMERGENCY = "android.intent.action.CALL_EMERGENCY"; 972b7d2553edd2532d29b98b9e76bcf6a62bc48b417Chris Lattner /** 973ebb97e98c03f8d7034bd3748a10e35f39a95c289Christopher Lamb * Activity action: Perform a call to any number (emergency or not) 974ebb97e98c03f8d7034bd3748a10e35f39a95c289Christopher Lamb * specified by the data. 975ebb97e98c03f8d7034bd3748a10e35f39a95c289Christopher Lamb * <p>Input: {@link #getData} is URI of a phone number to be dialed or a 976b7d2553edd2532d29b98b9e76bcf6a62bc48b417Chris Lattner * tel: URI of an explicit phone number. 977f11284ac87daa613bc7b30db9f54bd716d123222Fariborz Jahanian * <p>Output: nothing. 978ebb97e98c03f8d7034bd3748a10e35f39a95c289Christopher Lamb * @hide 979b7d2553edd2532d29b98b9e76bcf6a62bc48b417Chris Lattner */ 980f11284ac87daa613bc7b30db9f54bd716d123222Fariborz Jahanian public static final String ACTION_CALL_PRIVILEGED = "android.intent.action.CALL_PRIVILEGED"; 981f6e764fe722440eaed18dad9eeff3d7e89a4d7afChris Lattner /** 982ebb97e98c03f8d7034bd3748a10e35f39a95c289Christopher Lamb * Activity Action: Send a message to someone specified by the data. 983b7d2553edd2532d29b98b9e76bcf6a62bc48b417Chris Lattner * <p>Input: {@link #getData} is URI describing the target. 984b7d2553edd2532d29b98b9e76bcf6a62bc48b417Chris Lattner * <p>Output: nothing. 985f11284ac87daa613bc7b30db9f54bd716d123222Fariborz Jahanian */ 986ebb97e98c03f8d7034bd3748a10e35f39a95c289Christopher Lamb @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 987b7d2553edd2532d29b98b9e76bcf6a62bc48b417Chris Lattner public static final String ACTION_SENDTO = "android.intent.action.SENDTO"; 988ebb97e98c03f8d7034bd3748a10e35f39a95c289Christopher Lamb /** 989ebb97e98c03f8d7034bd3748a10e35f39a95c289Christopher Lamb * Activity Action: Deliver some data to someone else. Who the data is 990b7d2553edd2532d29b98b9e76bcf6a62bc48b417Chris Lattner * being delivered to is not specified; it is up to the receiver of this 991b7d2553edd2532d29b98b9e76bcf6a62bc48b417Chris Lattner * action to ask the user where the data should be sent. 992d33d9c0cc0cfdcd0b10f35a6acdfb25da4a64f19Fariborz Jahanian * <p> 993b7d2553edd2532d29b98b9e76bcf6a62bc48b417Chris Lattner * When launching a SEND intent, you should usually wrap it in a chooser 994d33d9c0cc0cfdcd0b10f35a6acdfb25da4a64f19Fariborz Jahanian * (through {@link #createChooser}), which will give the proper interface 995d33d9c0cc0cfdcd0b10f35a6acdfb25da4a64f19Fariborz Jahanian * for the user to pick how to send your data and allow you to specify 9964027cd1b924e29784a49085b1717f35cdd719146Fariborz Jahanian * a prompt indicating what they are doing. 99735366a67baa970c287c714c957cf78a4131cf60dTed Kremenek * <p> 99858f9f2c884af6b72d036b746a016d8031d31cb7aSteve Naroff * Input: {@link #getType} is the MIME type of the data being sent. 9994027cd1b924e29784a49085b1717f35cdd719146Fariborz Jahanian * get*Extra can have either a {@link #EXTRA_TEXT} 10004027cd1b924e29784a49085b1717f35cdd719146Fariborz Jahanian * or {@link #EXTRA_STREAM} field, containing the data to be sent. If 10014027cd1b924e29784a49085b1717f35cdd719146Fariborz Jahanian * using EXTRA_TEXT, the MIME type should be "text/plain"; otherwise it 10024027cd1b924e29784a49085b1717f35cdd719146Fariborz Jahanian * should be the MIME type of the data in EXTRA_STREAM. Use {@literal *}/* 1003b7d2553edd2532d29b98b9e76bcf6a62bc48b417Chris Lattner * if the MIME type is unknown (this will only allow senders that can 1004b7d2553edd2532d29b98b9e76bcf6a62bc48b417Chris Lattner * handle generic data streams). If using {@link #EXTRA_TEXT}, you can 1005b7d2553edd2532d29b98b9e76bcf6a62bc48b417Chris Lattner * also optionally supply {@link #EXTRA_HTML_TEXT} for clients to retrieve 1006b7d2553edd2532d29b98b9e76bcf6a62bc48b417Chris Lattner * your text with HTML formatting. 1007b7d2553edd2532d29b98b9e76bcf6a62bc48b417Chris Lattner * <p> 1008b7d2553edd2532d29b98b9e76bcf6a62bc48b417Chris Lattner * As of {@link android.os.Build.VERSION_CODES#JELLY_BEAN}, the data 1009b7d2553edd2532d29b98b9e76bcf6a62bc48b417Chris Lattner * being sent can be supplied through {@link #setClipData(ClipData)}. This 10102455636163fdd18581d7fdae816433f886d88213Mike Stump * allows you to use {@link #FLAG_GRANT_READ_URI_PERMISSION} when sharing 1011b7d2553edd2532d29b98b9e76bcf6a62bc48b417Chris Lattner * content: URIs and other advanced features of {@link ClipData}. If 1012b7d2553edd2532d29b98b9e76bcf6a62bc48b417Chris Lattner * using this approach, you still must supply the same data through the 10132455636163fdd18581d7fdae816433f886d88213Mike Stump * {@link #EXTRA_TEXT} or {@link #EXTRA_STREAM} fields described below 1014b7d2553edd2532d29b98b9e76bcf6a62bc48b417Chris Lattner * for compatibility with old applications. If you don't set a ClipData, 1015b7d2553edd2532d29b98b9e76bcf6a62bc48b417Chris Lattner * it will be copied there for you when calling {@link Context#startActivity(Intent)}. 1016b7d2553edd2532d29b98b9e76bcf6a62bc48b417Chris Lattner * <p> 1017d33d9c0cc0cfdcd0b10f35a6acdfb25da4a64f19Fariborz Jahanian * Optional standard extras, which may be interpreted by some recipients as 1018d33d9c0cc0cfdcd0b10f35a6acdfb25da4a64f19Fariborz Jahanian * appropriate, are: {@link #EXTRA_EMAIL}, {@link #EXTRA_CC}, 1019d33d9c0cc0cfdcd0b10f35a6acdfb25da4a64f19Fariborz Jahanian * {@link #EXTRA_BCC}, {@link #EXTRA_SUBJECT}. 10202455636163fdd18581d7fdae816433f886d88213Mike Stump * <p> 1021d33d9c0cc0cfdcd0b10f35a6acdfb25da4a64f19Fariborz Jahanian * Output: nothing. 1022d33d9c0cc0cfdcd0b10f35a6acdfb25da4a64f19Fariborz Jahanian */ 1023b7d2553edd2532d29b98b9e76bcf6a62bc48b417Chris Lattner @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1024d33d9c0cc0cfdcd0b10f35a6acdfb25da4a64f19Fariborz Jahanian public static final String ACTION_SEND = "android.intent.action.SEND"; 1025d33d9c0cc0cfdcd0b10f35a6acdfb25da4a64f19Fariborz Jahanian /** 1026d33d9c0cc0cfdcd0b10f35a6acdfb25da4a64f19Fariborz Jahanian * Activity Action: Deliver multiple data to someone else. 10275a61f0e5c5aaecd5713c3fa4b78be7167a7eeff2Eli Friedman * <p> 10285a61f0e5c5aaecd5713c3fa4b78be7167a7eeff2Eli Friedman * Like {@link #ACTION_SEND}, except the data is multiple. 1029d33d9c0cc0cfdcd0b10f35a6acdfb25da4a64f19Fariborz Jahanian * <p> 1030d33d9c0cc0cfdcd0b10f35a6acdfb25da4a64f19Fariborz Jahanian * Input: {@link #getType} is the MIME type of the data being sent. 1031b7d2553edd2532d29b98b9e76bcf6a62bc48b417Chris Lattner * get*ArrayListExtra can have either a {@link #EXTRA_TEXT} or {@link 1032d33d9c0cc0cfdcd0b10f35a6acdfb25da4a64f19Fariborz Jahanian * #EXTRA_STREAM} field, containing the data to be sent. If using 1033b7d2553edd2532d29b98b9e76bcf6a62bc48b417Chris Lattner * {@link #EXTRA_TEXT}, you can also optionally supply {@link #EXTRA_HTML_TEXT} 1034d33d9c0cc0cfdcd0b10f35a6acdfb25da4a64f19Fariborz Jahanian * for clients to retrieve your text with HTML formatting. 1035d33d9c0cc0cfdcd0b10f35a6acdfb25da4a64f19Fariborz Jahanian * <p> 1036d33d9c0cc0cfdcd0b10f35a6acdfb25da4a64f19Fariborz Jahanian * Multiple types are supported, and receivers should handle mixed types 1037b7d2553edd2532d29b98b9e76bcf6a62bc48b417Chris Lattner * whenever possible. The right way for the receiver to check them is to 1038b7d2553edd2532d29b98b9e76bcf6a62bc48b417Chris Lattner * use the content resolver on each URI. The intent sender should try to 1039d33d9c0cc0cfdcd0b10f35a6acdfb25da4a64f19Fariborz Jahanian * put the most concrete mime type in the intent type, but it can fall 1040d33d9c0cc0cfdcd0b10f35a6acdfb25da4a64f19Fariborz Jahanian * back to {@literal <type>/*} or {@literal *}/* as needed. 1041b7d2553edd2532d29b98b9e76bcf6a62bc48b417Chris Lattner * <p> 1042d33d9c0cc0cfdcd0b10f35a6acdfb25da4a64f19Fariborz Jahanian * e.g. if you are sending image/jpg and image/jpg, the intent's type can 1043a7674d8a9a69f3f6fe16e70cf2a3b2b15fb7c43dChris Lattner * be image/jpg, but if you are sending image/jpg and image/png, then the 10442455636163fdd18581d7fdae816433f886d88213Mike Stump * intent's type should be image/*. 10456dcbc294f9b2c45680dd3227e885712c2814ec0eMike Stump * <p> 10466dcbc294f9b2c45680dd3227e885712c2814ec0eMike Stump * As of {@link android.os.Build.VERSION_CODES#JELLY_BEAN}, the data 10472455636163fdd18581d7fdae816433f886d88213Mike Stump * being sent can be supplied through {@link #setClipData(ClipData)}. This 10482455636163fdd18581d7fdae816433f886d88213Mike Stump * allows you to use {@link #FLAG_GRANT_READ_URI_PERMISSION} when sharing 10492455636163fdd18581d7fdae816433f886d88213Mike Stump * content: URIs and other advanced features of {@link ClipData}. If 10506dcbc294f9b2c45680dd3227e885712c2814ec0eMike Stump * using this approach, you still must supply the same data through the 10516dcbc294f9b2c45680dd3227e885712c2814ec0eMike Stump * {@link #EXTRA_TEXT} or {@link #EXTRA_STREAM} fields described below 10526dcbc294f9b2c45680dd3227e885712c2814ec0eMike Stump * for compatibility with old applications. If you don't set a ClipData, 10532455636163fdd18581d7fdae816433f886d88213Mike Stump * it will be copied there for you when calling {@link Context#startActivity(Intent)}. 10542455636163fdd18581d7fdae816433f886d88213Mike Stump * <p> 10552455636163fdd18581d7fdae816433f886d88213Mike Stump * Optional standard extras, which may be interpreted by some recipients as 10562455636163fdd18581d7fdae816433f886d88213Mike Stump * appropriate, are: {@link #EXTRA_EMAIL}, {@link #EXTRA_CC}, 10576dcbc294f9b2c45680dd3227e885712c2814ec0eMike Stump * {@link #EXTRA_BCC}, {@link #EXTRA_SUBJECT}. 10586dcbc294f9b2c45680dd3227e885712c2814ec0eMike Stump * <p> 10596dcbc294f9b2c45680dd3227e885712c2814ec0eMike Stump * Output: nothing. 10602455636163fdd18581d7fdae816433f886d88213Mike Stump */ 10612455636163fdd18581d7fdae816433f886d88213Mike Stump @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 10622455636163fdd18581d7fdae816433f886d88213Mike Stump public static final String ACTION_SEND_MULTIPLE = "android.intent.action.SEND_MULTIPLE"; 10632455636163fdd18581d7fdae816433f886d88213Mike Stump /** 1064e24aea225ec87b935ede6c21c964dd47a4afb810Mike Stump * Activity Action: Handle an incoming phone call. 10652455636163fdd18581d7fdae816433f886d88213Mike Stump * <p>Input: nothing. 10662455636163fdd18581d7fdae816433f886d88213Mike Stump * <p>Output: nothing. 1067e24aea225ec87b935ede6c21c964dd47a4afb810Mike Stump */ 10682455636163fdd18581d7fdae816433f886d88213Mike Stump @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 10692455636163fdd18581d7fdae816433f886d88213Mike Stump public static final String ACTION_ANSWER = "android.intent.action.ANSWER"; 10702455636163fdd18581d7fdae816433f886d88213Mike Stump /** 10712455636163fdd18581d7fdae816433f886d88213Mike Stump * Activity Action: Insert an empty item into the given container. 10722455636163fdd18581d7fdae816433f886d88213Mike Stump * <p>Input: {@link #getData} is URI of the directory (vnd.android.cursor.dir/*) 10732455636163fdd18581d7fdae816433f886d88213Mike Stump * in which to place the data. 10745f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * <p>Output: URI of the new data that was created. 10755f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer */ 10765f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 10775f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer public static final String ACTION_INSERT = "android.intent.action.INSERT"; 10785f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer /** 10795f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * Activity Action: Create a new item in the given container, initializing it 10805f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * from the current contents of the clipboard. 10815f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * <p>Input: {@link #getData} is URI of the directory (vnd.android.cursor.dir/*) 10825f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * in which to place the data. 10835f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * <p>Output: URI of the new data that was created. 10845f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer */ 10855f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 10865f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer public static final String ACTION_PASTE = "android.intent.action.PASTE"; 10875f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer /** 10885f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * Activity Action: Delete the given data from its container. 10895f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * <p>Input: {@link #getData} is URI of data to be deleted. 1090f52ab250ff92bc51a9ac9a8e19bd43b63a5f844fChris Lattner * <p>Output: nothing. 10915f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer */ 10925f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 10935f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer public static final String ACTION_DELETE = "android.intent.action.DELETE"; 1094f6e764fe722440eaed18dad9eeff3d7e89a4d7afChris Lattner /** 10955f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * Activity Action: Run the data, whatever that means. 1096f83820bd7a0dc4c253071b31c443a316a49ce5aaSteve Naroff * <p>Input: ? (Note: this is currently specific to the test harness.) 10975f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * <p>Output: nothing. 10985f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer */ 10995f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 11005f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer public static final String ACTION_RUN = "android.intent.action.RUN"; 11015f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer /** 1102f98aba35e6c3da5aae61843fc01334939e4e12ecEli Friedman * Activity Action: Perform a data synchronization. 1103f98aba35e6c3da5aae61843fc01334939e4e12ecEli Friedman * <p>Input: ? 1104f98aba35e6c3da5aae61843fc01334939e4e12ecEli Friedman * <p>Output: ? 1105f98aba35e6c3da5aae61843fc01334939e4e12ecEli Friedman */ 1106f98aba35e6c3da5aae61843fc01334939e4e12ecEli Friedman @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1107f98aba35e6c3da5aae61843fc01334939e4e12ecEli Friedman public static final String ACTION_SYNC = "android.intent.action.SYNC"; 1108f98aba35e6c3da5aae61843fc01334939e4e12ecEli Friedman /** 1109f98aba35e6c3da5aae61843fc01334939e4e12ecEli Friedman * Activity Action: Pick an activity given an intent, returning the class 11105f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * selected. 11115f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * <p>Input: get*Extra field {@link #EXTRA_INTENT} is an Intent 11125f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * used with {@link PackageManager#queryIntentActivities} to determine the 11135f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * set of activities from which to pick. 11145f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * <p>Output: Class name of the activity that was selected. 11155f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer */ 11165f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 11175f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer public static final String ACTION_PICK_ACTIVITY = "android.intent.action.PICK_ACTIVITY"; 11185f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer /** 11195f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * Activity Action: Perform a search. 11205f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * <p>Input: {@link android.app.SearchManager#QUERY getStringExtra(SearchManager.QUERY)} 11215f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * is the text to search for. If empty, simply 11225f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * enter your search results Activity with the search UI activated. 11235f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * <p>Output: nothing. 11245f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer */ 11255f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 11265f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer public static final String ACTION_SEARCH = "android.intent.action.SEARCH"; 1127f52ab250ff92bc51a9ac9a8e19bd43b63a5f844fChris Lattner /** 11285f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * Activity Action: Start the platform-defined tutorial 11295f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * <p>Input: {@link android.app.SearchManager#QUERY getStringExtra(SearchManager.QUERY)} 11305f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * is the text to search for. If empty, simply 1131f6e764fe722440eaed18dad9eeff3d7e89a4d7afChris Lattner * enter your search results Activity with the search UI activated. 11325f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * <p>Output: nothing. 1133f83820bd7a0dc4c253071b31c443a316a49ce5aaSteve Naroff */ 11345f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 11355f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer public static final String ACTION_SYSTEM_TUTORIAL = "android.intent.action.SYSTEM_TUTORIAL"; 11365f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer /** 11375f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * Activity Action: Perform a web search. 11385f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * <p> 11395618bd4a52c45fbbb605e3ba885663b2164db8a3Steve Naroff * Input: {@link android.app.SearchManager#QUERY 11405618bd4a52c45fbbb605e3ba885663b2164db8a3Steve Naroff * getStringExtra(SearchManager.QUERY)} is the text to search for. If it is 11415618bd4a52c45fbbb605e3ba885663b2164db8a3Steve Naroff * a url starts with http or https, the site will be opened. If it is plain 1142296e8d5fdcf9946f51e866adc8d281379e51efe9Steve Naroff * text, Google search will be applied. 1143296e8d5fdcf9946f51e866adc8d281379e51efe9Steve Naroff * <p> 11445618bd4a52c45fbbb605e3ba885663b2164db8a3Steve Naroff * Output: nothing. 11455618bd4a52c45fbbb605e3ba885663b2164db8a3Steve Naroff */ 11465618bd4a52c45fbbb605e3ba885663b2164db8a3Steve Naroff @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 11475618bd4a52c45fbbb605e3ba885663b2164db8a3Steve Naroff public static final String ACTION_WEB_SEARCH = "android.intent.action.WEB_SEARCH"; 11485618bd4a52c45fbbb605e3ba885663b2164db8a3Steve Naroff 11495618bd4a52c45fbbb605e3ba885663b2164db8a3Steve Naroff /** 11505618bd4a52c45fbbb605e3ba885663b2164db8a3Steve Naroff * Activity Action: Perform assist action. 11515618bd4a52c45fbbb605e3ba885663b2164db8a3Steve Naroff * <p> 11525618bd4a52c45fbbb605e3ba885663b2164db8a3Steve Naroff * Input: {@link #EXTRA_ASSIST_PACKAGE} and {@link #EXTRA_ASSIST_CONTEXT} can provide 1153296e8d5fdcf9946f51e866adc8d281379e51efe9Steve Naroff * additional optional contextual information about where the user was when they requested 11545618bd4a52c45fbbb605e3ba885663b2164db8a3Steve Naroff * the assist. 11555618bd4a52c45fbbb605e3ba885663b2164db8a3Steve Naroff * Output: nothing. 11565618bd4a52c45fbbb605e3ba885663b2164db8a3Steve Naroff */ 11575618bd4a52c45fbbb605e3ba885663b2164db8a3Steve Naroff @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 11585618bd4a52c45fbbb605e3ba885663b2164db8a3Steve Naroff public static final String ACTION_ASSIST = "android.intent.action.ASSIST"; 11595618bd4a52c45fbbb605e3ba885663b2164db8a3Steve Naroff 11605618bd4a52c45fbbb605e3ba885663b2164db8a3Steve Naroff /** 11615618bd4a52c45fbbb605e3ba885663b2164db8a3Steve Naroff * An optional field on {@link #ACTION_ASSIST} containing the name of the current 1162f6e764fe722440eaed18dad9eeff3d7e89a4d7afChris Lattner * foreground application package at the time the assist was invoked. 11635618bd4a52c45fbbb605e3ba885663b2164db8a3Steve Naroff */ 1164f83820bd7a0dc4c253071b31c443a316a49ce5aaSteve Naroff public static final String EXTRA_ASSIST_PACKAGE 11655618bd4a52c45fbbb605e3ba885663b2164db8a3Steve Naroff = "android.intent.extra.ASSIST_PACKAGE"; 11665618bd4a52c45fbbb605e3ba885663b2164db8a3Steve Naroff 11675618bd4a52c45fbbb605e3ba885663b2164db8a3Steve Naroff /** 11685618bd4a52c45fbbb605e3ba885663b2164db8a3Steve Naroff * An optional field on {@link #ACTION_ASSIST} containing additional contextual 11695618bd4a52c45fbbb605e3ba885663b2164db8a3Steve Naroff * information supplied by the current foreground app at the time of the assist 11707c80bd64032e610c0dbd74fc0ef6ea334447f2fdSebastian Redl * request. This is a {@link Bundle} of additional data. 11717c80bd64032e610c0dbd74fc0ef6ea334447f2fdSebastian Redl */ 11727c80bd64032e610c0dbd74fc0ef6ea334447f2fdSebastian Redl public static final String EXTRA_ASSIST_CONTEXT 11735f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer = "android.intent.extra.ASSIST_CONTEXT"; 11745f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer 11755f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer /** 11765f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * Activity Action: List all available applications 11775f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * <p>Input: Nothing. 11785f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * <p>Output: nothing. 11797c80bd64032e610c0dbd74fc0ef6ea334447f2fdSebastian Redl */ 11807c80bd64032e610c0dbd74fc0ef6ea334447f2fdSebastian Redl @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 11815f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer public static final String ACTION_ALL_APPS = "android.intent.action.ALL_APPS"; 11827c80bd64032e610c0dbd74fc0ef6ea334447f2fdSebastian Redl /** 11835f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * Activity Action: Show settings for choosing wallpaper 11845f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * <p>Input: Nothing. 11855f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * <p>Output: Nothing. 11865f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer */ 11877c80bd64032e610c0dbd74fc0ef6ea334447f2fdSebastian Redl @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 11887c80bd64032e610c0dbd74fc0ef6ea334447f2fdSebastian Redl public static final String ACTION_SET_WALLPAPER = "android.intent.action.SET_WALLPAPER"; 11897c80bd64032e610c0dbd74fc0ef6ea334447f2fdSebastian Redl 11907c80bd64032e610c0dbd74fc0ef6ea334447f2fdSebastian Redl /** 11917c80bd64032e610c0dbd74fc0ef6ea334447f2fdSebastian Redl * Activity Action: Show activity for reporting a bug. 11927c80bd64032e610c0dbd74fc0ef6ea334447f2fdSebastian Redl * <p>Input: Nothing. 11937c80bd64032e610c0dbd74fc0ef6ea334447f2fdSebastian Redl * <p>Output: Nothing. 11947c80bd64032e610c0dbd74fc0ef6ea334447f2fdSebastian Redl */ 11957c80bd64032e610c0dbd74fc0ef6ea334447f2fdSebastian Redl @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 11967c80bd64032e610c0dbd74fc0ef6ea334447f2fdSebastian Redl public static final String ACTION_BUG_REPORT = "android.intent.action.BUG_REPORT"; 11977c80bd64032e610c0dbd74fc0ef6ea334447f2fdSebastian Redl 11987c80bd64032e610c0dbd74fc0ef6ea334447f2fdSebastian Redl /** 11997c80bd64032e610c0dbd74fc0ef6ea334447f2fdSebastian Redl * Activity Action: Main entry point for factory tests. Only used when 12007c80bd64032e610c0dbd74fc0ef6ea334447f2fdSebastian Redl * the device is booting in factory test node. The implementing package 12017c80bd64032e610c0dbd74fc0ef6ea334447f2fdSebastian Redl * must be installed in the system image. 12027c80bd64032e610c0dbd74fc0ef6ea334447f2fdSebastian Redl * <p>Input: nothing 12037c80bd64032e610c0dbd74fc0ef6ea334447f2fdSebastian Redl * <p>Output: nothing 12047c80bd64032e610c0dbd74fc0ef6ea334447f2fdSebastian Redl */ 12057c80bd64032e610c0dbd74fc0ef6ea334447f2fdSebastian Redl public static final String ACTION_FACTORY_TEST = "android.intent.action.FACTORY_TEST"; 12067c80bd64032e610c0dbd74fc0ef6ea334447f2fdSebastian Redl 12077c80bd64032e610c0dbd74fc0ef6ea334447f2fdSebastian Redl /** 12087c80bd64032e610c0dbd74fc0ef6ea334447f2fdSebastian Redl * Activity Action: The user pressed the "call" button to go to the dialer 12097c80bd64032e610c0dbd74fc0ef6ea334447f2fdSebastian Redl * or other appropriate UI for placing a call. 12107c80bd64032e610c0dbd74fc0ef6ea334447f2fdSebastian Redl * <p>Input: Nothing. 12117c80bd64032e610c0dbd74fc0ef6ea334447f2fdSebastian Redl * <p>Output: Nothing. 12127c80bd64032e610c0dbd74fc0ef6ea334447f2fdSebastian Redl */ 12137c80bd64032e610c0dbd74fc0ef6ea334447f2fdSebastian Redl @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 12147c80bd64032e610c0dbd74fc0ef6ea334447f2fdSebastian Redl public static final String ACTION_CALL_BUTTON = "android.intent.action.CALL_BUTTON"; 12157c80bd64032e610c0dbd74fc0ef6ea334447f2fdSebastian Redl 12167c80bd64032e610c0dbd74fc0ef6ea334447f2fdSebastian Redl /** 12177c80bd64032e610c0dbd74fc0ef6ea334447f2fdSebastian Redl * Activity Action: Start Voice Command. 12187c80bd64032e610c0dbd74fc0ef6ea334447f2fdSebastian Redl * <p>Input: Nothing. 12197c80bd64032e610c0dbd74fc0ef6ea334447f2fdSebastian Redl * <p>Output: Nothing. 12205f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer */ 12217c80bd64032e610c0dbd74fc0ef6ea334447f2fdSebastian Redl @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 12227c80bd64032e610c0dbd74fc0ef6ea334447f2fdSebastian Redl public static final String ACTION_VOICE_COMMAND = "android.intent.action.VOICE_COMMAND"; 1223f6e764fe722440eaed18dad9eeff3d7e89a4d7afChris Lattner 12245f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer /** 12255f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * Activity Action: Start action associated with long pressing on the 12267c80bd64032e610c0dbd74fc0ef6ea334447f2fdSebastian Redl * search key. 12275f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * <p>Input: Nothing. 12287c80bd64032e610c0dbd74fc0ef6ea334447f2fdSebastian Redl * <p>Output: Nothing. 12295f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer */ 12305f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 12315f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer public static final String ACTION_SEARCH_LONG_PRESS = "android.intent.action.SEARCH_LONG_PRESS"; 1232f30208ad5b334e93582e846a2a0c92f38a607b8aSebastian Redl 1233f30208ad5b334e93582e846a2a0c92f38a607b8aSebastian Redl /** 1234f30208ad5b334e93582e846a2a0c92f38a607b8aSebastian Redl * Activity Action: The user pressed the "Report" button in the crash/ANR dialog. 1235f30208ad5b334e93582e846a2a0c92f38a607b8aSebastian Redl * This intent is delivered to the package which installed the application, usually 1236f30208ad5b334e93582e846a2a0c92f38a607b8aSebastian Redl * Google Play. 1237f30208ad5b334e93582e846a2a0c92f38a607b8aSebastian Redl * <p>Input: No data is specified. The bug report is passed in using 1238f30208ad5b334e93582e846a2a0c92f38a607b8aSebastian Redl * an {@link #EXTRA_BUG_REPORT} field. 1239f30208ad5b334e93582e846a2a0c92f38a607b8aSebastian Redl * <p>Output: Nothing. 1240f30208ad5b334e93582e846a2a0c92f38a607b8aSebastian Redl * 1241f30208ad5b334e93582e846a2a0c92f38a607b8aSebastian Redl * @see #EXTRA_BUG_REPORT 1242f30208ad5b334e93582e846a2a0c92f38a607b8aSebastian Redl */ 1243f30208ad5b334e93582e846a2a0c92f38a607b8aSebastian Redl @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1244f30208ad5b334e93582e846a2a0c92f38a607b8aSebastian Redl public static final String ACTION_APP_ERROR = "android.intent.action.APP_ERROR"; 1245f30208ad5b334e93582e846a2a0c92f38a607b8aSebastian Redl 1246f30208ad5b334e93582e846a2a0c92f38a607b8aSebastian Redl /** 1247f30208ad5b334e93582e846a2a0c92f38a607b8aSebastian Redl * Activity Action: Show power usage information to the user. 1248f30208ad5b334e93582e846a2a0c92f38a607b8aSebastian Redl * <p>Input: Nothing. 1249f30208ad5b334e93582e846a2a0c92f38a607b8aSebastian Redl * <p>Output: Nothing. 1250f30208ad5b334e93582e846a2a0c92f38a607b8aSebastian Redl */ 1251f30208ad5b334e93582e846a2a0c92f38a607b8aSebastian Redl @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 1252f30208ad5b334e93582e846a2a0c92f38a607b8aSebastian Redl public static final String ACTION_POWER_USAGE_SUMMARY = "android.intent.action.POWER_USAGE_SUMMARY"; 1253f30208ad5b334e93582e846a2a0c92f38a607b8aSebastian Redl 1254f30208ad5b334e93582e846a2a0c92f38a607b8aSebastian Redl /** 1255f30208ad5b334e93582e846a2a0c92f38a607b8aSebastian Redl * Activity Action: Setup wizard to launch after a platform update. This 1256f30208ad5b334e93582e846a2a0c92f38a607b8aSebastian Redl * activity should have a string meta-data field associated with it, 1257f83820bd7a0dc4c253071b31c443a316a49ce5aaSteve Naroff * {@link #METADATA_SETUP_VERSION}, which defines the current version of 1258f30208ad5b334e93582e846a2a0c92f38a607b8aSebastian Redl * the platform for setup. The activity will be launched only if 1259f30208ad5b334e93582e846a2a0c92f38a607b8aSebastian Redl * {@link android.provider.Settings.Secure#LAST_SETUP_SHOWN} is not the 1260f30208ad5b334e93582e846a2a0c92f38a607b8aSebastian Redl * same value. 1261f30208ad5b334e93582e846a2a0c92f38a607b8aSebastian Redl * <p>Input: Nothing. 1262f30208ad5b334e93582e846a2a0c92f38a607b8aSebastian Redl * <p>Output: Nothing. 1263fb22d96692c5240fb8d611290dbf7eeed3759c73Steve Naroff * @hide 1264fb22d96692c5240fb8d611290dbf7eeed3759c73Steve Naroff */ 1265fb22d96692c5240fb8d611290dbf7eeed3759c73Steve Naroff @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 126638aeec7299c48cb79523f7f89776fb258c84aeeaChris Lattner public static final String ACTION_UPGRADE_SETUP = "android.intent.action.UPGRADE_SETUP"; 1267c9406125e2cac9208098655ac8058c095c2c3a65Steve Naroff 1268c9406125e2cac9208098655ac8058c095c2c3a65Steve Naroff /** 1269587cbdfd95f4b0aaccc14b31f5debe85d5daf7edEli Friedman * Activity Action: Show settings for managing network data usage of a 1270587cbdfd95f4b0aaccc14b31f5debe85d5daf7edEli Friedman * specific application. Applications should define an activity that offers 1271587cbdfd95f4b0aaccc14b31f5debe85d5daf7edEli Friedman * options to control data usage. 127238aeec7299c48cb79523f7f89776fb258c84aeeaChris Lattner */ 127338aeec7299c48cb79523f7f89776fb258c84aeeaChris Lattner @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 127438aeec7299c48cb79523f7f89776fb258c84aeeaChris Lattner public static final String ACTION_MANAGE_NETWORK_USAGE = 127538aeec7299c48cb79523f7f89776fb258c84aeeaChris Lattner "android.intent.action.MANAGE_NETWORK_USAGE"; 127638aeec7299c48cb79523f7f89776fb258c84aeeaChris Lattner 12775f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer /** 12780be2ef2321b1283ead38ebeb83b451335d90e0feChris Lattner * Activity Action: Launch application installer. 12795f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * <p> 12805f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * Input: The data must be a content: or file: URI at which the application 12817192f8e9592729882a09d84d77838db26e39ebd4Ted Kremenek * can be retrieved. As of {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR1}, 12827192f8e9592729882a09d84d77838db26e39ebd4Ted Kremenek * you can also use "package:<package-name>" to install an application for the 12835f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * current user that is already installed for another user. You can optionally supply 12845f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * {@link #EXTRA_INSTALLER_PACKAGE_NAME}, {@link #EXTRA_NOT_UNKNOWN_SOURCE}, 12855f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * {@link #EXTRA_ALLOW_REPLACE}, and {@link #EXTRA_RETURN_RESULT}. 12865f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * <p> 12875f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * Output: If {@link #EXTRA_RETURN_RESULT}, returns whether the install 12885f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * succeeded. 1289f52ab250ff92bc51a9ac9a8e19bd43b63a5f844fChris Lattner * 1290c9406125e2cac9208098655ac8058c095c2c3a65Steve Naroff * @see #EXTRA_INSTALLER_PACKAGE_NAME 12915f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * @see #EXTRA_NOT_UNKNOWN_SOURCE 12927192f8e9592729882a09d84d77838db26e39ebd4Ted Kremenek * @see #EXTRA_RETURN_RESULT 12937192f8e9592729882a09d84d77838db26e39ebd4Ted Kremenek */ 1294f6e764fe722440eaed18dad9eeff3d7e89a4d7afChris Lattner @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 12955f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer public static final String ACTION_INSTALL_PACKAGE = "android.intent.action.INSTALL_PACKAGE"; 12965f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer 1297566c2ba743065ec090f5154d5c30cf593aa12a6eTed Kremenek /** 1298f83820bd7a0dc4c253071b31c443a316a49ce5aaSteve Naroff * Used as a string extra field with {@link #ACTION_INSTALL_PACKAGE} to install a 12997192f8e9592729882a09d84d77838db26e39ebd4Ted Kremenek * package. Specifies the installer package name; this package will receive the 13005f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * {@link #ACTION_APP_ERROR} intent. 13015f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer */ 13025f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer public static final String EXTRA_INSTALLER_PACKAGE_NAME 13035f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer = "android.intent.extra.INSTALLER_PACKAGE_NAME"; 13047e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor 13057e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor /** 13067e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor * Used as a boolean extra field with {@link #ACTION_INSTALL_PACKAGE} to install a 13077e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor * package. Specifies that the application being installed should not be 13087e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor * treated as coming from an unknown source, but as coming from the app 13097e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor * invoking the Intent. For this to work you must start the installer with 13107e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor * startActivityForResult(). 13117e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor */ 13127e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor public static final String EXTRA_NOT_UNKNOWN_SOURCE 13137e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor = "android.intent.extra.NOT_UNKNOWN_SOURCE"; 13147e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor 13157e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor /** 13167e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor * Used as a URI extra field with {@link #ACTION_INSTALL_PACKAGE} and 13177e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor * {@link #ACTION_VIEW} to indicate the URI from which the local APK in the Intent 13187e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor * data field originated from. 13197e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor */ 13207e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor public static final String EXTRA_ORIGINATING_URI 13217e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor = "android.intent.extra.ORIGINATING_URI"; 13227e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor 13237e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor /** 13247e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor * Used as a URI extra field with {@link #ACTION_INSTALL_PACKAGE} and 13257e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor * {@link #ACTION_VIEW} to indicate the HTTP referrer URI associated with the Intent 13267e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor * data field or {@link #EXTRA_ORIGINATING_URI}. 13277e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor */ 13287e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor public static final String EXTRA_REFERRER 13297e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor = "android.intent.extra.REFERRER"; 13307e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor 13317e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor /** 13327e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor * Used as an int extra field with {@link #ACTION_INSTALL_PACKAGE} and 13337e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor * {@link} #ACTION_VIEW} to indicate the uid of the package that initiated the install 13347e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor * @hide 13357e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor */ 13367e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor public static final String EXTRA_ORIGINATING_UID 13377e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor = "android.intent.extra.ORIGINATING_UID"; 13387e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor 13397e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor /** 13407e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor * Used as a boolean extra field with {@link #ACTION_INSTALL_PACKAGE} to install a 13417e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor * package. Tells the installer UI to skip the confirmation with the user 13427e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor * if the .apk is replacing an existing one. 13437e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor * @deprecated As of {@link android.os.Build.VERSION_CODES#JELLY_BEAN}, Android 13447e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor * will no longer show an interstitial message about updating existing 13457e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor * applications so this is no longer needed. 13467e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor */ 13477e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor @Deprecated 13487e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor public static final String EXTRA_ALLOW_REPLACE 13497e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor = "android.intent.extra.ALLOW_REPLACE"; 13507e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor 13517e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor /** 13527e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor * Used as a boolean extra field with {@link #ACTION_INSTALL_PACKAGE} or 1353bdbf7b030a3e0ddb95240076683830e6f78c79a5Steve Naroff * {@link #ACTION_UNINSTALL_PACKAGE}. Specifies that the installer UI should 1354bdbf7b030a3e0ddb95240076683830e6f78c79a5Steve Naroff * return to the application the result code of the install/uninstall. The returned result 13557e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor * code will be {@link android.app.Activity#RESULT_OK} on success or 13567e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor * {@link android.app.Activity#RESULT_FIRST_USER} on failure. 1357c9406125e2cac9208098655ac8058c095c2c3a65Steve Naroff */ 13587e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor public static final String EXTRA_RETURN_RESULT 13597e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor = "android.intent.extra.RETURN_RESULT"; 1360c5773c4b8ce1ed6ed5c7112c9020c954a47dce96Eli Friedman 1361c5773c4b8ce1ed6ed5c7112c9020c954a47dce96Eli Friedman /** 1362c5773c4b8ce1ed6ed5c7112c9020c954a47dce96Eli Friedman * Package manager install result code. @hide because result codes are not 1363566c2ba743065ec090f5154d5c30cf593aa12a6eTed Kremenek * yet ready to be exposed. 13647e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor */ 13657e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor public static final String EXTRA_INSTALL_RESULT 1366c5773c4b8ce1ed6ed5c7112c9020c954a47dce96Eli Friedman = "android.intent.extra.INSTALL_RESULT"; 1367c5773c4b8ce1ed6ed5c7112c9020c954a47dce96Eli Friedman 1368c5773c4b8ce1ed6ed5c7112c9020c954a47dce96Eli Friedman /** 1369c5773c4b8ce1ed6ed5c7112c9020c954a47dce96Eli Friedman * Activity Action: Launch application uninstaller. 1370c5773c4b8ce1ed6ed5c7112c9020c954a47dce96Eli Friedman * <p> 1371c5773c4b8ce1ed6ed5c7112c9020c954a47dce96Eli Friedman * Input: The data must be a package: URI whose scheme specific part is 1372898574e7496ba8fd76290079d3a9d06954992734Douglas Gregor * the package name of the current installed package to be uninstalled. 1373898574e7496ba8fd76290079d3a9d06954992734Douglas Gregor * You can optionally supply {@link #EXTRA_RETURN_RESULT}. 1374898574e7496ba8fd76290079d3a9d06954992734Douglas Gregor * <p> 1375898574e7496ba8fd76290079d3a9d06954992734Douglas Gregor * Output: If {@link #EXTRA_RETURN_RESULT}, returns whether the install 13767e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor * succeeded. 13777e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor */ 1378898574e7496ba8fd76290079d3a9d06954992734Douglas Gregor @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) 13797e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor public static final String ACTION_UNINSTALL_PACKAGE = "android.intent.action.UNINSTALL_PACKAGE"; 13807e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor 1381898574e7496ba8fd76290079d3a9d06954992734Douglas Gregor /** 1382898574e7496ba8fd76290079d3a9d06954992734Douglas Gregor * Specify whether the package should be uninstalled for all users. 1383898574e7496ba8fd76290079d3a9d06954992734Douglas Gregor * @hide because these should not be part of normal application flow. 1384898574e7496ba8fd76290079d3a9d06954992734Douglas Gregor */ 1385898574e7496ba8fd76290079d3a9d06954992734Douglas Gregor public static final String EXTRA_UNINSTALL_ALL_USERS 1386898574e7496ba8fd76290079d3a9d06954992734Douglas Gregor = "android.intent.extra.UNINSTALL_ALL_USERS"; 1387566c2ba743065ec090f5154d5c30cf593aa12a6eTed Kremenek 13887e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor /** 13897e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor * A string associated with a {@link #ACTION_UPGRADE_SETUP} activity 13907e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor * describing the last run version of the platform that was setup. 1391898574e7496ba8fd76290079d3a9d06954992734Douglas Gregor * @hide 1392898574e7496ba8fd76290079d3a9d06954992734Douglas Gregor */ 1393898574e7496ba8fd76290079d3a9d06954992734Douglas Gregor public static final String METADATA_SETUP_VERSION = "android.SETUP_VERSION"; 1394898574e7496ba8fd76290079d3a9d06954992734Douglas Gregor 1395898574e7496ba8fd76290079d3a9d06954992734Douglas Gregor // --------------------------------------------------------------------- 1396898574e7496ba8fd76290079d3a9d06954992734Douglas Gregor // --------------------------------------------------------------------- 1397c5773c4b8ce1ed6ed5c7112c9020c954a47dce96Eli Friedman // Standard intent broadcast actions (see action variable). 1398c5773c4b8ce1ed6ed5c7112c9020c954a47dce96Eli Friedman 1399c5773c4b8ce1ed6ed5c7112c9020c954a47dce96Eli Friedman /** 1400c5773c4b8ce1ed6ed5c7112c9020c954a47dce96Eli Friedman * Broadcast Action: Sent after the screen turns off. 14010be2ef2321b1283ead38ebeb83b451335d90e0feChris Lattner * 1402c5773c4b8ce1ed6ed5c7112c9020c954a47dce96Eli Friedman * <p class="note">This is a protected intent that can only be sent 1403c5773c4b8ce1ed6ed5c7112c9020c954a47dce96Eli Friedman * by the system. 1404c5773c4b8ce1ed6ed5c7112c9020c954a47dce96Eli Friedman */ 1405c5773c4b8ce1ed6ed5c7112c9020c954a47dce96Eli Friedman @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 1406c5773c4b8ce1ed6ed5c7112c9020c954a47dce96Eli Friedman public static final String ACTION_SCREEN_OFF = "android.intent.action.SCREEN_OFF"; 1407c5773c4b8ce1ed6ed5c7112c9020c954a47dce96Eli Friedman /** 1408c5773c4b8ce1ed6ed5c7112c9020c954a47dce96Eli Friedman * Broadcast Action: Sent after the screen turns on. 1409c5773c4b8ce1ed6ed5c7112c9020c954a47dce96Eli Friedman * 1410c5773c4b8ce1ed6ed5c7112c9020c954a47dce96Eli Friedman * <p class="note">This is a protected intent that can only be sent 1411c5773c4b8ce1ed6ed5c7112c9020c954a47dce96Eli Friedman * by the system. 1412c5773c4b8ce1ed6ed5c7112c9020c954a47dce96Eli Friedman */ 1413f52ab250ff92bc51a9ac9a8e19bd43b63a5f844fChris Lattner @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 14142bd24ba6d10f8c811c8e2a57c8397e07082ba497Ted Kremenek public static final String ACTION_SCREEN_ON = "android.intent.action.SCREEN_ON"; 1415c5773c4b8ce1ed6ed5c7112c9020c954a47dce96Eli Friedman 1416c5773c4b8ce1ed6ed5c7112c9020c954a47dce96Eli Friedman /** 1417c5773c4b8ce1ed6ed5c7112c9020c954a47dce96Eli Friedman * Broadcast Action: Sent after the system stops dreaming. 1418c5773c4b8ce1ed6ed5c7112c9020c954a47dce96Eli Friedman * 1419f6e764fe722440eaed18dad9eeff3d7e89a4d7afChris Lattner * <p class="note">This is a protected intent that can only be sent by the system. 14202bd24ba6d10f8c811c8e2a57c8397e07082ba497Ted Kremenek * It is only sent to registered receivers.</p> 1421c5773c4b8ce1ed6ed5c7112c9020c954a47dce96Eli Friedman */ 14227e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 14237e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor public static final String ACTION_DREAMING_STOPPED = "android.intent.action.DREAMING_STOPPED"; 14247e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor 1425c5773c4b8ce1ed6ed5c7112c9020c954a47dce96Eli Friedman /** 1426c5773c4b8ce1ed6ed5c7112c9020c954a47dce96Eli Friedman * Broadcast Action: Sent after the system starts dreaming. 1427c5773c4b8ce1ed6ed5c7112c9020c954a47dce96Eli Friedman * 1428c5773c4b8ce1ed6ed5c7112c9020c954a47dce96Eli Friedman * <p class="note">This is a protected intent that can only be sent by the system. 1429fb22d96692c5240fb8d611290dbf7eeed3759c73Steve Naroff * It is only sent to registered receivers.</p> 1430fb22d96692c5240fb8d611290dbf7eeed3759c73Steve Naroff */ 143173322924127c873c13101b705dd823f5539ffa5fSteve Naroff @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 143273322924127c873c13101b705dd823f5539ffa5fSteve Naroff public static final String ACTION_DREAMING_STARTED = "android.intent.action.DREAMING_STARTED"; 143373322924127c873c13101b705dd823f5539ffa5fSteve Naroff 14345f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer /** 14355f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * Broadcast Action: Sent when the user is present after device wakes up (e.g when the 1436f52ab250ff92bc51a9ac9a8e19bd43b63a5f844fChris Lattner * keyguard is gone). 143773322924127c873c13101b705dd823f5539ffa5fSteve Naroff * 14385f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * <p class="note">This is a protected intent that can only be sent 14395f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * by the system. 14405f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer */ 144173322924127c873c13101b705dd823f5539ffa5fSteve Naroff @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 14425f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer public static final String ACTION_USER_PRESENT = "android.intent.action.USER_PRESENT"; 14435f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer 14445f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer /** 14455f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * Broadcast Action: The current time has changed. Sent every 14465f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * minute. You can <em>not</em> receive this through components declared 14475f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * in manifests, only by exlicitly registering for it with 14485f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * {@link Context#registerReceiver(BroadcastReceiver, IntentFilter) 14495f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * Context.registerReceiver()}. 1450f52ab250ff92bc51a9ac9a8e19bd43b63a5f844fChris Lattner * 14515f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * <p class="note">This is a protected intent that can only be sent 14525f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * by the system. 14535f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer */ 1454f6e764fe722440eaed18dad9eeff3d7e89a4d7afChris Lattner @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 14555f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer public static final String ACTION_TIME_TICK = "android.intent.action.TIME_TICK"; 1456f83820bd7a0dc4c253071b31c443a316a49ce5aaSteve Naroff /** 14575f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * Broadcast Action: The time was set. 14585f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer */ 14595f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 14605f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer public static final String ACTION_TIME_CHANGED = "android.intent.action.TIME_SET"; 14615f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer /** 1462213541a68a3e137d11d2cefb612c6cdb410d7e8eNate Begeman * Broadcast Action: The date has changed. 146373322924127c873c13101b705dd823f5539ffa5fSteve Naroff */ 1464213541a68a3e137d11d2cefb612c6cdb410d7e8eNate Begeman @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 146573322924127c873c13101b705dd823f5539ffa5fSteve Naroff public static final String ACTION_DATE_CHANGED = "android.intent.action.DATE_CHANGED"; 146673322924127c873c13101b705dd823f5539ffa5fSteve Naroff /** 1467f52ab250ff92bc51a9ac9a8e19bd43b63a5f844fChris Lattner * Broadcast Action: The timezone has changed. The intent will have the following extra values:</p> 1468213541a68a3e137d11d2cefb612c6cdb410d7e8eNate Begeman * <ul> 146973322924127c873c13101b705dd823f5539ffa5fSteve Naroff * <li><em>time-zone</em> - The java.util.TimeZone.getID() value identifying the new time zone.</li> 147073322924127c873c13101b705dd823f5539ffa5fSteve Naroff * </ul> 147173322924127c873c13101b705dd823f5539ffa5fSteve Naroff * 1472213541a68a3e137d11d2cefb612c6cdb410d7e8eNate Begeman * <p class="note">This is a protected intent that can only be sent 147373322924127c873c13101b705dd823f5539ffa5fSteve Naroff * by the system. 147473322924127c873c13101b705dd823f5539ffa5fSteve Naroff */ 147573322924127c873c13101b705dd823f5539ffa5fSteve Naroff @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 147673322924127c873c13101b705dd823f5539ffa5fSteve Naroff public static final String ACTION_TIMEZONE_CHANGED = "android.intent.action.TIMEZONE_CHANGED"; 147773322924127c873c13101b705dd823f5539ffa5fSteve Naroff /** 147873322924127c873c13101b705dd823f5539ffa5fSteve Naroff * Clear DNS Cache Action: This is broadcast when networks have changed and old 147973322924127c873c13101b705dd823f5539ffa5fSteve Naroff * DNS entries should be tossed. 148073322924127c873c13101b705dd823f5539ffa5fSteve Naroff * @hide 1481213541a68a3e137d11d2cefb612c6cdb410d7e8eNate Begeman */ 148273322924127c873c13101b705dd823f5539ffa5fSteve Naroff @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 148373322924127c873c13101b705dd823f5539ffa5fSteve Naroff public static final String ACTION_CLEAR_DNS_CACHE = "android.intent.action.CLEAR_DNS_CACHE"; 148473322924127c873c13101b705dd823f5539ffa5fSteve Naroff /** 1485f6e764fe722440eaed18dad9eeff3d7e89a4d7afChris Lattner * Alarm Changed Action: This is broadcast when the AlarmClock 148673322924127c873c13101b705dd823f5539ffa5fSteve Naroff * application's alarm is set or unset. It is used by the 1487f83820bd7a0dc4c253071b31c443a316a49ce5aaSteve Naroff * AlarmClock application and the StatusBar service. 148873322924127c873c13101b705dd823f5539ffa5fSteve Naroff * @hide 148973322924127c873c13101b705dd823f5539ffa5fSteve Naroff */ 149073322924127c873c13101b705dd823f5539ffa5fSteve Naroff @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 149173322924127c873c13101b705dd823f5539ffa5fSteve Naroff public static final String ACTION_ALARM_CHANGED = "android.intent.action.ALARM_CHANGED"; 149273322924127c873c13101b705dd823f5539ffa5fSteve Naroff /** 14939cdda0cf8528e3d595be9bfa002f0450074beb4dDouglas Gregor * Sync State Changed Action: This is broadcast when the sync starts or stops or when one has 14949cdda0cf8528e3d595be9bfa002f0450074beb4dDouglas Gregor * been failing for a long time. It is used by the SyncManager and the StatusBar service. 14959cdda0cf8528e3d595be9bfa002f0450074beb4dDouglas Gregor * @hide 14969cdda0cf8528e3d595be9bfa002f0450074beb4dDouglas Gregor */ 14979cdda0cf8528e3d595be9bfa002f0450074beb4dDouglas Gregor @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 14989cdda0cf8528e3d595be9bfa002f0450074beb4dDouglas Gregor public static final String ACTION_SYNC_STATE_CHANGED 14999cdda0cf8528e3d595be9bfa002f0450074beb4dDouglas Gregor = "android.intent.action.SYNC_STATE_CHANGED"; 15009cdda0cf8528e3d595be9bfa002f0450074beb4dDouglas Gregor /** 15019cdda0cf8528e3d595be9bfa002f0450074beb4dDouglas Gregor * Broadcast Action: This is broadcast once, after the system has finished 15029cdda0cf8528e3d595be9bfa002f0450074beb4dDouglas Gregor * booting. It can be used to perform application-specific initialization, 15039cdda0cf8528e3d595be9bfa002f0450074beb4dDouglas Gregor * such as installing alarms. You must hold the 15049cdda0cf8528e3d595be9bfa002f0450074beb4dDouglas Gregor * {@link android.Manifest.permission#RECEIVE_BOOT_COMPLETED} permission 150572564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor * in order to receive this broadcast. 15065f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * 15072455636163fdd18581d7fdae816433f886d88213Mike Stump * <p class="note">This is a protected intent that can only be sent 15085f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * by the system. 15095f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer */ 15105f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 15112455636163fdd18581d7fdae816433f886d88213Mike Stump public static final String ACTION_BOOT_COMPLETED = "android.intent.action.BOOT_COMPLETED"; 15125f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer /** 15135f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * Broadcast Action: This is broadcast when a user action should request a 151472564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor * temporary system dialog to dismiss. Some examples of temporary system 151572564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor * dialogs are the notification window-shade and the recent tasks dialog. 15165f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer */ 15175f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer public static final String ACTION_CLOSE_SYSTEM_DIALOGS = "android.intent.action.CLOSE_SYSTEM_DIALOGS"; 15185f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer /** 15195f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * Broadcast Action: Trigger the download and eventual installation 15202455636163fdd18581d7fdae816433f886d88213Mike Stump * of a package. 15215f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * <p>Input: {@link #getData} is the URI of the package file to download. 15225f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * 152372564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor * <p class="note">This is a protected intent that can only be sent 152472564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor * by the system. 1525f6e764fe722440eaed18dad9eeff3d7e89a4d7afChris Lattner * 15265f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * @deprecated This constant has never been used. 15275f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer */ 15282455636163fdd18581d7fdae816433f886d88213Mike Stump @Deprecated 15292455636163fdd18581d7fdae816433f886d88213Mike Stump @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 15305f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer public static final String ACTION_PACKAGE_INSTALL = "android.intent.action.PACKAGE_INSTALL"; 153172564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor /** 15325f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * Broadcast Action: A new application package has been installed on the 15335f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * device. The data contains the name of the package. Note that the 15345f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * newly installed package does <em>not</em> receive this broadcast. 15355f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * <p>May include the following extras: 15365f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * <ul> 153761710854be2b098428aff5316e64bd34b30fbcb7Chris Lattner * <li> {@link #EXTRA_UID} containing the integer uid assigned to the new package. 1538971c4fae6092976338b755af1d47dac07c8f16e3Argyrios Kyrtzidis * <li> {@link #EXTRA_REPLACING} is set to true if this is following 1539465226e23a3008bd68973513dda1f9e3cd27dbddSebastian Redl * an {@link #ACTION_PACKAGE_REMOVED} broadcast for the same package. 1540465226e23a3008bd68973513dda1f9e3cd27dbddSebastian Redl * </ul> 15412455636163fdd18581d7fdae816433f886d88213Mike Stump * 15425f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * <p class="note">This is a protected intent that can only be sent 15435f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * by the system. 15445f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer */ 154572564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 1546465226e23a3008bd68973513dda1f9e3cd27dbddSebastian Redl public static final String ACTION_PACKAGE_ADDED = "android.intent.action.PACKAGE_ADDED"; 15472455636163fdd18581d7fdae816433f886d88213Mike Stump /** 15485f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * Broadcast Action: A new version of an application package has been 15495f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * installed, replacing an existing version that was previously installed. 155072564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor * The data contains the name of the package. 155172564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor * <p>May include the following extras: 15525f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * <ul> 1553465226e23a3008bd68973513dda1f9e3cd27dbddSebastian Redl * <li> {@link #EXTRA_UID} containing the integer uid assigned to the new package. 1554465226e23a3008bd68973513dda1f9e3cd27dbddSebastian Redl * </ul> 15555f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * 1556465226e23a3008bd68973513dda1f9e3cd27dbddSebastian Redl * <p class="note">This is a protected intent that can only be sent 1557465226e23a3008bd68973513dda1f9e3cd27dbddSebastian Redl * by the system. 15585f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer */ 15595f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 15605f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer public static final String ACTION_PACKAGE_REPLACED = "android.intent.action.PACKAGE_REPLACED"; 15615f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer /** 15625f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * Broadcast Action: A new version of your application has been installed 1563465226e23a3008bd68973513dda1f9e3cd27dbddSebastian Redl * over an existing one. This is only sent to the application that was 15645f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * replaced. It does not contain any additional data; to receive it, just 15655f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * use an intent filter for this action. 15665f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * 15675f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * <p class="note">This is a protected intent that can only be sent 15685f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * by the system. 1569f52ab250ff92bc51a9ac9a8e19bd43b63a5f844fChris Lattner */ 1570465226e23a3008bd68973513dda1f9e3cd27dbddSebastian Redl @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 1571f52ab250ff92bc51a9ac9a8e19bd43b63a5f844fChris Lattner public static final String ACTION_MY_PACKAGE_REPLACED = "android.intent.action.MY_PACKAGE_REPLACED"; 1572beaaccd8e2a8748f77b66e2b330fb9136937e14cJay Foad /** 15732455636163fdd18581d7fdae816433f886d88213Mike Stump * Broadcast Action: An existing application package has been removed from 1574465226e23a3008bd68973513dda1f9e3cd27dbddSebastian Redl * the device. The data contains the name of the package. The package 15755f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * that is being installed does <em>not</em> receive this Intent. 157672564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor * <ul> 157772564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor * <li> {@link #EXTRA_UID} containing the integer uid previously assigned 1578f6e764fe722440eaed18dad9eeff3d7e89a4d7afChris Lattner * to the package. 15795f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * <li> {@link #EXTRA_DATA_REMOVED} is set to true if the entire 1580465226e23a3008bd68973513dda1f9e3cd27dbddSebastian Redl * application -- data and code -- is being removed. 158172564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor * <li> {@link #EXTRA_REPLACING} is set to true if this will be followed 1582465226e23a3008bd68973513dda1f9e3cd27dbddSebastian Redl * by an {@link #ACTION_PACKAGE_ADDED} broadcast for the same package. 1583465226e23a3008bd68973513dda1f9e3cd27dbddSebastian Redl * </ul> 158472564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor * 1585465226e23a3008bd68973513dda1f9e3cd27dbddSebastian Redl * <p class="note">This is a protected intent that can only be sent 1586465226e23a3008bd68973513dda1f9e3cd27dbddSebastian Redl * by the system. 1587465226e23a3008bd68973513dda1f9e3cd27dbddSebastian Redl */ 158872564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 1589465226e23a3008bd68973513dda1f9e3cd27dbddSebastian Redl public static final String ACTION_PACKAGE_REMOVED = "android.intent.action.PACKAGE_REMOVED"; 15902455636163fdd18581d7fdae816433f886d88213Mike Stump /** 15915f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * Broadcast Action: An existing application package has been completely 159272564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor * removed from the device. The data contains the name of the package. 15935f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * This is like {@link #ACTION_PACKAGE_REMOVED}, but only set when 15945f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * {@link #EXTRA_DATA_REMOVED} is true and 15955f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * {@link #EXTRA_REPLACING} is false of that broadcast. 15962ce52f3fb95bf544db6bd3d91a72bce7d9cceb6cDouglas Gregor * 15972ce52f3fb95bf544db6bd3d91a72bce7d9cceb6cDouglas Gregor * <ul> 15984b7c98378ae0c1a3635f0b7756848b4a9923f8bcTed Kremenek * <li> {@link #EXTRA_UID} containing the integer uid previously assigned 15991e6759e9e33dcaa73ce14c8a908ac9f87ac16463Argyrios Kyrtzidis * to the package. 16002ce52f3fb95bf544db6bd3d91a72bce7d9cceb6cDouglas Gregor * </ul> 16012ce52f3fb95bf544db6bd3d91a72bce7d9cceb6cDouglas Gregor * 16021e6759e9e33dcaa73ce14c8a908ac9f87ac16463Argyrios Kyrtzidis * <p class="note">This is a protected intent that can only be sent 16032ce52f3fb95bf544db6bd3d91a72bce7d9cceb6cDouglas Gregor * by the system. 1604fab9d67cebb87be968e7ae31a3b549a5279b5d51Douglas Gregor */ 1605fab9d67cebb87be968e7ae31a3b549a5279b5d51Douglas Gregor @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 1606fab9d67cebb87be968e7ae31a3b549a5279b5d51Douglas Gregor public static final String ACTION_PACKAGE_FULLY_REMOVED 16072ce52f3fb95bf544db6bd3d91a72bce7d9cceb6cDouglas Gregor = "android.intent.action.PACKAGE_FULLY_REMOVED"; 160849aa7ff1245abd03e6e998e01302df31e4c6f8f6Argyrios Kyrtzidis /** 1609c1efaecf0373f1a55c5ef4c234357cf726fc0600Douglas Gregor * Broadcast Action: An existing application package has been changed (e.g. 1610566c2ba743065ec090f5154d5c30cf593aa12a6eTed Kremenek * a component has been enabled or disabled). The data contains the name of 1611566c2ba743065ec090f5154d5c30cf593aa12a6eTed Kremenek * the package. 1612f83820bd7a0dc4c253071b31c443a316a49ce5aaSteve Naroff * <ul> 1613f83820bd7a0dc4c253071b31c443a316a49ce5aaSteve Naroff * <li> {@link #EXTRA_UID} containing the integer uid assigned to the package. 1614566c2ba743065ec090f5154d5c30cf593aa12a6eTed Kremenek * <li> {@link #EXTRA_CHANGED_COMPONENT_NAME_LIST} containing the class name 1615566c2ba743065ec090f5154d5c30cf593aa12a6eTed Kremenek * of the changed components (or the package name itself). 1616566c2ba743065ec090f5154d5c30cf593aa12a6eTed Kremenek * <li> {@link #EXTRA_DONT_KILL_APP} containing boolean field to override the 1617566c2ba743065ec090f5154d5c30cf593aa12a6eTed Kremenek * default action of restarting the application. 1618f83820bd7a0dc4c253071b31c443a316a49ce5aaSteve Naroff * </ul> 1619f83820bd7a0dc4c253071b31c443a316a49ce5aaSteve Naroff * 16204b7c98378ae0c1a3635f0b7756848b4a9923f8bcTed Kremenek * <p class="note">This is a protected intent that can only be sent 162149aa7ff1245abd03e6e998e01302df31e4c6f8f6Argyrios Kyrtzidis * by the system. 16222ce52f3fb95bf544db6bd3d91a72bce7d9cceb6cDouglas Gregor */ 162349aa7ff1245abd03e6e998e01302df31e4c6f8f6Argyrios Kyrtzidis @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 16244b7c98378ae0c1a3635f0b7756848b4a9923f8bcTed Kremenek public static final String ACTION_PACKAGE_CHANGED = "android.intent.action.PACKAGE_CHANGED"; 162549aa7ff1245abd03e6e998e01302df31e4c6f8f6Argyrios Kyrtzidis /** 16262ce52f3fb95bf544db6bd3d91a72bce7d9cceb6cDouglas Gregor * @hide 16272ce52f3fb95bf544db6bd3d91a72bce7d9cceb6cDouglas Gregor * Broadcast Action: Ask system services if there is any reason to 16285f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * restart the given package. The data contains the name of the 16295f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * package. 16305f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * <ul> 16315f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * <li> {@link #EXTRA_UID} containing the integer uid assigned to the package. 16325f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * <li> {@link #EXTRA_PACKAGES} String array of all packages to check. 1633f52ab250ff92bc51a9ac9a8e19bd43b63a5f844fChris Lattner * </ul> 163472564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor * 16355f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * <p class="note">This is a protected intent that can only be sent 16365f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * by the system. 16375f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer */ 16385f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 1639fab9d67cebb87be968e7ae31a3b549a5279b5d51Douglas Gregor public static final String ACTION_QUERY_PACKAGE_RESTART = "android.intent.action.QUERY_PACKAGE_RESTART"; 164076e4ce42a30cee4dc40ce7c6014874fbc4f9baa7Anders Carlsson /** 164176e4ce42a30cee4dc40ce7c6014874fbc4f9baa7Anders Carlsson * Broadcast Action: The user has restarted a package, and all of its 1642fab9d67cebb87be968e7ae31a3b549a5279b5d51Douglas Gregor * processes have been killed. All runtime state 164376e4ce42a30cee4dc40ce7c6014874fbc4f9baa7Anders Carlsson * associated with it (processes, alarms, notifications, etc) should 1644fab9d67cebb87be968e7ae31a3b549a5279b5d51Douglas Gregor * be removed. Note that the restarted package does <em>not</em> 1645fab9d67cebb87be968e7ae31a3b549a5279b5d51Douglas Gregor * receive this broadcast. 164676e4ce42a30cee4dc40ce7c6014874fbc4f9baa7Anders Carlsson * The data contains the name of the package. 1647fab9d67cebb87be968e7ae31a3b549a5279b5d51Douglas Gregor * <ul> 1648fab9d67cebb87be968e7ae31a3b549a5279b5d51Douglas Gregor * <li> {@link #EXTRA_UID} containing the integer uid assigned to the package. 1649fab9d67cebb87be968e7ae31a3b549a5279b5d51Douglas Gregor * </ul> 1650fab9d67cebb87be968e7ae31a3b549a5279b5d51Douglas Gregor * 1651fab9d67cebb87be968e7ae31a3b549a5279b5d51Douglas Gregor * <p class="note">This is a protected intent that can only be sent 1652fab9d67cebb87be968e7ae31a3b549a5279b5d51Douglas Gregor * by the system. 1653fab9d67cebb87be968e7ae31a3b549a5279b5d51Douglas Gregor */ 165476e4ce42a30cee4dc40ce7c6014874fbc4f9baa7Anders Carlsson @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 165576e4ce42a30cee4dc40ce7c6014874fbc4f9baa7Anders Carlsson public static final String ACTION_PACKAGE_RESTARTED = "android.intent.action.PACKAGE_RESTARTED"; 165676e4ce42a30cee4dc40ce7c6014874fbc4f9baa7Anders Carlsson /** 165776e4ce42a30cee4dc40ce7c6014874fbc4f9baa7Anders Carlsson * Broadcast Action: The user has cleared the data of a package. This should 165876e4ce42a30cee4dc40ce7c6014874fbc4f9baa7Anders Carlsson * be preceded by {@link #ACTION_PACKAGE_RESTARTED}, after which all of 165976e4ce42a30cee4dc40ce7c6014874fbc4f9baa7Anders Carlsson * its persistent data is erased and this broadcast sent. 1660fab9d67cebb87be968e7ae31a3b549a5279b5d51Douglas Gregor * Note that the cleared package does <em>not</em> 1661fab9d67cebb87be968e7ae31a3b549a5279b5d51Douglas Gregor * receive this broadcast. The data contains the name of the package. 1662fab9d67cebb87be968e7ae31a3b549a5279b5d51Douglas Gregor * <ul> 1663fab9d67cebb87be968e7ae31a3b549a5279b5d51Douglas Gregor * <li> {@link #EXTRA_UID} containing the integer uid assigned to the package. 1664fab9d67cebb87be968e7ae31a3b549a5279b5d51Douglas Gregor * </ul> 1665fab9d67cebb87be968e7ae31a3b549a5279b5d51Douglas Gregor * 1666fab9d67cebb87be968e7ae31a3b549a5279b5d51Douglas Gregor * <p class="note">This is a protected intent that can only be sent 166755f6b14230c94272efbbcdd89a92224c8db9f225Douglas Gregor * by the system. 16687532dc66648cfe7432c9fe66dec5225f0ab301c6Douglas Gregor */ 16697532dc66648cfe7432c9fe66dec5225f0ab301c6Douglas Gregor @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 16707532dc66648cfe7432c9fe66dec5225f0ab301c6Douglas Gregor public static final String ACTION_PACKAGE_DATA_CLEARED = "android.intent.action.PACKAGE_DATA_CLEARED"; 16717532dc66648cfe7432c9fe66dec5225f0ab301c6Douglas Gregor /** 16721275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor * Broadcast Action: A user ID has been removed from the system. The user 16731275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor * ID number is stored in the extra data under {@link #EXTRA_UID}. 16741275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor * 16751275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor * <p class="note">This is a protected intent that can only be sent 16761275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor * by the system. 16771275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor */ 16781275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 16791275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor public static final String ACTION_UID_REMOVED = "android.intent.action.UID_REMOVED"; 16801275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor 16811275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor /** 16821275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor * Broadcast Action: Sent to the installer package of an application 16831275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor * when that application is first launched (that is the first time it 16841275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor * is moved out of the stopped state). The data contains the name of the package. 16851275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor * 16861275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor * <p class="note">This is a protected intent that can only be sent 16871275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor * by the system. 16881275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor */ 16891275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 16901275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor public static final String ACTION_PACKAGE_FIRST_LAUNCH = "android.intent.action.PACKAGE_FIRST_LAUNCH"; 16911275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor 16921275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor /** 16931275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor * Broadcast Action: Sent to the system package verifier when a package 16941275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor * needs to be verified. The data contains the package URI. 16951275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor * <p class="note"> 16961275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor * This is a protected intent that can only be sent by the system. 16971275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor * </p> 16981275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor */ 16991275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 17001275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor public static final String ACTION_PACKAGE_NEEDS_VERIFICATION = "android.intent.action.PACKAGE_NEEDS_VERIFICATION"; 17011275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor 17021275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor /** 17031275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor * Broadcast Action: Sent to the system package verifier when a package is 17041275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor * verified. The data contains the package URI. 17051275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor * <p class="note"> 17061275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor * This is a protected intent that can only be sent by the system. 170740808ce6ac04b102c3b56244a635d6b98eed6d97Douglas Gregor */ 1708fc705b84347e6fb4746a1a7e26949f64c2f2f358Douglas Gregor @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 17091275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor public static final String ACTION_PACKAGE_VERIFIED = "android.intent.action.PACKAGE_VERIFIED"; 17101275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor 17111275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor /** 17127532dc66648cfe7432c9fe66dec5225f0ab301c6Douglas Gregor * Broadcast Action: Resources for a set of packages (which were 171340808ce6ac04b102c3b56244a635d6b98eed6d97Douglas Gregor * previously unavailable) are currently 171440808ce6ac04b102c3b56244a635d6b98eed6d97Douglas Gregor * available since the media on which they exist is available. 17151275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor * The extra data {@link #EXTRA_CHANGED_PACKAGE_LIST} contains a 17161275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor * list of packages whose availability changed. 17171275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor * The extra data {@link #EXTRA_CHANGED_UID_LIST} contains a 171855f6b14230c94272efbbcdd89a92224c8db9f225Douglas Gregor * list of uids of packages whose availability changed. 171955f6b14230c94272efbbcdd89a92224c8db9f225Douglas Gregor * Note that the 172055f6b14230c94272efbbcdd89a92224c8db9f225Douglas Gregor * packages in this list do <em>not</em> receive this broadcast. 172155f6b14230c94272efbbcdd89a92224c8db9f225Douglas Gregor * The specified set of packages are now available on the system. 1722e4e5b054b4917f0ee493bb2fda5b1ec749bfb9a1Douglas Gregor * <p>Includes the following extras: 1723ab452ba8323d1985e08bade2bced588cddf2cc28Douglas Gregor * <ul> 1724e4e5b054b4917f0ee493bb2fda5b1ec749bfb9a1Douglas Gregor * <li> {@link #EXTRA_CHANGED_PACKAGE_LIST} is the set of packages 1725e4e5b054b4917f0ee493bb2fda5b1ec749bfb9a1Douglas Gregor * whose resources(were previously unavailable) are currently available. 1726ab452ba8323d1985e08bade2bced588cddf2cc28Douglas Gregor * {@link #EXTRA_CHANGED_UID_LIST} is the set of uids of the 1727e4e5b054b4917f0ee493bb2fda5b1ec749bfb9a1Douglas Gregor * packages whose resources(were previously unavailable) 1728e4e5b054b4917f0ee493bb2fda5b1ec749bfb9a1Douglas Gregor * are currently available. 1729e4e5b054b4917f0ee493bb2fda5b1ec749bfb9a1Douglas Gregor * </ul> 1730e4e5b054b4917f0ee493bb2fda5b1ec749bfb9a1Douglas Gregor * 1731e4e5b054b4917f0ee493bb2fda5b1ec749bfb9a1Douglas Gregor * <p class="note">This is a protected intent that can only be sent 1732e4e5b054b4917f0ee493bb2fda5b1ec749bfb9a1Douglas Gregor * by the system. 1733e4e5b054b4917f0ee493bb2fda5b1ec749bfb9a1Douglas Gregor */ 1734ab452ba8323d1985e08bade2bced588cddf2cc28Douglas Gregor @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 1735ab452ba8323d1985e08bade2bced588cddf2cc28Douglas Gregor public static final String ACTION_EXTERNAL_APPLICATIONS_AVAILABLE = 1736e4e5b054b4917f0ee493bb2fda5b1ec749bfb9a1Douglas Gregor "android.intent.action.EXTERNAL_APPLICATIONS_AVAILABLE"; 1737e4e5b054b4917f0ee493bb2fda5b1ec749bfb9a1Douglas Gregor 1738e4e5b054b4917f0ee493bb2fda5b1ec749bfb9a1Douglas Gregor /** 1739e4e5b054b4917f0ee493bb2fda5b1ec749bfb9a1Douglas Gregor * Broadcast Action: Resources for a set of packages are currently 1740e4e5b054b4917f0ee493bb2fda5b1ec749bfb9a1Douglas Gregor * unavailable since the media on which they exist is unavailable. 1741d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor * The extra data {@link #EXTRA_CHANGED_PACKAGE_LIST} contains a 1742d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor * list of packages whose availability changed. 1743d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor * The extra data {@link #EXTRA_CHANGED_UID_LIST} contains a 1744d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor * list of uids of packages whose availability changed. 1745d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor * The specified set of packages can no longer be 1746d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor * launched and are practically unavailable on the system. 1747d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor * <p>Inclues the following extras: 1748d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor * <ul> 1749d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor * <li> {@link #EXTRA_CHANGED_PACKAGE_LIST} is the set of packages 1750d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor * whose resources are no longer available. 1751d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor * {@link #EXTRA_CHANGED_UID_LIST} is the set of packages 1752d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor * whose resources are no longer available. 1753d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor * </ul> 1754d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor * 1755d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor * <p class="note">This is a protected intent that can only be sent 1756d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor * by the system. 1757d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor */ 1758d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 1759d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor public static final String ACTION_EXTERNAL_APPLICATIONS_UNAVAILABLE = 1760d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor "android.intent.action.EXTERNAL_APPLICATIONS_UNAVAILABLE"; 1761d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor 1762d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor /** 1763d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor * Broadcast Action: The current system wallpaper has changed. See 1764d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor * {@link android.app.WallpaperManager} for retrieving the new wallpaper. 1765d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor * This should <em>only</em> be used to determine when the wallpaper 1766d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor * has changed to show the new wallpaper to the user. You should certainly 17671734317845d60307d474b5da8a8d33adbaf5e723Douglas Gregor * never, in response to this, change the wallpaper or other attributes of 17681734317845d60307d474b5da8a8d33adbaf5e723Douglas Gregor * it such as the suggested size. That would be crazy, right? You'd cause 17691734317845d60307d474b5da8a8d33adbaf5e723Douglas Gregor * all kinds of loops, especially if other apps are doing similar things, 17701734317845d60307d474b5da8a8d33adbaf5e723Douglas Gregor * right? Of course. So please don't do this. 17711734317845d60307d474b5da8a8d33adbaf5e723Douglas Gregor * 17721734317845d60307d474b5da8a8d33adbaf5e723Douglas Gregor * @deprecated Modern applications should use 17731734317845d60307d474b5da8a8d33adbaf5e723Douglas Gregor * {@link android.view.WindowManager.LayoutParams#FLAG_SHOW_WALLPAPER 17741734317845d60307d474b5da8a8d33adbaf5e723Douglas Gregor * WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER} to have the wallpaper 17751734317845d60307d474b5da8a8d33adbaf5e723Douglas Gregor * shown behind their UI, rather than watching for this broadcast and 17761734317845d60307d474b5da8a8d33adbaf5e723Douglas Gregor * rendering the wallpaper on their own. 17771734317845d60307d474b5da8a8d33adbaf5e723Douglas Gregor */ 17781734317845d60307d474b5da8a8d33adbaf5e723Douglas Gregor @Deprecated @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 17791734317845d60307d474b5da8a8d33adbaf5e723Douglas Gregor public static final String ACTION_WALLPAPER_CHANGED = "android.intent.action.WALLPAPER_CHANGED"; 17801734317845d60307d474b5da8a8d33adbaf5e723Douglas Gregor /** 17811734317845d60307d474b5da8a8d33adbaf5e723Douglas Gregor * Broadcast Action: The current device {@link android.content.res.Configuration} 17821734317845d60307d474b5da8a8d33adbaf5e723Douglas Gregor * (orientation, locale, etc) has changed. When such a change happens, the 17831734317845d60307d474b5da8a8d33adbaf5e723Douglas Gregor * UIs (view hierarchy) will need to be rebuilt based on this new 17841734317845d60307d474b5da8a8d33adbaf5e723Douglas Gregor * information; for the most part, applications don't need to worry about 17851734317845d60307d474b5da8a8d33adbaf5e723Douglas Gregor * this, because the system will take care of stopping and restarting the 17861734317845d60307d474b5da8a8d33adbaf5e723Douglas Gregor * application to make sure it sees the new changes. Some system code that 17871734317845d60307d474b5da8a8d33adbaf5e723Douglas Gregor * can not be restarted will need to watch for this action and handle it 17881734317845d60307d474b5da8a8d33adbaf5e723Douglas Gregor * appropriately. 17891734317845d60307d474b5da8a8d33adbaf5e723Douglas Gregor * 17901734317845d60307d474b5da8a8d33adbaf5e723Douglas Gregor * <p class="note"> 17911734317845d60307d474b5da8a8d33adbaf5e723Douglas Gregor * You can <em>not</em> receive this through components declared 17921734317845d60307d474b5da8a8d33adbaf5e723Douglas Gregor * in manifests, only by explicitly registering for it with 17931734317845d60307d474b5da8a8d33adbaf5e723Douglas Gregor * {@link Context#registerReceiver(BroadcastReceiver, IntentFilter) 17941734317845d60307d474b5da8a8d33adbaf5e723Douglas Gregor * Context.registerReceiver()}. 17951734317845d60307d474b5da8a8d33adbaf5e723Douglas Gregor * 17961734317845d60307d474b5da8a8d33adbaf5e723Douglas Gregor * <p class="note">This is a protected intent that can only be sent 17971734317845d60307d474b5da8a8d33adbaf5e723Douglas Gregor * by the system. 17981734317845d60307d474b5da8a8d33adbaf5e723Douglas Gregor * 17991734317845d60307d474b5da8a8d33adbaf5e723Douglas Gregor * @see android.content.res.Configuration 180088cb27a160adc305783a44f922ee4b216006ebf9Chris Lattner */ 180188cb27a160adc305783a44f922ee4b216006ebf9Chris Lattner @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 180288cb27a160adc305783a44f922ee4b216006ebf9Chris Lattner public static final String ACTION_CONFIGURATION_CHANGED = "android.intent.action.CONFIGURATION_CHANGED"; 180388cb27a160adc305783a44f922ee4b216006ebf9Chris Lattner /** 18042e1cd4264d363ca869bf37ef160902f211d21b8cDouglas Gregor * Broadcast Action: The current device's locale has changed. 180588cb27a160adc305783a44f922ee4b216006ebf9Chris Lattner * 180688cb27a160adc305783a44f922ee4b216006ebf9Chris Lattner * <p class="note">This is a protected intent that can only be sent 180788cb27a160adc305783a44f922ee4b216006ebf9Chris Lattner * by the system. 180888cb27a160adc305783a44f922ee4b216006ebf9Chris Lattner */ 180988cb27a160adc305783a44f922ee4b216006ebf9Chris Lattner @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 181088cb27a160adc305783a44f922ee4b216006ebf9Chris Lattner public static final String ACTION_LOCALE_CHANGED = "android.intent.action.LOCALE_CHANGED"; 181188cb27a160adc305783a44f922ee4b216006ebf9Chris Lattner /** 181288cb27a160adc305783a44f922ee4b216006ebf9Chris Lattner * Broadcast Action: This is a <em>sticky broadcast</em> containing the 181388cb27a160adc305783a44f922ee4b216006ebf9Chris Lattner * charging state, level, and other information about the battery. 181488cb27a160adc305783a44f922ee4b216006ebf9Chris Lattner * See {@link android.os.BatteryManager} for documentation on the 181588cb27a160adc305783a44f922ee4b216006ebf9Chris Lattner * contents of the Intent. 181688cb27a160adc305783a44f922ee4b216006ebf9Chris Lattner * 181788cb27a160adc305783a44f922ee4b216006ebf9Chris Lattner * <p class="note"> 181888cb27a160adc305783a44f922ee4b216006ebf9Chris Lattner * You can <em>not</em> receive this through components declared 1819d1b3c2dd5bc1f3103bee6137957aa7c5f8f2f0bcSteve Naroff * in manifests, only by explicitly registering for it with 1820d1b3c2dd5bc1f3103bee6137957aa7c5f8f2f0bcSteve Naroff * {@link Context#registerReceiver(BroadcastReceiver, IntentFilter) 182114108da7f7fc059772711e4ffee1322a27b152a7Steve Naroff * Context.registerReceiver()}. See {@link #ACTION_BATTERY_LOW}, 1822d1b3c2dd5bc1f3103bee6137957aa7c5f8f2f0bcSteve Naroff * {@link #ACTION_BATTERY_OKAY}, {@link #ACTION_POWER_CONNECTED}, 1823d1b3c2dd5bc1f3103bee6137957aa7c5f8f2f0bcSteve Naroff * and {@link #ACTION_POWER_DISCONNECTED} for distinct battery-related 1824d1b3c2dd5bc1f3103bee6137957aa7c5f8f2f0bcSteve Naroff * broadcasts that are sent and can be received through manifest 1825d1b3c2dd5bc1f3103bee6137957aa7c5f8f2f0bcSteve Naroff * receivers. 1826d1b3c2dd5bc1f3103bee6137957aa7c5f8f2f0bcSteve Naroff * 1827d1b3c2dd5bc1f3103bee6137957aa7c5f8f2f0bcSteve Naroff * <p class="note">This is a protected intent that can only be sent 1828d1b3c2dd5bc1f3103bee6137957aa7c5f8f2f0bcSteve Naroff * by the system. 182914108da7f7fc059772711e4ffee1322a27b152a7Steve Naroff */ 1830d1b3c2dd5bc1f3103bee6137957aa7c5f8f2f0bcSteve Naroff @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 1831d1b3c2dd5bc1f3103bee6137957aa7c5f8f2f0bcSteve Naroff public static final String ACTION_BATTERY_CHANGED = "android.intent.action.BATTERY_CHANGED"; 1832d1b3c2dd5bc1f3103bee6137957aa7c5f8f2f0bcSteve Naroff /** 1833d1b3c2dd5bc1f3103bee6137957aa7c5f8f2f0bcSteve Naroff * Broadcast Action: Indicates low battery condition on the device. 1834d1b3c2dd5bc1f3103bee6137957aa7c5f8f2f0bcSteve Naroff * This broadcast corresponds to the "Low battery warning" system dialog. 1835d1b3c2dd5bc1f3103bee6137957aa7c5f8f2f0bcSteve Naroff * 1836d1b3c2dd5bc1f3103bee6137957aa7c5f8f2f0bcSteve Naroff * <p class="note">This is a protected intent that can only be sent 1837d1b3c2dd5bc1f3103bee6137957aa7c5f8f2f0bcSteve Naroff * by the system. 183814108da7f7fc059772711e4ffee1322a27b152a7Steve Naroff */ 1839d1b3c2dd5bc1f3103bee6137957aa7c5f8f2f0bcSteve Naroff @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 1840d1b3c2dd5bc1f3103bee6137957aa7c5f8f2f0bcSteve Naroff public static final String ACTION_BATTERY_LOW = "android.intent.action.BATTERY_LOW"; 1841d1b3c2dd5bc1f3103bee6137957aa7c5f8f2f0bcSteve Naroff /** 1842d1b3c2dd5bc1f3103bee6137957aa7c5f8f2f0bcSteve Naroff * Broadcast Action: Indicates the battery is now okay after being low. 1843d1b3c2dd5bc1f3103bee6137957aa7c5f8f2f0bcSteve Naroff * This will be sent after {@link #ACTION_BATTERY_LOW} once the battery has 184488cb27a160adc305783a44f922ee4b216006ebf9Chris Lattner * gone back up to an okay state. 1845c15cb2af27514ecc879daba9aa01389c5203685dSteve Naroff * 1846c15cb2af27514ecc879daba9aa01389c5203685dSteve Naroff * <p class="note">This is a protected intent that can only be sent 1847c15cb2af27514ecc879daba9aa01389c5203685dSteve Naroff * by the system. 1848a526c5c67e5a0473c340903ee542ce570119665fTed Kremenek */ 1849c15cb2af27514ecc879daba9aa01389c5203685dSteve Naroff @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 1850c15cb2af27514ecc879daba9aa01389c5203685dSteve Naroff public static final String ACTION_BATTERY_OKAY = "android.intent.action.BATTERY_OKAY"; 1851c15cb2af27514ecc879daba9aa01389c5203685dSteve Naroff /** 185288cb27a160adc305783a44f922ee4b216006ebf9Chris Lattner * Broadcast Action: External power has been connected to the device. 18534b6c9051c6522894978c9ba6a819a659d102db36Fariborz Jahanian * This is intended for applications that wish to register specifically to this notification. 1854c15cb2af27514ecc879daba9aa01389c5203685dSteve Naroff * Unlike ACTION_BATTERY_CHANGED, applications will be woken for this and so do not have to 18554b6c9051c6522894978c9ba6a819a659d102db36Fariborz Jahanian * stay active to receive this notification. This action can be used to implement actions 18564b6c9051c6522894978c9ba6a819a659d102db36Fariborz Jahanian * that wait until power is available to trigger. 1857c15cb2af27514ecc879daba9aa01389c5203685dSteve Naroff * 1858c15cb2af27514ecc879daba9aa01389c5203685dSteve Naroff * <p class="note">This is a protected intent that can only be sent 18594b6c9051c6522894978c9ba6a819a659d102db36Fariborz Jahanian * by the system. 18604b6c9051c6522894978c9ba6a819a659d102db36Fariborz Jahanian */ 18614b6c9051c6522894978c9ba6a819a659d102db36Fariborz Jahanian @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 1862c15cb2af27514ecc879daba9aa01389c5203685dSteve Naroff public static final String ACTION_POWER_CONNECTED = "android.intent.action.ACTION_POWER_CONNECTED"; 1863c15cb2af27514ecc879daba9aa01389c5203685dSteve Naroff /** 1864c15cb2af27514ecc879daba9aa01389c5203685dSteve Naroff * Broadcast Action: External power has been removed from the device. 18654b6c9051c6522894978c9ba6a819a659d102db36Fariborz Jahanian * This is intended for applications that wish to register specifically to this notification. 1866c15cb2af27514ecc879daba9aa01389c5203685dSteve Naroff * Unlike ACTION_BATTERY_CHANGED, applications will be woken for this and so do not have to 18674b6c9051c6522894978c9ba6a819a659d102db36Fariborz Jahanian * stay active to receive this notification. This action can be used to implement actions 18684b6c9051c6522894978c9ba6a819a659d102db36Fariborz Jahanian * that wait until power is available to trigger. 18694b6c9051c6522894978c9ba6a819a659d102db36Fariborz Jahanian * 187072564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor * <p class="note">This is a protected intent that can only be sent 187172564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor * by the system. 18729752f25748d954df99087d741ea35db37ff16beaSteve Naroff */ 18739752f25748d954df99087d741ea35db37ff16beaSteve Naroff @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 18749752f25748d954df99087d741ea35db37ff16beaSteve Naroff public static final String ACTION_POWER_DISCONNECTED = 187572564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor "android.intent.action.ACTION_POWER_DISCONNECTED"; 1876dd0257c77719a13d4acd513df40b04300cbfc871Douglas Gregor /** 1877dd0257c77719a13d4acd513df40b04300cbfc871Douglas Gregor * Broadcast Action: Device is shutting down. 1878dd0257c77719a13d4acd513df40b04300cbfc871Douglas Gregor * This is broadcast when the device is being shut down (completely turned 1879dd0257c77719a13d4acd513df40b04300cbfc871Douglas Gregor * off, not sleeping). Once the broadcast is complete, the final shutdown 1880dd0257c77719a13d4acd513df40b04300cbfc871Douglas Gregor * will proceed and all unsaved data lost. Apps will not normally need 1881dd0257c77719a13d4acd513df40b04300cbfc871Douglas Gregor * to handle this, since the foreground activity will be paused as well. 1882dd0257c77719a13d4acd513df40b04300cbfc871Douglas Gregor * 18839752f25748d954df99087d741ea35db37ff16beaSteve Naroff * <p class="note">This is a protected intent that can only be sent 18849752f25748d954df99087d741ea35db37ff16beaSteve Naroff * by the system. 1885d1861fd633d5096a00777c918eb8575ea7162fe7Steve Naroff */ 1886d1861fd633d5096a00777c918eb8575ea7162fe7Steve Naroff @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 18879752f25748d954df99087d741ea35db37ff16beaSteve Naroff public static final String ACTION_SHUTDOWN = "android.intent.action.ACTION_SHUTDOWN"; 18889752f25748d954df99087d741ea35db37ff16beaSteve Naroff /** 18899752f25748d954df99087d741ea35db37ff16beaSteve Naroff * Activity Action: Start this activity to request system shutdown. 18909752f25748d954df99087d741ea35db37ff16beaSteve Naroff * The optional boolean extra field {@link #EXTRA_KEY_CONFIRM} can be set to true 18919752f25748d954df99087d741ea35db37ff16beaSteve Naroff * to request confirmation from the user before shutting down. 1892d1861fd633d5096a00777c918eb8575ea7162fe7Steve Naroff * 1893f52ab250ff92bc51a9ac9a8e19bd43b63a5f844fChris Lattner * <p class="note">This is a protected intent that can only be sent 1894f83820bd7a0dc4c253071b31c443a316a49ce5aaSteve Naroff * by the system. 18959752f25748d954df99087d741ea35db37ff16beaSteve Naroff * 18969752f25748d954df99087d741ea35db37ff16beaSteve Naroff * {@hide} 1897d1861fd633d5096a00777c918eb8575ea7162fe7Steve Naroff */ 1898d1861fd633d5096a00777c918eb8575ea7162fe7Steve Naroff public static final String ACTION_REQUEST_SHUTDOWN = "android.intent.action.ACTION_REQUEST_SHUTDOWN"; 189960a9a2a404a4cf259d39133383e922aa00ca9043Anders Carlsson /** 190060a9a2a404a4cf259d39133383e922aa00ca9043Anders Carlsson * Broadcast Action: A sticky broadcast that indicates low memory 190160a9a2a404a4cf259d39133383e922aa00ca9043Anders Carlsson * condition on the device 1902a07c33e64e1169e4261f7748c7f9191091a3ad2eAnders Carlsson * 1903a07c33e64e1169e4261f7748c7f9191091a3ad2eAnders Carlsson * <p class="note">This is a protected intent that can only be sent 1904a07c33e64e1169e4261f7748c7f9191091a3ad2eAnders Carlsson * by the system. 190560a9a2a404a4cf259d39133383e922aa00ca9043Anders Carlsson */ 190660a9a2a404a4cf259d39133383e922aa00ca9043Anders Carlsson @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 190760a9a2a404a4cf259d39133383e922aa00ca9043Anders Carlsson public static final String ACTION_DEVICE_STORAGE_LOW = "android.intent.action.DEVICE_STORAGE_LOW"; 190860a9a2a404a4cf259d39133383e922aa00ca9043Anders Carlsson /** 190960a9a2a404a4cf259d39133383e922aa00ca9043Anders Carlsson * Broadcast Action: Indicates low memory condition on the device no longer exists 191060a9a2a404a4cf259d39133383e922aa00ca9043Anders Carlsson * 191160a9a2a404a4cf259d39133383e922aa00ca9043Anders Carlsson * <p class="note">This is a protected intent that can only be sent 191260a9a2a404a4cf259d39133383e922aa00ca9043Anders Carlsson * by the system. 191360a9a2a404a4cf259d39133383e922aa00ca9043Anders Carlsson */ 191460a9a2a404a4cf259d39133383e922aa00ca9043Anders Carlsson @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 191560a9a2a404a4cf259d39133383e922aa00ca9043Anders Carlsson public static final String ACTION_DEVICE_STORAGE_OK = "android.intent.action.DEVICE_STORAGE_OK"; 191660a9a2a404a4cf259d39133383e922aa00ca9043Anders Carlsson /** 191760a9a2a404a4cf259d39133383e922aa00ca9043Anders Carlsson * Broadcast Action: A sticky broadcast that indicates a memory full 191860a9a2a404a4cf259d39133383e922aa00ca9043Anders Carlsson * condition on the device. This is intended for activities that want 191960a9a2a404a4cf259d39133383e922aa00ca9043Anders Carlsson * to be able to fill the data partition completely, leaving only 192060a9a2a404a4cf259d39133383e922aa00ca9043Anders Carlsson * enough free space to prevent system-wide SQLite failures. 192160a9a2a404a4cf259d39133383e922aa00ca9043Anders Carlsson * 192260a9a2a404a4cf259d39133383e922aa00ca9043Anders Carlsson * <p class="note">This is a protected intent that can only be sent 192360a9a2a404a4cf259d39133383e922aa00ca9043Anders Carlsson * by the system. 192460a9a2a404a4cf259d39133383e922aa00ca9043Anders Carlsson * 192560a9a2a404a4cf259d39133383e922aa00ca9043Anders Carlsson * {@hide} 192660a9a2a404a4cf259d39133383e922aa00ca9043Anders Carlsson */ 192760a9a2a404a4cf259d39133383e922aa00ca9043Anders Carlsson @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 192860a9a2a404a4cf259d39133383e922aa00ca9043Anders Carlsson public static final String ACTION_DEVICE_STORAGE_FULL = "android.intent.action.DEVICE_STORAGE_FULL"; 192960a9a2a404a4cf259d39133383e922aa00ca9043Anders Carlsson /** 193060a9a2a404a4cf259d39133383e922aa00ca9043Anders Carlsson * Broadcast Action: Indicates memory full condition on the device 1931395b475a4474f1c7574d927ad142ca0c7997cbcaAnders Carlsson * no longer exists. 1932395b475a4474f1c7574d927ad142ca0c7997cbcaAnders Carlsson * 1933395b475a4474f1c7574d927ad142ca0c7997cbcaAnders Carlsson * <p class="note">This is a protected intent that can only be sent 1934395b475a4474f1c7574d927ad142ca0c7997cbcaAnders Carlsson * by the system. 1935395b475a4474f1c7574d927ad142ca0c7997cbcaAnders Carlsson * 1936395b475a4474f1c7574d927ad142ca0c7997cbcaAnders Carlsson * {@hide} 1937dd0257c77719a13d4acd513df40b04300cbfc871Douglas Gregor */ 1938dd0257c77719a13d4acd513df40b04300cbfc871Douglas Gregor @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 1939563a03b1338d31c2462def43253a722bc885d384Anders Carlsson public static final String ACTION_DEVICE_STORAGE_NOT_FULL = "android.intent.action.DEVICE_STORAGE_NOT_FULL"; 1940dd0257c77719a13d4acd513df40b04300cbfc871Douglas Gregor /** 1941dd0257c77719a13d4acd513df40b04300cbfc871Douglas Gregor * Broadcast Action: Indicates low memory condition notification acknowledged by user 1942563a03b1338d31c2462def43253a722bc885d384Anders Carlsson * and package management should be started. 1943dd0257c77719a13d4acd513df40b04300cbfc871Douglas Gregor * This is triggered by the user from the ACTION_DEVICE_STORAGE_LOW 1944395b475a4474f1c7574d927ad142ca0c7997cbcaAnders Carlsson * notification. 1945395b475a4474f1c7574d927ad142ca0c7997cbcaAnders Carlsson */ 1946395b475a4474f1c7574d927ad142ca0c7997cbcaAnders Carlsson @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 1947395b475a4474f1c7574d927ad142ca0c7997cbcaAnders Carlsson public static final String ACTION_MANAGE_PACKAGE_STORAGE = "android.intent.action.MANAGE_PACKAGE_STORAGE"; 19485f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer /** 19495f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * Broadcast Action: The device has entered USB Mass Storage mode. 19505f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * This is used mainly for the USB Settings panel. 1951d778f88d32b96a74c9edb7342c81357606a7cdc0Ted Kremenek * Apps should listen for ACTION_MEDIA_MOUNTED and ACTION_MEDIA_UNMOUNTED broadcasts to be notified 19522ce52f3fb95bf544db6bd3d91a72bce7d9cceb6cDouglas Gregor * when the SD card file system is mounted or unmounted 19535f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * @deprecated replaced by android.os.storage.StorageEventListener 19545f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer */ 19555f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer @Deprecated 19565f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer public static final String ACTION_UMS_CONNECTED = "android.intent.action.UMS_CONNECTED"; 19575f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer 19585f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer /** 1959b4e66d5259f90e9aae4d40fc5de801e046c7df94Douglas Gregor * Broadcast Action: The device has exited USB Mass Storage mode. 19605f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * This is used mainly for the USB Settings panel. 19615f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * Apps should listen for ACTION_MEDIA_MOUNTED and ACTION_MEDIA_UNMOUNTED broadcasts to be notified 196264c438a4be2a871fa43c78264663ba1e9788b94dArgyrios Kyrtzidis * when the SD card file system is mounted or unmounted 196364c438a4be2a871fa43c78264663ba1e9788b94dArgyrios Kyrtzidis * @deprecated replaced by android.os.storage.StorageEventListener 196464c438a4be2a871fa43c78264663ba1e9788b94dArgyrios Kyrtzidis */ 196564c438a4be2a871fa43c78264663ba1e9788b94dArgyrios Kyrtzidis @Deprecated 196664c438a4be2a871fa43c78264663ba1e9788b94dArgyrios Kyrtzidis public static final String ACTION_UMS_DISCONNECTED = "android.intent.action.UMS_DISCONNECTED"; 196764c438a4be2a871fa43c78264663ba1e9788b94dArgyrios Kyrtzidis 196864c438a4be2a871fa43c78264663ba1e9788b94dArgyrios Kyrtzidis /** 196964c438a4be2a871fa43c78264663ba1e9788b94dArgyrios Kyrtzidis * Broadcast Action: External media has been removed. 197064c438a4be2a871fa43c78264663ba1e9788b94dArgyrios Kyrtzidis * The path to the mount point for the removed media is contained in the Intent.mData field. 197164c438a4be2a871fa43c78264663ba1e9788b94dArgyrios Kyrtzidis */ 197264c438a4be2a871fa43c78264663ba1e9788b94dArgyrios Kyrtzidis @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 197364c438a4be2a871fa43c78264663ba1e9788b94dArgyrios Kyrtzidis public static final String ACTION_MEDIA_REMOVED = "android.intent.action.MEDIA_REMOVED"; 197464c438a4be2a871fa43c78264663ba1e9788b94dArgyrios Kyrtzidis 197564c438a4be2a871fa43c78264663ba1e9788b94dArgyrios Kyrtzidis /** 19768b9023ba35a86838789e2c9034a6128728c547aaChris Lattner * Broadcast Action: External media is present, but not mounted at its mount point. 19778b9023ba35a86838789e2c9034a6128728c547aaChris Lattner * The path to the mount point for the unmounted media is contained in the Intent.mData field. 19788b9023ba35a86838789e2c9034a6128728c547aaChris Lattner */ 1979b4e66d5259f90e9aae4d40fc5de801e046c7df94Douglas Gregor @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 19808b9023ba35a86838789e2c9034a6128728c547aaChris Lattner public static final String ACTION_MEDIA_UNMOUNTED = "android.intent.action.MEDIA_UNMOUNTED"; 19818b9023ba35a86838789e2c9034a6128728c547aaChris Lattner 1982e6327747b72bb687c948270f702ff53c30f411a6Chris Lattner /** 1983e6327747b72bb687c948270f702ff53c30f411a6Chris Lattner * Broadcast Action: External media is present, and being disk-checked 1984e6327747b72bb687c948270f702ff53c30f411a6Chris Lattner * The path to the mount point for the checking media is contained in the Intent.mData field. 1985e6327747b72bb687c948270f702ff53c30f411a6Chris Lattner */ 198677c9647cae939104c6cb2b6a4dd8ca859d2e5770Chris Lattner @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 198777c9647cae939104c6cb2b6a4dd8ca859d2e5770Chris Lattner public static final String ACTION_MEDIA_CHECKING = "android.intent.action.MEDIA_CHECKING"; 198877c9647cae939104c6cb2b6a4dd8ca859d2e5770Chris Lattner 198977c9647cae939104c6cb2b6a4dd8ca859d2e5770Chris Lattner /** 199077c9647cae939104c6cb2b6a4dd8ca859d2e5770Chris Lattner * Broadcast Action: External media is present, but is using an incompatible fs (or is blank) 199177c9647cae939104c6cb2b6a4dd8ca859d2e5770Chris Lattner * The path to the mount point for the checking media is contained in the Intent.mData field. 199277c9647cae939104c6cb2b6a4dd8ca859d2e5770Chris Lattner */ 199377c9647cae939104c6cb2b6a4dd8ca859d2e5770Chris Lattner @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 1994c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner public static final String ACTION_MEDIA_NOFS = "android.intent.action.MEDIA_NOFS"; 1995c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner 1996c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner /** 1997c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner * Broadcast Action: External media is present and mounted at its mount point. 1998c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner * The path to the mount point for the mounted media is contained in the Intent.mData field. 1999c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner * The Intent contains an extra with name "read-only" and Boolean value to indicate if the 2000c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner * media was mounted read only. 2001c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner */ 2002c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 2003c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner public static final String ACTION_MEDIA_MOUNTED = "android.intent.action.MEDIA_MOUNTED"; 2004c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner 2005c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner /** 2006c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner * Broadcast Action: External media is unmounted because it is being shared via USB mass storage. 2007c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner * The path to the mount point for the shared media is contained in the Intent.mData field. 2008c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner */ 2009c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 2010c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner public static final String ACTION_MEDIA_SHARED = "android.intent.action.MEDIA_SHARED"; 2011c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner 2012c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner /** 2013c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner * Broadcast Action: External media is no longer being shared via USB mass storage. 2014c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner * The path to the mount point for the previously shared media is contained in the Intent.mData field. 2015c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner * 2016c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner * @hide 2017898574e7496ba8fd76290079d3a9d06954992734Douglas Gregor */ 20187e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor public static final String ACTION_MEDIA_UNSHARED = "android.intent.action.MEDIA_UNSHARED"; 20197e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor 2020898574e7496ba8fd76290079d3a9d06954992734Douglas Gregor /** 20217e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor * Broadcast Action: External media was removed from SD card slot, but mount point was not unmounted. 20227e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor * The path to the mount point for the removed media is contained in the Intent.mData field. 2023898574e7496ba8fd76290079d3a9d06954992734Douglas Gregor */ 2024c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 20257e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor public static final String ACTION_MEDIA_BAD_REMOVAL = "android.intent.action.MEDIA_BAD_REMOVAL"; 20267e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor 2027c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner /** 20287e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor * Broadcast Action: External media is present but cannot be mounted. 20297e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor * The path to the mount point for the unmountable media is contained in the Intent.mData field. 2030c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner */ 2031c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 203225a3ef7cc5fd55dc8cc67c6e6770c8595657e082Douglas Gregor public static final String ACTION_MEDIA_UNMOUNTABLE = "android.intent.action.MEDIA_UNMOUNTABLE"; 203325a3ef7cc5fd55dc8cc67c6e6770c8595657e082Douglas Gregor 203425a3ef7cc5fd55dc8cc67c6e6770c8595657e082Douglas Gregor /** 203525a3ef7cc5fd55dc8cc67c6e6770c8595657e082Douglas Gregor * Broadcast Action: User has expressed the desire to remove the external storage media. 203697fbaa2a38804268a024f1a104b43fcf8b4411b0Argyrios Kyrtzidis * Applications should close all files they have open within the mount point when they receive this intent. 203725a3ef7cc5fd55dc8cc67c6e6770c8595657e082Douglas Gregor * The path to the mount point for the media to be ejected is contained in the Intent.mData field. 203825a3ef7cc5fd55dc8cc67c6e6770c8595657e082Douglas Gregor */ 203925a3ef7cc5fd55dc8cc67c6e6770c8595657e082Douglas Gregor @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 204025a3ef7cc5fd55dc8cc67c6e6770c8595657e082Douglas Gregor public static final String ACTION_MEDIA_EJECT = "android.intent.action.MEDIA_EJECT"; 204125a3ef7cc5fd55dc8cc67c6e6770c8595657e082Douglas Gregor 204225a3ef7cc5fd55dc8cc67c6e6770c8595657e082Douglas Gregor /** 20431275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor * Broadcast Action: The media scanner has started scanning a directory. 20441275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor * The path to the directory being scanned is contained in the Intent.mData field. 20451275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor */ 20461275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 20471275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor public static final String ACTION_MEDIA_SCANNER_STARTED = "android.intent.action.MEDIA_SCANNER_STARTED"; 20481275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor 20491275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor /** 20501275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor * Broadcast Action: The media scanner has finished scanning a directory. 20511275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor * The path to the scanned directory is contained in the Intent.mData field. 20521275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor */ 20531275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 20541275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor public static final String ACTION_MEDIA_SCANNER_FINISHED = "android.intent.action.MEDIA_SCANNER_FINISHED"; 20551275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor 20561275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor /** 20571275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor * Broadcast Action: Request the media scanner to scan a file and add it to the media database. 20581275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor * The path to the file is contained in the Intent.mData field. 20591275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor */ 20601275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 20611275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor public static final String ACTION_MEDIA_SCANNER_SCAN_FILE = "android.intent.action.MEDIA_SCANNER_SCAN_FILE"; 20621275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor 20631275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor /** 20641275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor * Broadcast Action: The "Media Button" was pressed. Includes a single 20651275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor * extra field, {@link #EXTRA_KEY_EVENT}, containing the key event that 20661275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor * caused the broadcast. 20671275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor */ 20681275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 20691275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor public static final String ACTION_MEDIA_BUTTON = "android.intent.action.MEDIA_BUTTON"; 20701275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor 20711275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor /** 20721275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor * Broadcast Action: The "Camera Button" was pressed. Includes a single 20731275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor * extra field, {@link #EXTRA_KEY_EVENT}, containing the key event that 20741275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor * caused the broadcast. 20751275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor */ 20761275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 20771275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor public static final String ACTION_CAMERA_BUTTON = "android.intent.action.CAMERA_BUTTON"; 20781275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor 20791275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor // *** NOTE: @todo(*) The following really should go into a more domain-specific 20801275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor // location; they are not general-purpose actions. 20811275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor 20821275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor /** 20831275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor * Broadcast Action: A GTalk connection has been established. 20841275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor */ 20851275ae098acda31fe0e434510c729fcfed0458a1Douglas Gregor @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 2086d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor public static final String ACTION_GTALK_SERVICE_CONNECTED = 2087d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor "android.intent.action.GTALK_CONNECTED"; 2088d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor 2089d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor /** 2090d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor * Broadcast Action: A GTalk connection has been disconnected. 2091d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor */ 2092d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 2093d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor public static final String ACTION_GTALK_SERVICE_DISCONNECTED = 2094d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor "android.intent.action.GTALK_DISCONNECTED"; 2095d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor 2096d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor /** 2097d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor * Broadcast Action: An input method has been changed. 2098d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor */ 2099d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 2100d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor public static final String ACTION_INPUT_METHOD_CHANGED = 2101d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor "android.intent.action.INPUT_METHOD_CHANGED"; 2102d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor 2103d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor /** 2104d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor * <p>Broadcast Action: The user has switched the phone into or out of Airplane Mode. One or 2105d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor * more radios have been turned off or on. The intent will have the following extra value:</p> 2106d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor * <ul> 2107d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor * <li><em>state</em> - A boolean value indicating whether Airplane Mode is on. If true, 2108d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor * then cell radio and possibly other radios such as bluetooth or WiFi may have also been 2109d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor * turned off</li> 2110d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor * </ul> 2111d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor * 2112d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor * <p class="note">This is a protected intent that can only be sent 2113d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor * by the system. 2114d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor */ 2115d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 2116d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor public static final String ACTION_AIRPLANE_MODE_CHANGED = "android.intent.action.AIRPLANE_MODE"; 2117d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor 2118d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor /** 2119d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor * Broadcast Action: Some content providers have parts of their namespace 2120d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor * where they publish new events or items that the user may be especially 2121d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor * interested in. For these things, they may broadcast this action when the 2122d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor * set of interesting items change. 2123d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor * 2124d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor * For example, GmailProvider sends this notification when the set of unread 2125d57959af02b4af695276f4204443afe6e5d86bd8Douglas Gregor * mail in the inbox changes. 2126c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner * 2127c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner * <p>The data of the intent identifies which part of which provider 2128c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner * changed. When queried through the content resolver, the data URI will 2129c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner * return the data set in question. 2130c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner * 2131c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner * <p>The intent will have the following extra values: 2132c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner * <ul> 2133c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner * <li><em>count</em> - The number of items in the data set. This is the 2134c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner * same as the number of items in the cursor returned by querying the 2135c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner * data URI. </li> 2136c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner * </ul> 2137c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner * 2138f11284ac87daa613bc7b30db9f54bd716d123222Fariborz Jahanian * This intent will be sent at boot (if the count is non-zero) and when the 2139c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner * data set changes. It is possible for the data set to change without the 2140c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner * count changing (for example, if a new unread message arrives in the same 2141c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner * sync operation in which a message is archived). The phone should still 2142c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner * ring/vibrate/etc as normal in this case. 2143c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner */ 2144c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 2145c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner public static final String ACTION_PROVIDER_CHANGED = 2146c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner "android.intent.action.PROVIDER_CHANGED"; 2147c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner 2148c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner /** 2149c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner * Broadcast Action: Wired Headset plugged in or unplugged. 2150c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner * 2151c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner * <p>The intent will have the following extra values: 2152c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner * <ul> 2153c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner * <li><em>state</em> - 0 for unplugged, 1 for plugged. </li> 2154c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner * <li><em>name</em> - Headset type, human readable string </li> 2155f11284ac87daa613bc7b30db9f54bd716d123222Fariborz Jahanian * <li><em>microphone</em> - 1 if headset has a microphone, 0 otherwise </li> 2156c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner * </ul> 2157f11284ac87daa613bc7b30db9f54bd716d123222Fariborz Jahanian * </ul> 2158f11284ac87daa613bc7b30db9f54bd716d123222Fariborz Jahanian */ 2159f11284ac87daa613bc7b30db9f54bd716d123222Fariborz Jahanian @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 2160c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner public static final String ACTION_HEADSET_PLUG = 2161c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner "android.intent.action.HEADSET_PLUG"; 2162c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner 2163c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner /** 2164c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner * Broadcast Action: An analog audio speaker/headset plugged in or unplugged. 2165c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner * 2166c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner * <p>The intent will have the following extra values: 2167c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner * <ul> 2168c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner * <li><em>state</em> - 0 for unplugged, 1 for plugged. </li> 2169c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner * <li><em>name</em> - Headset type, human readable string </li> 2170c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner * </ul> 2171c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner * </ul> 2172c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner * @hide 2173c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner */ 2174c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 2175c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner public static final String ACTION_ANALOG_AUDIO_DOCK_PLUG = 2176c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner "android.intent.action.ANALOG_AUDIO_DOCK_PLUG"; 2177c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner 2178c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner /** 2179c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner * Broadcast Action: A digital audio speaker/headset plugged in or unplugged. 2180f11284ac87daa613bc7b30db9f54bd716d123222Fariborz Jahanian * 2181c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner * <p>The intent will have the following extra values: 2182c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner * <ul> 2183c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner * <li><em>state</em> - 0 for unplugged, 1 for plugged. </li> 2184c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner * <li><em>name</em> - Headset type, human readable string </li> 2185c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner * </ul> 2186c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner * </ul> 2187c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner * @hide 2188c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner */ 2189c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 21907e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor public static final String ACTION_DIGITAL_AUDIO_DOCK_PLUG = 2191898574e7496ba8fd76290079d3a9d06954992734Douglas Gregor "android.intent.action.DIGITAL_AUDIO_DOCK_PLUG"; 2192898574e7496ba8fd76290079d3a9d06954992734Douglas Gregor 2193898574e7496ba8fd76290079d3a9d06954992734Douglas Gregor /** 2194898574e7496ba8fd76290079d3a9d06954992734Douglas Gregor * Broadcast Action: A HMDI cable was plugged or unplugged 2195898574e7496ba8fd76290079d3a9d06954992734Douglas Gregor * 2196898574e7496ba8fd76290079d3a9d06954992734Douglas Gregor * <p>The intent will have the following extra values: 2197898574e7496ba8fd76290079d3a9d06954992734Douglas Gregor * <ul> 21987e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor * <li><em>state</em> - 0 for unplugged, 1 for plugged. </li> 21997e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor * <li><em>name</em> - HDMI cable, human readable string </li> 2200c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner * </ul> 2201c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner * </ul> 22027e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor * @hide 22037e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor */ 2204c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 22057e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor public static final String ACTION_HDMI_AUDIO_PLUG = 22067e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor "android.intent.action.HDMI_AUDIO_PLUG"; 220777c9647cae939104c6cb2b6a4dd8ca859d2e5770Chris Lattner 220877c9647cae939104c6cb2b6a4dd8ca859d2e5770Chris Lattner /** 220977c9647cae939104c6cb2b6a4dd8ca859d2e5770Chris Lattner * Broadcast Action: A USB audio accessory was plugged in or unplugged. 2210e6327747b72bb687c948270f702ff53c30f411a6Chris Lattner * 2211e6327747b72bb687c948270f702ff53c30f411a6Chris Lattner * <p>The intent will have the following extra values: 2212e6327747b72bb687c948270f702ff53c30f411a6Chris Lattner * <ul> 2213e6327747b72bb687c948270f702ff53c30f411a6Chris Lattner * <li><em>state</em> - 0 for unplugged, 1 for plugged. </li> 2214e6327747b72bb687c948270f702ff53c30f411a6Chris Lattner * <li><em>card</em> - ALSA card number (integer) </li> 2215e6327747b72bb687c948270f702ff53c30f411a6Chris Lattner * <li><em>device</em> - ALSA device number (integer) </li> 2216e6327747b72bb687c948270f702ff53c30f411a6Chris Lattner * </ul> 2217c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner * </ul> 2218c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner * @hide 2219c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner */ 2220c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 2221c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner public static final String ACTION_USB_AUDIO_ACCESSORY_PLUG = 2222c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner "android.intent.action.USB_AUDIO_ACCESSORY_PLUG"; 2223e6327747b72bb687c948270f702ff53c30f411a6Chris Lattner 2224c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner /** 2225e6327747b72bb687c948270f702ff53c30f411a6Chris Lattner * Broadcast Action: A USB audio device was plugged in or unplugged. 2226e6327747b72bb687c948270f702ff53c30f411a6Chris Lattner * 2227c63a1f276f7b324fd9a4be82098b1c8f7bf30733Chris Lattner * <p>The intent will have the following extra values: 2228e6327747b72bb687c948270f702ff53c30f411a6Chris Lattner * <ul> 2229e6327747b72bb687c948270f702ff53c30f411a6Chris Lattner * <li><em>state</em> - 0 for unplugged, 1 for plugged. </li> 22305e03f9ea8174ae588c5e69ec6b5ef4c68f8fd766Douglas Gregor * <li><em>card</em> - ALSA card number (integer) </li> 22315e03f9ea8174ae588c5e69ec6b5ef4c68f8fd766Douglas Gregor * <li><em>device</em> - ALSA device number (integer) </li> 22325e03f9ea8174ae588c5e69ec6b5ef4c68f8fd766Douglas Gregor * </ul> 22335e03f9ea8174ae588c5e69ec6b5ef4c68f8fd766Douglas Gregor * </ul> 22345e03f9ea8174ae588c5e69ec6b5ef4c68f8fd766Douglas Gregor * @hide 22355e03f9ea8174ae588c5e69ec6b5ef4c68f8fd766Douglas Gregor */ 22366dcbc294f9b2c45680dd3227e885712c2814ec0eMike Stump @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 22375e03f9ea8174ae588c5e69ec6b5ef4c68f8fd766Douglas Gregor public static final String ACTION_USB_AUDIO_DEVICE_PLUG = 22385e03f9ea8174ae588c5e69ec6b5ef4c68f8fd766Douglas Gregor "android.intent.action.USB_AUDIO_DEVICE_PLUG"; 22395e03f9ea8174ae588c5e69ec6b5ef4c68f8fd766Douglas Gregor 22405e03f9ea8174ae588c5e69ec6b5ef4c68f8fd766Douglas Gregor /** 22415e03f9ea8174ae588c5e69ec6b5ef4c68f8fd766Douglas Gregor * <p>Broadcast Action: The user has switched on advanced settings in the settings app:</p> 2242d786f6a6b791b5901fa9fd39a2bbf924afbc1252Daniel Dunbar * <ul> 22436183a99b064b397d98297904fbd6cf00fe1f453dAnders Carlsson * <li><em>state</em> - A boolean value indicating whether the settings is on or off.</li> 22446183a99b064b397d98297904fbd6cf00fe1f453dAnders Carlsson * </ul> 22456183a99b064b397d98297904fbd6cf00fe1f453dAnders Carlsson * 22466183a99b064b397d98297904fbd6cf00fe1f453dAnders Carlsson * <p class="note">This is a protected intent that can only be sent 22476183a99b064b397d98297904fbd6cf00fe1f453dAnders Carlsson * by the system. 22486183a99b064b397d98297904fbd6cf00fe1f453dAnders Carlsson * 22496183a99b064b397d98297904fbd6cf00fe1f453dAnders Carlsson * @hide 22506183a99b064b397d98297904fbd6cf00fe1f453dAnders Carlsson */ 22515f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer //@SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 22525f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer public static final String ACTION_ADVANCED_SETTINGS_CHANGED 2253a75cea3f6be0daa8054d36af81a6ffda1713f82dChris Lattner = "android.intent.action.ADVANCED_SETTINGS"; 2254ebb97e98c03f8d7034bd3748a10e35f39a95c289Christopher Lamb 22555f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer /** 2256a75cea3f6be0daa8054d36af81a6ffda1713f82dChris Lattner * Broadcast Action: An outgoing call is about to be placed. 2257d786f6a6b791b5901fa9fd39a2bbf924afbc1252Daniel Dunbar * 2258ebb97e98c03f8d7034bd3748a10e35f39a95c289Christopher Lamb * <p>The Intent will have the following extra value: 2259a75cea3f6be0daa8054d36af81a6ffda1713f82dChris Lattner * <ul> 22605f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * <li><em>{@link android.content.Intent#EXTRA_PHONE_NUMBER}</em> - 22615f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * the phone number originally intended to be dialed.</li> 22625f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * </ul> 22635f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * <p>Once the broadcast is finished, the resultData is used as the actual 22645f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * number to call. If <code>null</code>, no call will be placed.</p> 22655f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * <p>It is perfectly acceptable for multiple receivers to process the 2266716c7304ff5d27a95e1e7823acd1d09d5ec3e37fSteve Naroff * outgoing call in turn: for example, a parental control application 2267716c7304ff5d27a95e1e7823acd1d09d5ec3e37fSteve Naroff * might verify that the user is authorized to place the call at that 2268716c7304ff5d27a95e1e7823acd1d09d5ec3e37fSteve Naroff * time, then a number-rewriting application might add an area code if 2269716c7304ff5d27a95e1e7823acd1d09d5ec3e37fSteve Naroff * one was not specified.</p> 22701361b11066239ea15764a2a844405352d87296b3Chris Lattner * <p>For consistency, any receiver whose purpose is to prohibit phone 22711361b11066239ea15764a2a844405352d87296b3Chris Lattner * calls should have a priority of 0, to ensure it will see the final 22721361b11066239ea15764a2a844405352d87296b3Chris Lattner * phone number to be dialed. 22731361b11066239ea15764a2a844405352d87296b3Chris Lattner * Any receiver whose purpose is to rewrite phone numbers to be called 22741361b11066239ea15764a2a844405352d87296b3Chris Lattner * should have a positive priority. 2275716c7304ff5d27a95e1e7823acd1d09d5ec3e37fSteve Naroff * Negative priorities are reserved for the system for this broadcast; 2276f1448a0e4a1e868ff873a8530a61a09cb68666ccSteve Naroff * using them may cause problems.</p> 2277f1448a0e4a1e868ff873a8530a61a09cb68666ccSteve Naroff * <p>Any BroadcastReceiver receiving this Intent <em>must not</em> 2278f1448a0e4a1e868ff873a8530a61a09cb68666ccSteve Naroff * abort the broadcast.</p> 2279f1448a0e4a1e868ff873a8530a61a09cb68666ccSteve Naroff * <p>Emergency calls cannot be intercepted using this mechanism, and 2280f1448a0e4a1e868ff873a8530a61a09cb68666ccSteve Naroff * other calls cannot be modified to call emergency numbers using this 22811361b11066239ea15764a2a844405352d87296b3Chris Lattner * mechanism. 22821361b11066239ea15764a2a844405352d87296b3Chris Lattner * <p>You must hold the 22831361b11066239ea15764a2a844405352d87296b3Chris Lattner * {@link android.Manifest.permission#PROCESS_OUTGOING_CALLS} 22841361b11066239ea15764a2a844405352d87296b3Chris Lattner * permission to receive this Intent.</p> 22851361b11066239ea15764a2a844405352d87296b3Chris Lattner * 22861361b11066239ea15764a2a844405352d87296b3Chris Lattner * <p class="note">This is a protected intent that can only be sent 22871361b11066239ea15764a2a844405352d87296b3Chris Lattner * by the system. 22885f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer */ 22895f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 22905f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer public static final String ACTION_NEW_OUTGOING_CALL = 22917cfeb08f2466d6263ec6ff1402298f93f6d6991fChris Lattner "android.intent.action.NEW_OUTGOING_CALL"; 22927cfeb08f2466d6263ec6ff1402298f93f6d6991fChris Lattner 22937cfeb08f2466d6263ec6ff1402298f93f6d6991fChris Lattner /** 22947cfeb08f2466d6263ec6ff1402298f93f6d6991fChris Lattner * Broadcast Action: Have the device reboot. This is only for use by 2295a75cea3f6be0daa8054d36af81a6ffda1713f82dChris Lattner * system code. 2296a75cea3f6be0daa8054d36af81a6ffda1713f82dChris Lattner * 2297a75cea3f6be0daa8054d36af81a6ffda1713f82dChris Lattner * <p class="note">This is a protected intent that can only be sent 2298a75cea3f6be0daa8054d36af81a6ffda1713f82dChris Lattner * by the system. 2299a75cea3f6be0daa8054d36af81a6ffda1713f82dChris Lattner */ 2300fb0d49669aa370b4c0993c5cee60275ef9fd6518Steve Naroff @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 2301a75cea3f6be0daa8054d36af81a6ffda1713f82dChris Lattner public static final String ACTION_REBOOT = 2302fb0d49669aa370b4c0993c5cee60275ef9fd6518Steve Naroff "android.intent.action.REBOOT"; 2303fb0d49669aa370b4c0993c5cee60275ef9fd6518Steve Naroff 23045f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer /** 23055f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * Broadcast Action: A sticky broadcast for changes in the physical 2306f52ab250ff92bc51a9ac9a8e19bd43b63a5f844fChris Lattner * docking state of the device. 2307f52ab250ff92bc51a9ac9a8e19bd43b63a5f844fChris Lattner * 2308f52ab250ff92bc51a9ac9a8e19bd43b63a5f844fChris Lattner * <p>The intent will have the following extra values: 2309f98aba35e6c3da5aae61843fc01334939e4e12ecEli Friedman * <ul> 2310f52ab250ff92bc51a9ac9a8e19bd43b63a5f844fChris Lattner * <li><em>{@link #EXTRA_DOCK_STATE}</em> - the current dock 2311f98aba35e6c3da5aae61843fc01334939e4e12ecEli Friedman * state, indicating which dock the device is physically in.</li> 2312f98aba35e6c3da5aae61843fc01334939e4e12ecEli Friedman * </ul> 2313f98aba35e6c3da5aae61843fc01334939e4e12ecEli Friedman * <p>This is intended for monitoring the current physical dock state. 2314a34267595534a72703290153a6f7e3da1adcec59Eli Friedman * See {@link android.app.UiModeManager} for the normal API dealing with 2315a34267595534a72703290153a6f7e3da1adcec59Eli Friedman * dock mode changes. 2316a34267595534a72703290153a6f7e3da1adcec59Eli Friedman */ 2317f5c209d23b20ada4a9b6235db50317239cbf6ae1Alisdair Meredith @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 2318f5c209d23b20ada4a9b6235db50317239cbf6ae1Alisdair Meredith public static final String ACTION_DOCK_EVENT = 2319f5c209d23b20ada4a9b6235db50317239cbf6ae1Alisdair Meredith "android.intent.action.DOCK_EVENT"; 2320f5c209d23b20ada4a9b6235db50317239cbf6ae1Alisdair Meredith 2321f5c209d23b20ada4a9b6235db50317239cbf6ae1Alisdair Meredith /** 2322f5c209d23b20ada4a9b6235db50317239cbf6ae1Alisdair Meredith * Broadcast Action: a remote intent is to be broadcasted. 2323f98aba35e6c3da5aae61843fc01334939e4e12ecEli Friedman * 2324f98aba35e6c3da5aae61843fc01334939e4e12ecEli Friedman * A remote intent is used for remote RPC between devices. The remote intent 2325f98aba35e6c3da5aae61843fc01334939e4e12ecEli Friedman * is serialized and sent from one device to another device. The receiving 23261b63e4f732dbc73d90abf886b4d21f8e3a165f6dChris Lattner * device parses the remote intent and broadcasts it. Note that anyone can 2327f98aba35e6c3da5aae61843fc01334939e4e12ecEli Friedman * broadcast a remote intent. However, if the intent receiver of the remote intent 2328f98aba35e6c3da5aae61843fc01334939e4e12ecEli Friedman * does not trust intent broadcasts from arbitrary intent senders, it should require 2329f52ab250ff92bc51a9ac9a8e19bd43b63a5f844fChris Lattner * the sender to hold certain permissions so only trusted sender's broadcast will be 23307cfeb08f2466d6263ec6ff1402298f93f6d6991fChris Lattner * let through. 23317cfeb08f2466d6263ec6ff1402298f93f6d6991fChris Lattner * @hide 2332f98aba35e6c3da5aae61843fc01334939e4e12ecEli Friedman */ 23337cfeb08f2466d6263ec6ff1402298f93f6d6991fChris Lattner public static final String ACTION_REMOTE_INTENT = 23347cfeb08f2466d6263ec6ff1402298f93f6d6991fChris Lattner "com.google.android.c2dm.intent.RECEIVE"; 23357cfeb08f2466d6263ec6ff1402298f93f6d6991fChris Lattner 23367cfeb08f2466d6263ec6ff1402298f93f6d6991fChris Lattner /** 2337f98aba35e6c3da5aae61843fc01334939e4e12ecEli Friedman * Broadcast Action: hook for permforming cleanup after a system update. 23387cfeb08f2466d6263ec6ff1402298f93f6d6991fChris Lattner * 23397cfeb08f2466d6263ec6ff1402298f93f6d6991fChris Lattner * The broadcast is sent when the system is booting, before the 2340f98aba35e6c3da5aae61843fc01334939e4e12ecEli Friedman * BOOT_COMPLETED broadcast. It is only sent to receivers in the system 23417cfeb08f2466d6263ec6ff1402298f93f6d6991fChris Lattner * image. A receiver for this should do its work and then disable itself 23427cfeb08f2466d6263ec6ff1402298f93f6d6991fChris Lattner * so that it does not get run again at the next boot. 2343f98aba35e6c3da5aae61843fc01334939e4e12ecEli Friedman * @hide 23447cfeb08f2466d6263ec6ff1402298f93f6d6991fChris Lattner */ 23457cfeb08f2466d6263ec6ff1402298f93f6d6991fChris Lattner public static final String ACTION_PRE_BOOT_COMPLETED = 2346f98aba35e6c3da5aae61843fc01334939e4e12ecEli Friedman "android.intent.action.PRE_BOOT_COMPLETED"; 23477cfeb08f2466d6263ec6ff1402298f93f6d6991fChris Lattner 23487cfeb08f2466d6263ec6ff1402298f93f6d6991fChris Lattner /** 2349f98aba35e6c3da5aae61843fc01334939e4e12ecEli Friedman * Sent the first time a user is starting, to allow system apps to 23502df9ced9fd1e8c7d7b38443db07e0e811de22571Chris Lattner * perform one time initialization. (This will not be seen by third 23512df9ced9fd1e8c7d7b38443db07e0e811de22571Chris Lattner * party applications because a newly initialized user does not have any 23522df9ced9fd1e8c7d7b38443db07e0e811de22571Chris Lattner * third party applications installed for it.) This is sent early in 2353f52ab250ff92bc51a9ac9a8e19bd43b63a5f844fChris Lattner * starting the user, around the time the home app is started, before 2354f52ab250ff92bc51a9ac9a8e19bd43b63a5f844fChris Lattner * {@link #ACTION_BOOT_COMPLETED} is sent. This is sent as a foreground 2355f52ab250ff92bc51a9ac9a8e19bd43b63a5f844fChris Lattner * broadcast, since it is part of a visible user interaction; be as quick 23567cfeb08f2466d6263ec6ff1402298f93f6d6991fChris Lattner * as possible when handling it. 23577cfeb08f2466d6263ec6ff1402298f93f6d6991fChris Lattner */ 23587cfeb08f2466d6263ec6ff1402298f93f6d6991fChris Lattner public static final String ACTION_USER_INITIALIZE = 23597cfeb08f2466d6263ec6ff1402298f93f6d6991fChris Lattner "android.intent.action.USER_INITIALIZE"; 2360f52ab250ff92bc51a9ac9a8e19bd43b63a5f844fChris Lattner 2361f52ab250ff92bc51a9ac9a8e19bd43b63a5f844fChris Lattner /** 23627cfeb08f2466d6263ec6ff1402298f93f6d6991fChris Lattner * Sent when a user switch is happening, causing the process's user to be 23635f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * brought to the foreground. This is only sent to receivers registered 2364f52ab250ff92bc51a9ac9a8e19bd43b63a5f844fChris Lattner * through {@link Context#registerReceiver(BroadcastReceiver, IntentFilter) 2365f52ab250ff92bc51a9ac9a8e19bd43b63a5f844fChris Lattner * Context.registerReceiver}. It is sent to the user that is going to the 23665f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * foreground. This is sent as a foreground 23677cfeb08f2466d6263ec6ff1402298f93f6d6991fChris Lattner * broadcast, since it is part of a visible user interaction; be as quick 23687cfeb08f2466d6263ec6ff1402298f93f6d6991fChris Lattner * as possible when handling it. 23695f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer */ 23707cfeb08f2466d6263ec6ff1402298f93f6d6991fChris Lattner public static final String ACTION_USER_FOREGROUND = 23717cfeb08f2466d6263ec6ff1402298f93f6d6991fChris Lattner "android.intent.action.USER_FOREGROUND"; 23727cfeb08f2466d6263ec6ff1402298f93f6d6991fChris Lattner 23737cfeb08f2466d6263ec6ff1402298f93f6d6991fChris Lattner /** 23747cfeb08f2466d6263ec6ff1402298f93f6d6991fChris Lattner * Sent when a user switch is happening, causing the process's user to be 23757cfeb08f2466d6263ec6ff1402298f93f6d6991fChris Lattner * sent to the background. This is only sent to receivers registered 23767cfeb08f2466d6263ec6ff1402298f93f6d6991fChris Lattner * through {@link Context#registerReceiver(BroadcastReceiver, IntentFilter) 23777cfeb08f2466d6263ec6ff1402298f93f6d6991fChris Lattner * Context.registerReceiver}. It is sent to the user that is going to the 23787cfeb08f2466d6263ec6ff1402298f93f6d6991fChris Lattner * background. This is sent as a foreground 23797cfeb08f2466d6263ec6ff1402298f93f6d6991fChris Lattner * broadcast, since it is part of a visible user interaction; be as quick 23807cfeb08f2466d6263ec6ff1402298f93f6d6991fChris Lattner * as possible when handling it. 23817cfeb08f2466d6263ec6ff1402298f93f6d6991fChris Lattner */ 23827cfeb08f2466d6263ec6ff1402298f93f6d6991fChris Lattner public static final String ACTION_USER_BACKGROUND = 23837cfeb08f2466d6263ec6ff1402298f93f6d6991fChris Lattner "android.intent.action.USER_BACKGROUND"; 23847cfeb08f2466d6263ec6ff1402298f93f6d6991fChris Lattner 23857cfeb08f2466d6263ec6ff1402298f93f6d6991fChris Lattner /** 23867cfeb08f2466d6263ec6ff1402298f93f6d6991fChris Lattner * Broadcast sent to the system when a user is added. Carries an extra 23877cfeb08f2466d6263ec6ff1402298f93f6d6991fChris Lattner * EXTRA_USER_HANDLE that has the userHandle of the new user. It is sent to 23887cfeb08f2466d6263ec6ff1402298f93f6d6991fChris Lattner * all running users. You must hold 23897cfeb08f2466d6263ec6ff1402298f93f6d6991fChris Lattner * {@link android.Manifest.permission#MANAGE_USERS} to receive this broadcast. 23905f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer * @hide 23917cfeb08f2466d6263ec6ff1402298f93f6d6991fChris Lattner */ 23927cfeb08f2466d6263ec6ff1402298f93f6d6991fChris Lattner public static final String ACTION_USER_ADDED = 23937cfeb08f2466d6263ec6ff1402298f93f6d6991fChris Lattner "android.intent.action.USER_ADDED"; 23947cfeb08f2466d6263ec6ff1402298f93f6d6991fChris Lattner 23955f016e2cb5d11daeb237544de1c5d59f20fe1a6eReid Spencer /** 239671993dd85eed9cc42c6b2fa61ee5c53026b74817Anders Carlsson * Broadcast sent by the system when a user is started. Carries an extra 239771993dd85eed9cc42c6b2fa61ee5c53026b74817Anders Carlsson * EXTRA_USER_HANDLE that has the userHandle of the user. This is only sent to 239871993dd85eed9cc42c6b2fa61ee5c53026b74817Anders Carlsson * registered receivers, not manifest receivers. It is sent to the user 239971993dd85eed9cc42c6b2fa61ee5c53026b74817Anders Carlsson * that has been started. This is sent as a foreground 24006c2b6eb8d836da19007f7540709e16d5e39a1cbaChris Lattner * broadcast, since it is part of a visible user interaction; be as quick 240139ba4aeca296b1c9f04bde7d9d3cbbf129f1abd3Argyrios Kyrtzidis * as possible when handling it. 2402df042e6c2bf06b2d9ed53c52469599ac1bd93a3fTed Kremenek * @hide 2403f06273f8bbacb086a46bde456429c8d08f6d07eeAnders Carlsson */ 240471993dd85eed9cc42c6b2fa61ee5c53026b74817Anders Carlsson public static final String ACTION_USER_STARTED = 240571993dd85eed9cc42c6b2fa61ee5c53026b74817Anders Carlsson "android.intent.action.USER_STARTED"; 240671993dd85eed9cc42c6b2fa61ee5c53026b74817Anders Carlsson 2407f06273f8bbacb086a46bde456429c8d08f6d07eeAnders Carlsson /** 2408f06273f8bbacb086a46bde456429c8d08f6d07eeAnders Carlsson * Broadcast sent when a user is in the process of starting. Carries an extra 240971993dd85eed9cc42c6b2fa61ee5c53026b74817Anders Carlsson * EXTRA_USER_HANDLE that has the userHandle of the user. This is only 2410f06273f8bbacb086a46bde456429c8d08f6d07eeAnders Carlsson * sent to registered receivers, not manifest receivers. It is sent to all 241171993dd85eed9cc42c6b2fa61ee5c53026b74817Anders Carlsson * users (including the one that is being started). You must hold 2412f06273f8bbacb086a46bde456429c8d08f6d07eeAnders Carlsson * {@link android.Manifest.permission#INTERACT_ACROSS_USERS} to receive 241371993dd85eed9cc42c6b2fa61ee5c53026b74817Anders Carlsson * this broadcast. This is sent as a background broadcast, since 241444b4321feab46299d3f5cfd404680884752a0fcfDouglas Gregor * its result is not part of the primary UX flow; to safely keep track of 241544b4321feab46299d3f5cfd404680884752a0fcfDouglas Gregor * started/stopped state of a user you can use this in conjunction with 241644b4321feab46299d3f5cfd404680884752a0fcfDouglas Gregor * {@link #ACTION_USER_STOPPING}. It is <b>not</b> generally safe to use with 241744b4321feab46299d3f5cfd404680884752a0fcfDouglas Gregor * other user state broadcasts since those are foreground broadcasts so can 241844b4321feab46299d3f5cfd404680884752a0fcfDouglas Gregor * execute in a different order. 24194afa39deaa245592977136d367251ee2c173dd8dDouglas Gregor * @hide 242017945a0f64fe03ff6ec0c2146005a87636e3ac12Argyrios Kyrtzidis */ 242144b4321feab46299d3f5cfd404680884752a0fcfDouglas Gregor public static final String ACTION_USER_STARTING = 242244b4321feab46299d3f5cfd404680884752a0fcfDouglas Gregor "android.intent.action.USER_STARTING"; 242344b4321feab46299d3f5cfd404680884752a0fcfDouglas Gregor 242471993dd85eed9cc42c6b2fa61ee5c53026b74817Anders Carlsson /** 242571993dd85eed9cc42c6b2fa61ee5c53026b74817Anders Carlsson * Broadcast sent when a user is going to be stopped. Carries an extra 242671993dd85eed9cc42c6b2fa61ee5c53026b74817Anders Carlsson * EXTRA_USER_HANDLE that has the userHandle of the user. This is only 24278467583c2704e7a9691ea56939a029015f0ade0aGabor Greif * sent to registered receivers, not manifest receivers. It is sent to all 2428b2cf3573d7351094f6247fcca94703ce88eb9ee0Anders Carlsson * users (including the one that is being stopped). You must hold 2429319ac896a0fef7365d5589b8021db7e41207fe42Douglas Gregor * {@link android.Manifest.permission#INTERACT_ACROSS_USERS} to receive 243035366a67baa970c287c714c957cf78a4131cf60dTed Kremenek * this broadcast. The user will not stop until all receivers have 2431319ac896a0fef7365d5589b8021db7e41207fe42Douglas Gregor * handled the broadcast. This is sent as a background broadcast, since 2432319ac896a0fef7365d5589b8021db7e41207fe42Douglas Gregor * its result is not part of the primary UX flow; to safely keep track of 2433319ac896a0fef7365d5589b8021db7e41207fe42Douglas Gregor * started/stopped state of a user you can use this in conjunction with 2434319ac896a0fef7365d5589b8021db7e41207fe42Douglas Gregor * {@link #ACTION_USER_STARTING}. It is <b>not</b> generally safe to use with 2435bd4c1ada2e8668f43a865dc2c662085cf61940c4Anders Carlsson * other user state broadcasts since those are foreground broadcasts so can 2436bd4c1ada2e8668f43a865dc2c662085cf61940c4Anders Carlsson * execute in a different order. 2437bd4c1ada2e8668f43a865dc2c662085cf61940c4Anders Carlsson * @hide 243844b4321feab46299d3f5cfd404680884752a0fcfDouglas Gregor */ 243944b4321feab46299d3f5cfd404680884752a0fcfDouglas Gregor public static final String ACTION_USER_STOPPING = 244044b4321feab46299d3f5cfd404680884752a0fcfDouglas Gregor "android.intent.action.USER_STOPPING"; 244144b4321feab46299d3f5cfd404680884752a0fcfDouglas Gregor 2442bd4c1ada2e8668f43a865dc2c662085cf61940c4Anders Carlsson /** 2443bd4c1ada2e8668f43a865dc2c662085cf61940c4Anders Carlsson * Broadcast sent to the system when a user is stopped. Carries an extra 2444de2e22d33afec98324a66a358dfe0951b3c7259aSteve Naroff * EXTRA_USER_HANDLE that has the userHandle of the user. This is similar to 2445bd4c1ada2e8668f43a865dc2c662085cf61940c4Anders Carlsson * {@link #ACTION_PACKAGE_RESTARTED}, but for an entire user instead of a 2446bd4c1ada2e8668f43a865dc2c662085cf61940c4Anders Carlsson * specific package. This is only sent to registered receivers, not manifest 2447bd4c1ada2e8668f43a865dc2c662085cf61940c4Anders Carlsson * receivers. It is sent to all running users <em>except</em> the one that 2448bd4c1ada2e8668f43a865dc2c662085cf61940c4Anders Carlsson * has just been stopped (which is no longer running). 2449bd4c1ada2e8668f43a865dc2c662085cf61940c4Anders Carlsson * @hide 245044b4321feab46299d3f5cfd404680884752a0fcfDouglas Gregor */ 245144b4321feab46299d3f5cfd404680884752a0fcfDouglas Gregor public static final String ACTION_USER_STOPPED = 245244b4321feab46299d3f5cfd404680884752a0fcfDouglas Gregor "android.intent.action.USER_STOPPED"; 245344b4321feab46299d3f5cfd404680884752a0fcfDouglas Gregor 245444b4321feab46299d3f5cfd404680884752a0fcfDouglas Gregor /** 24554afa39deaa245592977136d367251ee2c173dd8dDouglas Gregor * Broadcast sent to the system when a user is removed. Carries an extra EXTRA_USER_HANDLE that has 245617945a0f64fe03ff6ec0c2146005a87636e3ac12Argyrios Kyrtzidis * the userHandle of the user. It is sent to all running users except the 245744b4321feab46299d3f5cfd404680884752a0fcfDouglas Gregor * one that has been removed. The user will not be completely removed until all receivers have 2458bd4c1ada2e8668f43a865dc2c662085cf61940c4Anders Carlsson * handled the broadcast. You must hold 245944b4321feab46299d3f5cfd404680884752a0fcfDouglas Gregor * {@link android.Manifest.permission#MANAGE_USERS} to receive this broadcast. 2460bd4c1ada2e8668f43a865dc2c662085cf61940c4Anders Carlsson * @hide 2461bd4c1ada2e8668f43a865dc2c662085cf61940c4Anders Carlsson */ 2462bd4c1ada2e8668f43a865dc2c662085cf61940c4Anders Carlsson public static final String ACTION_USER_REMOVED = 2463bd4c1ada2e8668f43a865dc2c662085cf61940c4Anders Carlsson "android.intent.action.USER_REMOVED"; 2464bd4c1ada2e8668f43a865dc2c662085cf61940c4Anders Carlsson 2465319ac896a0fef7365d5589b8021db7e41207fe42Douglas Gregor /** 246635366a67baa970c287c714c957cf78a4131cf60dTed Kremenek * Broadcast sent to the system when the user switches. Carries an extra EXTRA_USER_HANDLE that has 2467319ac896a0fef7365d5589b8021db7e41207fe42Douglas Gregor * the userHandle of the user to become the current one. This is only sent to 2468319ac896a0fef7365d5589b8021db7e41207fe42Douglas Gregor * registered receivers, not manifest receivers. It is sent to all running users. 2469319ac896a0fef7365d5589b8021db7e41207fe42Douglas Gregor * You must hold 2470319ac896a0fef7365d5589b8021db7e41207fe42Douglas Gregor * {@link android.Manifest.permission#MANAGE_USERS} to receive this broadcast. 2471e8c49533521c40643653f943d47229e62d277f88Anders Carlsson * @hide 2472e8c49533521c40643653f943d47229e62d277f88Anders Carlsson */ 24732d99833e8c956775f2183601cd120b65b569c867Chris Lattner public static final String ACTION_USER_SWITCHED = 2474e8c49533521c40643653f943d47229e62d277f88Anders Carlsson "android.intent.action.USER_SWITCHED"; 2475bb49c3ee5d270485f4b273691fd14bc97403fa5dChris Lattner 2476bb49c3ee5d270485f4b273691fd14bc97403fa5dChris Lattner /** 247785f9bceab1542aafff012d4d28e998f4ba16e362Anders Carlsson * Broadcast sent to the system when a user's information changes. Carries an extra 247885f9bceab1542aafff012d4d28e998f4ba16e362Anders Carlsson * {@link #EXTRA_USER_HANDLE} to indicate which user's information changed. 247985f9bceab1542aafff012d4d28e998f4ba16e362Anders Carlsson * This is only sent to registered receivers, not manifest receivers. It is sent to the user 248085f9bceab1542aafff012d4d28e998f4ba16e362Anders Carlsson * whose information has changed. 2481a526c5c67e5a0473c340903ee542ce570119665fTed Kremenek * @hide 248233e1d64ab5cd5d27f8530ccd056191fe2c9f3f2eFariborz Jahanian */ 2483a526c5c67e5a0473c340903ee542ce570119665fTed Kremenek public static final String ACTION_USER_INFO_CHANGED = 248498be4943e8dc4f3905629a7102668960873cf863Chris Lattner "android.intent.action.USER_INFO_CHANGED"; 248533e1d64ab5cd5d27f8530ccd056191fe2c9f3f2eFariborz Jahanian 248633e1d64ab5cd5d27f8530ccd056191fe2c9f3f2eFariborz Jahanian /** 248733e1d64ab5cd5d27f8530ccd056191fe2c9f3f2eFariborz Jahanian * Sent when the user taps on the clock widget in the system's "quick settings" area. 248898be4943e8dc4f3905629a7102668960873cf863Chris Lattner */ 248933e1d64ab5cd5d27f8530ccd056191fe2c9f3f2eFariborz Jahanian public static final String ACTION_QUICK_CLOCK = 249033e1d64ab5cd5d27f8530ccd056191fe2c9f3f2eFariborz Jahanian "android.intent.action.QUICK_CLOCK"; 249198be4943e8dc4f3905629a7102668960873cf863Chris Lattner 249298be4943e8dc4f3905629a7102668960873cf863Chris Lattner // --------------------------------------------------------------------- 249333e1d64ab5cd5d27f8530ccd056191fe2c9f3f2eFariborz Jahanian // --------------------------------------------------------------------- 249433e1d64ab5cd5d27f8530ccd056191fe2c9f3f2eFariborz Jahanian // Standard intent categories (see addCategory()). 2495a526c5c67e5a0473c340903ee542ce570119665fTed Kremenek 249633e1d64ab5cd5d27f8530ccd056191fe2c9f3f2eFariborz Jahanian /** 2497c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar * Set if the activity should be an option for the default action 2498e6db3b09a79d4affaa5c7becbfb6bba3c08430c1Chris Lattner * (center press) to perform on a piece of data. Setting this will 2499c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar * hide from the user any activities without it set when performing an 2500ecb01e666665efabd2aa76a76f6080e2a78965faFariborz Jahanian * action on some data. Note that this is normal -not- set in the 2501a526c5c67e5a0473c340903ee542ce570119665fTed Kremenek * Intent when initiating an action -- it is for use in intent filters 250233e1d64ab5cd5d27f8530ccd056191fe2c9f3f2eFariborz Jahanian * specified in packages. 25030d504c1da852e58ff802545c823ecff3b6c654b8Daniel Dunbar */ 250433e1d64ab5cd5d27f8530ccd056191fe2c9f3f2eFariborz Jahanian @SdkConstant(SdkConstantType.INTENT_CATEGORY) 250533e1d64ab5cd5d27f8530ccd056191fe2c9f3f2eFariborz Jahanian public static final String CATEGORY_DEFAULT = "android.intent.category.DEFAULT"; 250633e1d64ab5cd5d27f8530ccd056191fe2c9f3f2eFariborz Jahanian /** 250733e1d64ab5cd5d27f8530ccd056191fe2c9f3f2eFariborz Jahanian * Activities that can be safely invoked from a browser must support this 250898be4943e8dc4f3905629a7102668960873cf863Chris Lattner * category. For example, if the user is viewing a web page or an e-mail 250933e1d64ab5cd5d27f8530ccd056191fe2c9f3f2eFariborz Jahanian * and clicks on a link in the text, the Intent generated execute that 251033e1d64ab5cd5d27f8530ccd056191fe2c9f3f2eFariborz Jahanian * link will require the BROWSABLE category, so that only activities 251133e1d64ab5cd5d27f8530ccd056191fe2c9f3f2eFariborz Jahanian * supporting this category will be considered as possible actions. By 251289951a86b594513c2a013532ed45d197413b1087Chris Lattner * supporting this category, you are promising that there is nothing 251389951a86b594513c2a013532ed45d197413b1087Chris Lattner * damaging (without user intervention) that can happen by invoking any 251489951a86b594513c2a013532ed45d197413b1087Chris Lattner * matching Intent. 251589951a86b594513c2a013532ed45d197413b1087Chris Lattner */ 2516a526c5c67e5a0473c340903ee542ce570119665fTed Kremenek @SdkConstant(SdkConstantType.INTENT_CATEGORY) 251733e1d64ab5cd5d27f8530ccd056191fe2c9f3f2eFariborz Jahanian public static final String CATEGORY_BROWSABLE = "android.intent.category.BROWSABLE"; 251833e1d64ab5cd5d27f8530ccd056191fe2c9f3f2eFariborz Jahanian /** 251933e1d64ab5cd5d27f8530ccd056191fe2c9f3f2eFariborz Jahanian * Set if the activity should be considered as an alternative action to 252033e1d64ab5cd5d27f8530ccd056191fe2c9f3f2eFariborz Jahanian * the data the user is currently viewing. See also 252133e1d64ab5cd5d27f8530ccd056191fe2c9f3f2eFariborz Jahanian * {@link #CATEGORY_SELECTED_ALTERNATIVE} for an alternative action that 252233e1d64ab5cd5d27f8530ccd056191fe2c9f3f2eFariborz Jahanian * applies to the selection in a list of items. 252333e1d64ab5cd5d27f8530ccd056191fe2c9f3f2eFariborz Jahanian * 252433e1d64ab5cd5d27f8530ccd056191fe2c9f3f2eFariborz Jahanian * <p>Supporting this category means that you would like your activity to be 252589951a86b594513c2a013532ed45d197413b1087Chris Lattner * displayed in the set of alternative things the user can do, usually as 252689951a86b594513c2a013532ed45d197413b1087Chris Lattner * part of the current activity's options menu. You will usually want to 252789951a86b594513c2a013532ed45d197413b1087Chris Lattner * include a specific label in the <intent-filter> of this action 25284306d3cb9116605728252e2738df24b9f6ab53c3Fariborz Jahanian * describing to the user what it does. 25294306d3cb9116605728252e2738df24b9f6ab53c3Fariborz Jahanian * 2530ab76d45e023fc5ae966968344e180cd09fdcc746Steve Naroff * <p>The action of IntentFilter with this category is important in that it 2531ab76d45e023fc5ae966968344e180cd09fdcc746Steve Naroff * describes the specific action the target will perform. This generally 2532ab76d45e023fc5ae966968344e180cd09fdcc746Steve Naroff * should not be a generic action (such as {@link #ACTION_VIEW}, but rather 2533bb3fde337fb712c0e6da8790d431621be4793048Steve Naroff * a specific name such as "com.android.camera.action.CROP. Only one 2534ab76d45e023fc5ae966968344e180cd09fdcc746Steve Naroff * alternative of any particular action will be shown to the user, so using 2535ab76d45e023fc5ae966968344e180cd09fdcc746Steve Naroff * a specific action like this makes sure that your alternative will be 2536ab76d45e023fc5ae966968344e180cd09fdcc746Steve Naroff * displayed while also allowing other applications to provide their own 2537ecb01e666665efabd2aa76a76f6080e2a78965faFariborz Jahanian * overrides of that particular action. 253833e1d64ab5cd5d27f8530ccd056191fe2c9f3f2eFariborz Jahanian */ 25394306d3cb9116605728252e2738df24b9f6ab53c3Fariborz Jahanian @SdkConstant(SdkConstantType.INTENT_CATEGORY) 25400d504c1da852e58ff802545c823ecff3b6c654b8Daniel Dunbar public static final String CATEGORY_ALTERNATIVE = "android.intent.category.ALTERNATIVE"; 254133e1d64ab5cd5d27f8530ccd056191fe2c9f3f2eFariborz Jahanian /** 2542a526c5c67e5a0473c340903ee542ce570119665fTed Kremenek * Set if the activity should be considered as an alternative selection 254333e1d64ab5cd5d27f8530ccd056191fe2c9f3f2eFariborz Jahanian * action to the data the user has currently selected. This is like 254433e1d64ab5cd5d27f8530ccd056191fe2c9f3f2eFariborz Jahanian * {@link #CATEGORY_ALTERNATIVE}, but is used in activities showing a list 254533e1d64ab5cd5d27f8530ccd056191fe2c9f3f2eFariborz Jahanian * of items from which the user can select, giving them alternatives to the 2546c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar * default action that will be performed on it. 254783bccb85ff4b9981c4250c45494b439df8cbf983Fariborz Jahanian */ 2548c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar @SdkConstant(SdkConstantType.INTENT_CATEGORY) 2549c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar public static final String CATEGORY_SELECTED_ALTERNATIVE = "android.intent.category.SELECTED_ALTERNATIVE"; 255083bccb85ff4b9981c4250c45494b439df8cbf983Fariborz Jahanian /** 255183bccb85ff4b9981c4250c45494b439df8cbf983Fariborz Jahanian * Intended to be used as a tab inside of a containing TabActivity. 255283bccb85ff4b9981c4250c45494b439df8cbf983Fariborz Jahanian */ 255383bccb85ff4b9981c4250c45494b439df8cbf983Fariborz Jahanian @SdkConstant(SdkConstantType.INTENT_CATEGORY) 255483bccb85ff4b9981c4250c45494b439df8cbf983Fariborz Jahanian public static final String CATEGORY_TAB = "android.intent.category.TAB"; 255583bccb85ff4b9981c4250c45494b439df8cbf983Fariborz Jahanian /** 255683bccb85ff4b9981c4250c45494b439df8cbf983Fariborz Jahanian * Should be displayed in the top-level launcher. 255783bccb85ff4b9981c4250c45494b439df8cbf983Fariborz Jahanian */ 255883bccb85ff4b9981c4250c45494b439df8cbf983Fariborz Jahanian @SdkConstant(SdkConstantType.INTENT_CATEGORY) 255983bccb85ff4b9981c4250c45494b439df8cbf983Fariborz Jahanian public static final String CATEGORY_LAUNCHER = "android.intent.category.LAUNCHER"; 256083bccb85ff4b9981c4250c45494b439df8cbf983Fariborz Jahanian /** 256183bccb85ff4b9981c4250c45494b439df8cbf983Fariborz Jahanian * Provides information about the package it is in; typically used if 256283bccb85ff4b9981c4250c45494b439df8cbf983Fariborz Jahanian * a package does not contain a {@link #CATEGORY_LAUNCHER} to provide 256383bccb85ff4b9981c4250c45494b439df8cbf983Fariborz Jahanian * a front-door to the user without having to be shown in the all apps list. 256483bccb85ff4b9981c4250c45494b439df8cbf983Fariborz Jahanian */ 256583bccb85ff4b9981c4250c45494b439df8cbf983Fariborz Jahanian @SdkConstant(SdkConstantType.INTENT_CATEGORY) 256683bccb85ff4b9981c4250c45494b439df8cbf983Fariborz Jahanian public static final String CATEGORY_INFO = "android.intent.category.INFO"; 256783bccb85ff4b9981c4250c45494b439df8cbf983Fariborz Jahanian /** 256883bccb85ff4b9981c4250c45494b439df8cbf983Fariborz Jahanian * This is the home activity, that is the first activity that is displayed 256983bccb85ff4b9981c4250c45494b439df8cbf983Fariborz Jahanian * when the device boots. 257083bccb85ff4b9981c4250c45494b439df8cbf983Fariborz Jahanian */ 2571c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar @SdkConstant(SdkConstantType.INTENT_CATEGORY) 2572c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar public static final String CATEGORY_HOME = "android.intent.category.HOME"; 2573e6db3b09a79d4affaa5c7becbfb6bba3c08430c1Chris Lattner /** 2574c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar * This activity is a preference panel. 2575c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar */ 2576c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar @SdkConstant(SdkConstantType.INTENT_CATEGORY) 2577c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar public static final String CATEGORY_PREFERENCE = "android.intent.category.PREFERENCE"; 2578c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar /** 2579c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar * This activity is a development preference panel. 2580c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar */ 2581c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar @SdkConstant(SdkConstantType.INTENT_CATEGORY) 2582c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar public static final String CATEGORY_DEVELOPMENT_PREFERENCE = "android.intent.category.DEVELOPMENT_PREFERENCE"; 258317945a0f64fe03ff6ec0c2146005a87636e3ac12Argyrios Kyrtzidis /** 2584653f1b1bf293a9bd96fd4dd6372e779cc7af1597Douglas Gregor * Capable of running inside a parent activity container. 2585c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar */ 2586c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar @SdkConstant(SdkConstantType.INTENT_CATEGORY) 2587c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar public static final String CATEGORY_EMBED = "android.intent.category.EMBED"; 2588c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar /** 2589c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar * This activity allows the user to browse and download new applications. 2590c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar */ 2591c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar @SdkConstant(SdkConstantType.INTENT_CATEGORY) 2592c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar public static final String CATEGORY_APP_MARKET = "android.intent.category.APP_MARKET"; 2593c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar /** 2594c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar * This activity may be exercised by the monkey or other automated test tools. 259561710854be2b098428aff5316e64bd34b30fbcb7Chris Lattner */ 2596c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar @SdkConstant(SdkConstantType.INTENT_CATEGORY) 259717945a0f64fe03ff6ec0c2146005a87636e3ac12Argyrios Kyrtzidis public static final String CATEGORY_MONKEY = "android.intent.category.MONKEY"; 2598653f1b1bf293a9bd96fd4dd6372e779cc7af1597Douglas Gregor /** 2599c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar * To be used as a test (not part of the normal user experience). 2600c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar */ 2601c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar public static final String CATEGORY_TEST = "android.intent.category.TEST"; 2602c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar /** 2603c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar * To be used as a unit test (run through the Test Harness). 2604c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar */ 2605c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar public static final String CATEGORY_UNIT_TEST = "android.intent.category.UNIT_TEST"; 2606c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar /** 2607c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar * To be used as a sample code example (not part of the normal user 2608c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar * experience). 2609c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar */ 2610c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar public static final String CATEGORY_SAMPLE_CODE = "android.intent.category.SAMPLE_CODE"; 2611c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar /** 2612c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar * Used to indicate that a GET_CONTENT intent only wants URIs that can be opened with 2613c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar * ContentResolver.openInputStream. Openable URIs must support the columns in 2614c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar * {@link android.provider.OpenableColumns} 2615090b3f71702c5626d8520f9608d77c6f26dcfa15Fariborz Jahanian * when queried, though it is allowable for those columns to be blank. 2616090b3f71702c5626d8520f9608d77c6f26dcfa15Fariborz Jahanian */ 2617153bfe5795e2c1a5a738e73d3784964e082237fcDaniel Dunbar @SdkConstant(SdkConstantType.INTENT_CATEGORY) 2618090b3f71702c5626d8520f9608d77c6f26dcfa15Fariborz Jahanian public static final String CATEGORY_OPENABLE = "android.intent.category.OPENABLE"; 2619090b3f71702c5626d8520f9608d77c6f26dcfa15Fariborz Jahanian 2620c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar /** 2621c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar * To be used as code under test for framework instrumentation tests. 2622c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar */ 2623c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar public static final String CATEGORY_FRAMEWORK_INSTRUMENTATION_TEST = 2624c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar "android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST"; 2625c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar /** 2626c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar * An activity to run when device is inserted into a car dock. 2627c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar * Used with {@link #ACTION_MAIN} to launch an activity. For more 2628c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar * information, see {@link android.app.UiModeManager}. 2629c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar */ 2630c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar @SdkConstant(SdkConstantType.INTENT_CATEGORY) 2631c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar public static final String CATEGORY_CAR_DOCK = "android.intent.category.CAR_DOCK"; 2632c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar /** 2633c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar * An activity to run when device is inserted into a car dock. 2634c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar * Used with {@link #ACTION_MAIN} to launch an activity. For more 2635c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar * information, see {@link android.app.UiModeManager}. 2636090b3f71702c5626d8520f9608d77c6f26dcfa15Fariborz Jahanian */ 2637090b3f71702c5626d8520f9608d77c6f26dcfa15Fariborz Jahanian @SdkConstant(SdkConstantType.INTENT_CATEGORY) 2638090b3f71702c5626d8520f9608d77c6f26dcfa15Fariborz Jahanian public static final String CATEGORY_DESK_DOCK = "android.intent.category.DESK_DOCK"; 2639c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar /** 2640c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar * An activity to run when device is inserted into a analog (low end) dock. 2641077bf5e2f48acfa9e7d69429b6e4ba86ea14896dChris Lattner * Used with {@link #ACTION_MAIN} to launch an activity. For more 2642c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar * information, see {@link android.app.UiModeManager}. 2643c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar */ 2644c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar @SdkConstant(SdkConstantType.INTENT_CATEGORY) 2645c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar public static final String CATEGORY_LE_DESK_DOCK = "android.intent.category.LE_DESK_DOCK"; 2646077bf5e2f48acfa9e7d69429b6e4ba86ea14896dChris Lattner 2647c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar /** 2648c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar * An activity to run when device is inserted into a digital (high end) dock. 2649c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar * Used with {@link #ACTION_MAIN} to launch an activity. For more 2650c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar * information, see {@link android.app.UiModeManager}. 2651c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar */ 265239f34e97d6a468f0a7dfa5664c61217cffc65b74Chris Lattner @SdkConstant(SdkConstantType.INTENT_CATEGORY) 2653c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar public static final String CATEGORY_HE_DESK_DOCK = "android.intent.category.HE_DESK_DOCK"; 2654c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar 2655c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar /** 2656c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar * Used to indicate that the activity can be used in a car environment. 2657c56f34a1c1779de15330bdb3eec39b3418802d47Daniel Dunbar */ 2658a1c033e9514865f3a7b0d8b3b20e6de926cfec6cFariborz Jahanian @SdkConstant(SdkConstantType.INTENT_CATEGORY) 2659a1c033e9514865f3a7b0d8b3b20e6de926cfec6cFariborz Jahanian public static final String CATEGORY_CAR_MODE = "android.intent.category.CAR_MODE"; 2660c657eba43f0159bd81227fa0812b92a0b03f00d0Fariborz Jahanian 2661a1c033e9514865f3a7b0d8b3b20e6de926cfec6cFariborz Jahanian // --------------------------------------------------------------------- 2662a1c033e9514865f3a7b0d8b3b20e6de926cfec6cFariborz Jahanian // --------------------------------------------------------------------- 2663a1c033e9514865f3a7b0d8b3b20e6de926cfec6cFariborz Jahanian // Application launch intent categories (see addCategory()). 26648e1fab243ab8023b7ee3899745386b3b3a4258f8Mike Stump 2665a1c033e9514865f3a7b0d8b3b20e6de926cfec6cFariborz Jahanian /** 2666c657eba43f0159bd81227fa0812b92a0b03f00d0Fariborz Jahanian * Used with {@link #ACTION_MAIN} to launch the browser application. 2667c657eba43f0159bd81227fa0812b92a0b03f00d0Fariborz Jahanian * The activity should be able to browse the Internet. 2668a1c033e9514865f3a7b0d8b3b20e6de926cfec6cFariborz Jahanian * <p>NOTE: This should not be used as the primary key of an Intent, 2669c657eba43f0159bd81227fa0812b92a0b03f00d0Fariborz Jahanian * since it will not result in the app launching with the correct 2670c657eba43f0159bd81227fa0812b92a0b03f00d0Fariborz Jahanian * action and category. Instead, use this with 2671c657eba43f0159bd81227fa0812b92a0b03f00d0Fariborz Jahanian * {@link #makeMainSelectorActivity(String, String)} to generate a main 2672a1c033e9514865f3a7b0d8b3b20e6de926cfec6cFariborz Jahanian * Intent with this category in the selector.</p> 2673a1c033e9514865f3a7b0d8b3b20e6de926cfec6cFariborz Jahanian */ 2674a1c033e9514865f3a7b0d8b3b20e6de926cfec6cFariborz Jahanian @SdkConstant(SdkConstantType.INTENT_CATEGORY) 2675a1c033e9514865f3a7b0d8b3b20e6de926cfec6cFariborz Jahanian public static final String CATEGORY_APP_BROWSER = "android.intent.category.APP_BROWSER"; 2676a1c033e9514865f3a7b0d8b3b20e6de926cfec6cFariborz Jahanian 26777d6b46d9a9d75dea8ef9f6973dd50633c1f37963Fariborz Jahanian /** 2678153bfe5795e2c1a5a738e73d3784964e082237fcDaniel Dunbar * Used with {@link #ACTION_MAIN} to launch the calculator application. 267982a6cfbc421cc99c5b7313271f399f7ef95056ecDaniel Dunbar * The activity should be able to perform standard arithmetic operations. 268082a6cfbc421cc99c5b7313271f399f7ef95056ecDaniel Dunbar * <p>NOTE: This should not be used as the primary key of an Intent, 268182a6cfbc421cc99c5b7313271f399f7ef95056ecDaniel Dunbar * since it will not result in the app launching with the correct 268282a6cfbc421cc99c5b7313271f399f7ef95056ecDaniel Dunbar * action and category. Instead, use this with 26835b8c7d9fb620ba3a71e996d61e7b9bdf763b5c09Fariborz Jahanian * {@link #makeMainSelectorActivity(String, String)} to generate a main 26845b8c7d9fb620ba3a71e996d61e7b9bdf763b5c09Fariborz Jahanian * Intent with this category in the selector.</p> 268582a6cfbc421cc99c5b7313271f399f7ef95056ecDaniel Dunbar */ 268682a6cfbc421cc99c5b7313271f399f7ef95056ecDaniel Dunbar @SdkConstant(SdkConstantType.INTENT_CATEGORY) 26878b4bf90eb6d3d08cf3bfb86705f0fdb20b9c5875Fariborz Jahanian public static final String CATEGORY_APP_CALCULATOR = "android.intent.category.APP_CALCULATOR"; 2688153bfe5795e2c1a5a738e73d3784964e082237fcDaniel Dunbar 26898b4bf90eb6d3d08cf3bfb86705f0fdb20b9c5875Fariborz Jahanian /** 26908b4bf90eb6d3d08cf3bfb86705f0fdb20b9c5875Fariborz Jahanian * Used with {@link #ACTION_MAIN} to launch the calendar application. 26918b4bf90eb6d3d08cf3bfb86705f0fdb20b9c5875Fariborz Jahanian * The activity should be able to view and manipulate calendar entries. 26929a901bb63990574ff0bcc12ff851d7a71cff8ddbEli Friedman * <p>NOTE: This should not be used as the primary key of an Intent, 26938b4bf90eb6d3d08cf3bfb86705f0fdb20b9c5875Fariborz Jahanian * since it will not result in the app launching with the correct 26948b4bf90eb6d3d08cf3bfb86705f0fdb20b9c5875Fariborz Jahanian * action and category. Instead, use this with 26958b4bf90eb6d3d08cf3bfb86705f0fdb20b9c5875Fariborz Jahanian * {@link #makeMainSelectorActivity(String, String)} to generate a main 26968b4bf90eb6d3d08cf3bfb86705f0fdb20b9c5875Fariborz Jahanian * Intent with this category in the selector.</p> 269782a6cfbc421cc99c5b7313271f399f7ef95056ecDaniel Dunbar */ 269882a6cfbc421cc99c5b7313271f399f7ef95056ecDaniel Dunbar @SdkConstant(SdkConstantType.INTENT_CATEGORY) 269982a6cfbc421cc99c5b7313271f399f7ef95056ecDaniel Dunbar public static final String CATEGORY_APP_CALENDAR = "android.intent.category.APP_CALENDAR"; 2700153bfe5795e2c1a5a738e73d3784964e082237fcDaniel Dunbar 2701090b3f71702c5626d8520f9608d77c6f26dcfa15Fariborz Jahanian /** 27026ab3524f72a6e64aa04973fa9433b5559abb3525Douglas Gregor * Used with {@link #ACTION_MAIN} to launch the contacts application. 2703e8c49533521c40643653f943d47229e62d277f88Anders Carlsson * The activity should be able to view and manipulate address book entries. 2704ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner * <p>NOTE: This should not be used as the primary key of an Intent, 2705ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner * since it will not result in the app launching with the correct 2706ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner * action and category. Instead, use this with 2707ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner * {@link #makeMainSelectorActivity(String, String)} to generate a main 2708ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner * Intent with this category in the selector.</p> 2709ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner */ 2710ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner @SdkConstant(SdkConstantType.INTENT_CATEGORY) 2711ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner public static final String CATEGORY_APP_CONTACTS = "android.intent.category.APP_CONTACTS"; 2712ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner 2713ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner /** 2714ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner * Used with {@link #ACTION_MAIN} to launch the email application. 2715ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner * The activity should be able to send and receive email. 271672696e17f90d399448d360cb43aebe5eb2007d4fFariborz Jahanian * <p>NOTE: This should not be used as the primary key of an Intent, 2717ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner * since it will not result in the app launching with the correct 271872696e17f90d399448d360cb43aebe5eb2007d4fFariborz Jahanian * action and category. Instead, use this with 2719ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner * {@link #makeMainSelectorActivity(String, String)} to generate a main 2720ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner * Intent with this category in the selector.</p> 2721ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner */ 2722ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner @SdkConstant(SdkConstantType.INTENT_CATEGORY) 2723ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner public static final String CATEGORY_APP_EMAIL = "android.intent.category.APP_EMAIL"; 2724ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner 2725ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner /** 2726ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner * Used with {@link #ACTION_MAIN} to launch the gallery application. 2727ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner * The activity should be able to view and manipulate image and video files 2728ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner * stored on the device. 2729ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner * <p>NOTE: This should not be used as the primary key of an Intent, 2730ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner * since it will not result in the app launching with the correct 2731ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner * action and category. Instead, use this with 2732ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner * {@link #makeMainSelectorActivity(String, String)} to generate a main 2733ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner * Intent with this category in the selector.</p> 273443822eaeddeaa419b90f23c68af6b23c46788a58Fariborz Jahanian */ 2735ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner @SdkConstant(SdkConstantType.INTENT_CATEGORY) 2736ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner public static final String CATEGORY_APP_GALLERY = "android.intent.category.APP_GALLERY"; 2737ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner 2738ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner /** 2739ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner * Used with {@link #ACTION_MAIN} to launch the maps application. 2740ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner * The activity should be able to show the user's current location and surroundings. 2741c612f7bc9a6379cd7e7c2dd306d05938e890051bAnders Carlsson * <p>NOTE: This should not be used as the primary key of an Intent, 2742c612f7bc9a6379cd7e7c2dd306d05938e890051bAnders Carlsson * since it will not result in the app launching with the correct 2743c612f7bc9a6379cd7e7c2dd306d05938e890051bAnders Carlsson * action and category. Instead, use this with 2744ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner * {@link #makeMainSelectorActivity(String, String)} to generate a main 2745ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner * Intent with this category in the selector.</p> 2746ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner */ 274735366a67baa970c287c714c957cf78a4131cf60dTed Kremenek @SdkConstant(SdkConstantType.INTENT_CATEGORY) 274885f9bceab1542aafff012d4d28e998f4ba16e362Anders Carlsson public static final String CATEGORY_APP_MAPS = "android.intent.category.APP_MAPS"; 2749a1c033e9514865f3a7b0d8b3b20e6de926cfec6cFariborz Jahanian 2750a1c033e9514865f3a7b0d8b3b20e6de926cfec6cFariborz Jahanian /** 2751a1c033e9514865f3a7b0d8b3b20e6de926cfec6cFariborz Jahanian * Used with {@link #ACTION_MAIN} to launch the messaging application. 2752a1c033e9514865f3a7b0d8b3b20e6de926cfec6cFariborz Jahanian * The activity should be able to send and receive text messages. 2753a1c033e9514865f3a7b0d8b3b20e6de926cfec6cFariborz Jahanian * <p>NOTE: This should not be used as the primary key of an Intent, 27548e1fab243ab8023b7ee3899745386b3b3a4258f8Mike Stump * since it will not result in the app launching with the correct 2755a1c033e9514865f3a7b0d8b3b20e6de926cfec6cFariborz Jahanian * action and category. Instead, use this with 2756a1c033e9514865f3a7b0d8b3b20e6de926cfec6cFariborz Jahanian * {@link #makeMainSelectorActivity(String, String)} to generate a main 2757a1c033e9514865f3a7b0d8b3b20e6de926cfec6cFariborz Jahanian * Intent with this category in the selector.</p> 2758a1c033e9514865f3a7b0d8b3b20e6de926cfec6cFariborz Jahanian */ 2759a1c033e9514865f3a7b0d8b3b20e6de926cfec6cFariborz Jahanian @SdkConstant(SdkConstantType.INTENT_CATEGORY) 2760a1c033e9514865f3a7b0d8b3b20e6de926cfec6cFariborz Jahanian public static final String CATEGORY_APP_MESSAGING = "android.intent.category.APP_MESSAGING"; 2761a1c033e9514865f3a7b0d8b3b20e6de926cfec6cFariborz Jahanian 276235366a67baa970c287c714c957cf78a4131cf60dTed Kremenek /** 276335366a67baa970c287c714c957cf78a4131cf60dTed Kremenek * Used with {@link #ACTION_MAIN} to launch the music application. 2764a1c033e9514865f3a7b0d8b3b20e6de926cfec6cFariborz Jahanian * The activity should be able to play, browse, or manipulate music files 2765a1c033e9514865f3a7b0d8b3b20e6de926cfec6cFariborz Jahanian * stored on the device. 2766a1c033e9514865f3a7b0d8b3b20e6de926cfec6cFariborz Jahanian * <p>NOTE: This should not be used as the primary key of an Intent, 2767a1c033e9514865f3a7b0d8b3b20e6de926cfec6cFariborz Jahanian * since it will not result in the app launching with the correct 2768a1c033e9514865f3a7b0d8b3b20e6de926cfec6cFariborz Jahanian * action and category. Instead, use this with 2769a1c033e9514865f3a7b0d8b3b20e6de926cfec6cFariborz Jahanian * {@link #makeMainSelectorActivity(String, String)} to generate a main 2770a1c033e9514865f3a7b0d8b3b20e6de926cfec6cFariborz Jahanian * Intent with this category in the selector.</p> 2771a1c033e9514865f3a7b0d8b3b20e6de926cfec6cFariborz Jahanian */ 2772a1c033e9514865f3a7b0d8b3b20e6de926cfec6cFariborz Jahanian @SdkConstant(SdkConstantType.INTENT_CATEGORY) 2773a1c033e9514865f3a7b0d8b3b20e6de926cfec6cFariborz Jahanian public static final String CATEGORY_APP_MUSIC = "android.intent.category.APP_MUSIC"; 2774a1c033e9514865f3a7b0d8b3b20e6de926cfec6cFariborz Jahanian 2775a1c033e9514865f3a7b0d8b3b20e6de926cfec6cFariborz Jahanian // --------------------------------------------------------------------- 2776a1c033e9514865f3a7b0d8b3b20e6de926cfec6cFariborz Jahanian // --------------------------------------------------------------------- 2777a1c033e9514865f3a7b0d8b3b20e6de926cfec6cFariborz Jahanian // Standard extra data keys. 2778a1c033e9514865f3a7b0d8b3b20e6de926cfec6cFariborz Jahanian 2779a1c033e9514865f3a7b0d8b3b20e6de926cfec6cFariborz Jahanian /** 278014108da7f7fc059772711e4ffee1322a27b152a7Steve Naroff * The initial data to place in a newly created record. Use with 27818baaca50f07d0c10bba69c8d88c1b9078c92d06dAnders Carlsson * {@link #ACTION_INSERT}. The data here is a Map containing the same 27828baaca50f07d0c10bba69c8d88c1b9078c92d06dAnders Carlsson * fields as would be given to the underlying ContentProvider.insert() 2783c2939bc82ce177c0413feb0cd9ce70aefd6235fbFariborz Jahanian * call. 278485f9bceab1542aafff012d4d28e998f4ba16e362Anders Carlsson */ 278585f9bceab1542aafff012d4d28e998f4ba16e362Anders Carlsson public static final String EXTRA_TEMPLATE = "android.intent.extra.TEMPLATE"; 278685f9bceab1542aafff012d4d28e998f4ba16e362Anders Carlsson 278785f9bceab1542aafff012d4d28e998f4ba16e362Anders Carlsson /** 2788e8c49533521c40643653f943d47229e62d277f88Anders Carlsson * A constant CharSequence that is associated with the Intent, used with 278985f9bceab1542aafff012d4d28e998f4ba16e362Anders Carlsson * {@link #ACTION_SEND} to supply the literal data to be sent. Note that 279085f9bceab1542aafff012d4d28e998f4ba16e362Anders Carlsson * this may be a styled CharSequence, so you must use 279185f9bceab1542aafff012d4d28e998f4ba16e362Anders Carlsson * {@link Bundle#getCharSequence(String) Bundle.getCharSequence()} to 27929533a7fdb8397421f3be52e879442460a87389f6Steve Naroff * retrieve it. 27939533a7fdb8397421f3be52e879442460a87389f6Steve Naroff */ 27949533a7fdb8397421f3be52e879442460a87389f6Steve Naroff public static final String EXTRA_TEXT = "android.intent.extra.TEXT"; 27959533a7fdb8397421f3be52e879442460a87389f6Steve Naroff 27969533a7fdb8397421f3be52e879442460a87389f6Steve Naroff /** 27979533a7fdb8397421f3be52e879442460a87389f6Steve Naroff * A constant String that is associated with the Intent, used with 27989533a7fdb8397421f3be52e879442460a87389f6Steve Naroff * {@link #ACTION_SEND} to supply an alternative to {@link #EXTRA_TEXT} 27999533a7fdb8397421f3be52e879442460a87389f6Steve Naroff * as HTML formatted text. Note that you <em>must</em> also supply 28009533a7fdb8397421f3be52e879442460a87389f6Steve Naroff * {@link #EXTRA_TEXT}. 28019533a7fdb8397421f3be52e879442460a87389f6Steve Naroff */ 28029533a7fdb8397421f3be52e879442460a87389f6Steve Naroff public static final String EXTRA_HTML_TEXT = "android.intent.extra.HTML_TEXT"; 28039533a7fdb8397421f3be52e879442460a87389f6Steve Naroff 280485f9bceab1542aafff012d4d28e998f4ba16e362Anders Carlsson /** 280585f9bceab1542aafff012d4d28e998f4ba16e362Anders Carlsson * A content: URI holding a stream of data associated with the Intent, 2806a1c033e9514865f3a7b0d8b3b20e6de926cfec6cFariborz Jahanian * used with {@link #ACTION_SEND} to supply the data being sent. 2807a1c033e9514865f3a7b0d8b3b20e6de926cfec6cFariborz Jahanian */ 2808ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner public static final String EXTRA_STREAM = "android.intent.extra.STREAM"; 280943822eaeddeaa419b90f23c68af6b23c46788a58Fariborz Jahanian 2810ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner /** 2811ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner * A String[] holding e-mail addresses that should be delivered to. 2812ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner */ 2813ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner public static final String EXTRA_EMAIL = "android.intent.extra.EMAIL"; 2814ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner 2815ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner /** 2816559a83330416affb0e341a2c53800cbf924a5178Anders Carlsson * A String[] holding e-mail addresses that should be carbon copied. 2817559a83330416affb0e341a2c53800cbf924a5178Anders Carlsson */ 2818559a83330416affb0e341a2c53800cbf924a5178Anders Carlsson public static final String EXTRA_CC = "android.intent.extra.CC"; 2819559a83330416affb0e341a2c53800cbf924a5178Anders Carlsson 2820559a83330416affb0e341a2c53800cbf924a5178Anders Carlsson /** 2821559a83330416affb0e341a2c53800cbf924a5178Anders Carlsson * A String[] holding e-mail addresses that should be blind carbon copied. 2822559a83330416affb0e341a2c53800cbf924a5178Anders Carlsson */ 2823559a83330416affb0e341a2c53800cbf924a5178Anders Carlsson public static final String EXTRA_BCC = "android.intent.extra.BCC"; 282485f9bceab1542aafff012d4d28e998f4ba16e362Anders Carlsson 2825559a83330416affb0e341a2c53800cbf924a5178Anders Carlsson /** 2826559a83330416affb0e341a2c53800cbf924a5178Anders Carlsson * A constant string holding the desired subject line of a message. 2827559a83330416affb0e341a2c53800cbf924a5178Anders Carlsson */ 2828559a83330416affb0e341a2c53800cbf924a5178Anders Carlsson public static final String EXTRA_SUBJECT = "android.intent.extra.SUBJECT"; 2829559a83330416affb0e341a2c53800cbf924a5178Anders Carlsson 2830559a83330416affb0e341a2c53800cbf924a5178Anders Carlsson /** 2831559a83330416affb0e341a2c53800cbf924a5178Anders Carlsson * An Intent describing the choices you would like shown with 283285f9bceab1542aafff012d4d28e998f4ba16e362Anders Carlsson * {@link #ACTION_PICK_ACTIVITY}. 2833559a83330416affb0e341a2c53800cbf924a5178Anders Carlsson */ 2834559a83330416affb0e341a2c53800cbf924a5178Anders Carlsson public static final String EXTRA_INTENT = "android.intent.extra.INTENT"; 2835559a83330416affb0e341a2c53800cbf924a5178Anders Carlsson 2836559a83330416affb0e341a2c53800cbf924a5178Anders Carlsson /** 2837ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner * A CharSequence dialog title to provide to the user when used with a 2838ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner * {@link #ACTION_CHOOSER}. 2839ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner */ 2840ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner public static final String EXTRA_TITLE = "android.intent.extra.TITLE"; 2841c0a87b7db06643178ad2cbce0767548c139ea387Anders Carlsson 2842ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner /** 2843ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner * A Parcelable[] of {@link Intent} or 2844ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner * {@link android.content.pm.LabeledIntent} objects as set with 284535366a67baa970c287c714c957cf78a4131cf60dTed Kremenek * {@link #putExtra(String, Parcelable[])} of additional activities to place 284682a6cfbc421cc99c5b7313271f399f7ef95056ecDaniel Dunbar * a the front of the list of choices, when shown to the user with a 2847d96b35bc6becf8db00d140c11e3d0e53f27567a1Daniel Dunbar * {@link #ACTION_CHOOSER}. 2848502a4a1ce4c34cf78c8182d9798da0a51d9b7302Daniel Dunbar */ 2849502a4a1ce4c34cf78c8182d9798da0a51d9b7302Daniel Dunbar public static final String EXTRA_INITIAL_INTENTS = "android.intent.extra.INITIAL_INTENTS"; 2850502a4a1ce4c34cf78c8182d9798da0a51d9b7302Daniel Dunbar 2851502a4a1ce4c34cf78c8182d9798da0a51d9b7302Daniel Dunbar /** 2852502a4a1ce4c34cf78c8182d9798da0a51d9b7302Daniel Dunbar * A {@link android.view.KeyEvent} object containing the event that 2853502a4a1ce4c34cf78c8182d9798da0a51d9b7302Daniel Dunbar * triggered the creation of the Intent it is in. 28540d504c1da852e58ff802545c823ecff3b6c654b8Daniel Dunbar */ 28557d6b46d9a9d75dea8ef9f6973dd50633c1f37963Fariborz Jahanian public static final String EXTRA_KEY_EVENT = "android.intent.extra.KEY_EVENT"; 285617945a0f64fe03ff6ec0c2146005a87636e3ac12Argyrios Kyrtzidis 285717945a0f64fe03ff6ec0c2146005a87636e3ac12Argyrios Kyrtzidis /** 285844b4321feab46299d3f5cfd404680884752a0fcfDouglas Gregor * Set to true in {@link #ACTION_REQUEST_SHUTDOWN} to request confirmation from the user 285943822eaeddeaa419b90f23c68af6b23c46788a58Fariborz Jahanian * before shutting down. 2860d96b35bc6becf8db00d140c11e3d0e53f27567a1Daniel Dunbar * 286144b4321feab46299d3f5cfd404680884752a0fcfDouglas Gregor * {@hide} 2862d96b35bc6becf8db00d140c11e3d0e53f27567a1Daniel Dunbar */ 2863d96b35bc6becf8db00d140c11e3d0e53f27567a1Daniel Dunbar public static final String EXTRA_KEY_CONFIRM = "android.intent.extra.KEY_CONFIRM"; 2864d96b35bc6becf8db00d140c11e3d0e53f27567a1Daniel Dunbar 2865d96b35bc6becf8db00d140c11e3d0e53f27567a1Daniel Dunbar /** 286643822eaeddeaa419b90f23c68af6b23c46788a58Fariborz Jahanian * Used as a boolean extra field in {@link android.content.Intent#ACTION_PACKAGE_REMOVED} or 286743822eaeddeaa419b90f23c68af6b23c46788a58Fariborz Jahanian * {@link android.content.Intent#ACTION_PACKAGE_CHANGED} intents to override the default action 286843822eaeddeaa419b90f23c68af6b23c46788a58Fariborz Jahanian * of restarting the application. 2869d96b35bc6becf8db00d140c11e3d0e53f27567a1Daniel Dunbar */ 2870a1c033e9514865f3a7b0d8b3b20e6de926cfec6cFariborz Jahanian public static final String EXTRA_DONT_KILL_APP = "android.intent.extra.DONT_KILL_APP"; 2871a1c033e9514865f3a7b0d8b3b20e6de926cfec6cFariborz Jahanian 2872a1c033e9514865f3a7b0d8b3b20e6de926cfec6cFariborz Jahanian /** 287343822eaeddeaa419b90f23c68af6b23c46788a58Fariborz Jahanian * A String holding the phone number originally entered in 2874d96b35bc6becf8db00d140c11e3d0e53f27567a1Daniel Dunbar * {@link android.content.Intent#ACTION_NEW_OUTGOING_CALL}, or the actual 28757d6b46d9a9d75dea8ef9f6973dd50633c1f37963Fariborz Jahanian * number to call in a {@link android.content.Intent#ACTION_CALL}. 28766de88a873a4cbe06d72602eef57d68006730a80bFariborz Jahanian */ 2877d96b35bc6becf8db00d140c11e3d0e53f27567a1Daniel Dunbar public static final String EXTRA_PHONE_NUMBER = "android.intent.extra.PHONE_NUMBER"; 2878ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner 2879ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner /** 2880ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner * Used as an int extra field in {@link android.content.Intent#ACTION_UID_REMOVED} 2881ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner * intents to supply the uid the package had been assigned. Also an optional 28828b4bf90eb6d3d08cf3bfb86705f0fdb20b9c5875Fariborz Jahanian * extra in {@link android.content.Intent#ACTION_PACKAGE_REMOVED} or 28838b4bf90eb6d3d08cf3bfb86705f0fdb20b9c5875Fariborz Jahanian * {@link android.content.Intent#ACTION_PACKAGE_CHANGED} for the same 28848b4bf90eb6d3d08cf3bfb86705f0fdb20b9c5875Fariborz Jahanian * purpose. 28858b4bf90eb6d3d08cf3bfb86705f0fdb20b9c5875Fariborz Jahanian */ 2886ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner public static final String EXTRA_UID = "android.intent.extra.UID"; 2887ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner 2888ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner /** 2889ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner * @hide String array of package names. 289021a98b188857d690aa4510c52ac4317ffa0908a8Steve Naroff */ 2891ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner public static final String EXTRA_PACKAGES = "android.intent.extra.PACKAGES"; 2892ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner 2893ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner /** 2894ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner * Used as a boolean extra field in {@link android.content.Intent#ACTION_PACKAGE_REMOVED} 289543822eaeddeaa419b90f23c68af6b23c46788a58Fariborz Jahanian * intents to indicate whether this represents a full uninstall (removing 289643822eaeddeaa419b90f23c68af6b23c46788a58Fariborz Jahanian * both the code and its data) or a partial uninstall (leaving its data, 289743822eaeddeaa419b90f23c68af6b23c46788a58Fariborz Jahanian * implying that this is an update). 289843822eaeddeaa419b90f23c68af6b23c46788a58Fariborz Jahanian */ 289943822eaeddeaa419b90f23c68af6b23c46788a58Fariborz Jahanian public static final String EXTRA_DATA_REMOVED = "android.intent.extra.DATA_REMOVED"; 290043822eaeddeaa419b90f23c68af6b23c46788a58Fariborz Jahanian 2901f1690858344968358131f8d5690d9ee458883000Chris Lattner /** 290243822eaeddeaa419b90f23c68af6b23c46788a58Fariborz Jahanian * @hide 2903f1690858344968358131f8d5690d9ee458883000Chris Lattner * Used as a boolean extra field in {@link android.content.Intent#ACTION_PACKAGE_REMOVED} 290443822eaeddeaa419b90f23c68af6b23c46788a58Fariborz Jahanian * intents to indicate that at this point the package has been removed for 290543822eaeddeaa419b90f23c68af6b23c46788a58Fariborz Jahanian * all users on the device. 290643822eaeddeaa419b90f23c68af6b23c46788a58Fariborz Jahanian */ 290743822eaeddeaa419b90f23c68af6b23c46788a58Fariborz Jahanian public static final String EXTRA_REMOVED_FOR_ALL_USERS 290843822eaeddeaa419b90f23c68af6b23c46788a58Fariborz Jahanian = "android.intent.extra.REMOVED_FOR_ALL_USERS"; 290943822eaeddeaa419b90f23c68af6b23c46788a58Fariborz Jahanian 291043822eaeddeaa419b90f23c68af6b23c46788a58Fariborz Jahanian /** 291143822eaeddeaa419b90f23c68af6b23c46788a58Fariborz Jahanian * Used as a boolean extra field in {@link android.content.Intent#ACTION_PACKAGE_REMOVED} 2912ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner * intents to indicate that this is a replacement of the package, so this 291343822eaeddeaa419b90f23c68af6b23c46788a58Fariborz Jahanian * broadcast will immediately be followed by an add broadcast for a 2914ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner * different version of the same package. 2915ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner */ 291614108da7f7fc059772711e4ffee1322a27b152a7Steve Naroff public static final String EXTRA_REPLACING = "android.intent.extra.REPLACING"; 291714108da7f7fc059772711e4ffee1322a27b152a7Steve Naroff 291814108da7f7fc059772711e4ffee1322a27b152a7Steve Naroff /** 2919ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner * Used as an int extra field in {@link android.app.AlarmManager} intents 2920ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner * to tell the application being invoked how many pending alarms are being 2921ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner * delievered with the intent. For one-shot alarms this will always be 1. 292214108da7f7fc059772711e4ffee1322a27b152a7Steve Naroff * For recurring alarms, this might be greater than 1 if the device was 292314108da7f7fc059772711e4ffee1322a27b152a7Steve Naroff * asleep or powered off at the time an earlier alarm would have been 2924ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner * delivered. 2925ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner */ 2926ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner public static final String EXTRA_ALARM_COUNT = "android.intent.extra.ALARM_COUNT"; 292714108da7f7fc059772711e4ffee1322a27b152a7Steve Naroff 292814108da7f7fc059772711e4ffee1322a27b152a7Steve Naroff /** 292914108da7f7fc059772711e4ffee1322a27b152a7Steve Naroff * Used as an int extra field in {@link android.content.Intent#ACTION_DOCK_EVENT} 293014108da7f7fc059772711e4ffee1322a27b152a7Steve Naroff * intents to request the dock state. Possible values are 293114108da7f7fc059772711e4ffee1322a27b152a7Steve Naroff * {@link android.content.Intent#EXTRA_DOCK_STATE_UNDOCKED}, 293214108da7f7fc059772711e4ffee1322a27b152a7Steve Naroff * {@link android.content.Intent#EXTRA_DOCK_STATE_DESK}, or 293314108da7f7fc059772711e4ffee1322a27b152a7Steve Naroff * {@link android.content.Intent#EXTRA_DOCK_STATE_CAR}, or 293467ef8eaea8a0a2073147a8d863f0e3f30d525802Steve Naroff * {@link android.content.Intent#EXTRA_DOCK_STATE_LE_DESK}, or 293567ef8eaea8a0a2073147a8d863f0e3f30d525802Steve Naroff * {@link android.content.Intent#EXTRA_DOCK_STATE_HE_DESK}. 293614108da7f7fc059772711e4ffee1322a27b152a7Steve Naroff */ 293714108da7f7fc059772711e4ffee1322a27b152a7Steve Naroff public static final String EXTRA_DOCK_STATE = "android.intent.extra.DOCK_STATE"; 293814108da7f7fc059772711e4ffee1322a27b152a7Steve Naroff 293914108da7f7fc059772711e4ffee1322a27b152a7Steve Naroff /** 294014108da7f7fc059772711e4ffee1322a27b152a7Steve Naroff * Used as an int value for {@link android.content.Intent#EXTRA_DOCK_STATE} 294114108da7f7fc059772711e4ffee1322a27b152a7Steve Naroff * to represent that the phone is not in any dock. 294214108da7f7fc059772711e4ffee1322a27b152a7Steve Naroff */ 2943ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner public static final int EXTRA_DOCK_STATE_UNDOCKED = 0; 2944ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner 2945ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner /** 2946ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner * Used as an int value for {@link android.content.Intent#EXTRA_DOCK_STATE} 2947ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner * to represent that the phone is in a desk dock. 2948ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner */ 2949ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner public static final int EXTRA_DOCK_STATE_DESK = 1; 2950ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner 2951ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner /** 2952ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner * Used as an int value for {@link android.content.Intent#EXTRA_DOCK_STATE} 2953ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner * to represent that the phone is in a car dock. 2954ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner */ 295514108da7f7fc059772711e4ffee1322a27b152a7Steve Naroff public static final int EXTRA_DOCK_STATE_CAR = 2; 295614108da7f7fc059772711e4ffee1322a27b152a7Steve Naroff 2957ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner /** 2958ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner * Used as an int value for {@link android.content.Intent#EXTRA_DOCK_STATE} 2959ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner * to represent that the phone is in a analog (low end) dock. 2960ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner */ 296167ef8eaea8a0a2073147a8d863f0e3f30d525802Steve Naroff public static final int EXTRA_DOCK_STATE_LE_DESK = 3; 296267ef8eaea8a0a2073147a8d863f0e3f30d525802Steve Naroff 296367ef8eaea8a0a2073147a8d863f0e3f30d525802Steve Naroff /** 2964ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner * Used as an int value for {@link android.content.Intent#EXTRA_DOCK_STATE} 2965ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner * to represent that the phone is in a digital (high end) dock. 2966ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner */ 2967ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner public static final int EXTRA_DOCK_STATE_HE_DESK = 4; 2968ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner 2969ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner /** 2970ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner * Boolean that can be supplied as meta-data with a dock activity, to 2971ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner * indicate that the dock should take over the home key when it is active. 2972ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner */ 2973ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner public static final String METADATA_DOCK_HOME = "android.dock_home"; 297485f9bceab1542aafff012d4d28e998f4ba16e362Anders Carlsson 297585f9bceab1542aafff012d4d28e998f4ba16e362Anders Carlsson /** 2976a526c5c67e5a0473c340903ee542ce570119665fTed Kremenek * Used as a parcelable extra field in {@link #ACTION_APP_ERROR}, containing 2977ecb01e666665efabd2aa76a76f6080e2a78965faFariborz Jahanian * the bug report. 2978ecb01e666665efabd2aa76a76f6080e2a78965faFariborz Jahanian */ 2979ecb01e666665efabd2aa76a76f6080e2a78965faFariborz Jahanian public static final String EXTRA_BUG_REPORT = "android.intent.extra.BUG_REPORT"; 2980ecb01e666665efabd2aa76a76f6080e2a78965faFariborz Jahanian 2981ecb01e666665efabd2aa76a76f6080e2a78965faFariborz Jahanian /** 2982ecb01e666665efabd2aa76a76f6080e2a78965faFariborz Jahanian * Used in the extra field in the remote intent. It's astring token passed with the 2983ecb01e666665efabd2aa76a76f6080e2a78965faFariborz Jahanian * remote intent. 2984ecb01e666665efabd2aa76a76f6080e2a78965faFariborz Jahanian */ 2985ecb01e666665efabd2aa76a76f6080e2a78965faFariborz Jahanian public static final String EXTRA_REMOTE_INTENT_TOKEN = 2986ecb01e666665efabd2aa76a76f6080e2a78965faFariborz Jahanian "android.intent.extra.remote_intent_token"; 2987ecb01e666665efabd2aa76a76f6080e2a78965faFariborz Jahanian 2988ecb01e666665efabd2aa76a76f6080e2a78965faFariborz Jahanian /** 2989ecb01e666665efabd2aa76a76f6080e2a78965faFariborz Jahanian * @deprecated See {@link #EXTRA_CHANGED_COMPONENT_NAME_LIST}; this field 2990ecb01e666665efabd2aa76a76f6080e2a78965faFariborz Jahanian * will contain only the first name in the list. 2991ecb01e666665efabd2aa76a76f6080e2a78965faFariborz Jahanian */ 2992ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner @Deprecated public static final String EXTRA_CHANGED_COMPONENT_NAME = 2993b2cf3573d7351094f6247fcca94703ce88eb9ee0Anders Carlsson "android.intent.extra.changed_component_name"; 2994b2cf3573d7351094f6247fcca94703ce88eb9ee0Anders Carlsson 2995b2cf3573d7351094f6247fcca94703ce88eb9ee0Anders Carlsson /** 2996b2cf3573d7351094f6247fcca94703ce88eb9ee0Anders Carlsson * This field is part of {@link android.content.Intent#ACTION_PACKAGE_CHANGED}, 2997b2cf3573d7351094f6247fcca94703ce88eb9ee0Anders Carlsson * and contains a string array of all of the components that have changed. If 2998ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner * the state of the overall package has changed, then it will contain an entry 2999de2e22d33afec98324a66a358dfe0951b3c7259aSteve Naroff * with the package name itself. 30007e219e47de26346885d667131977bd9ca2d7662aSteve Naroff */ 30017e219e47de26346885d667131977bd9ca2d7662aSteve Naroff public static final String EXTRA_CHANGED_COMPONENT_NAME_LIST = 3002ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner "android.intent.extra.changed_component_name_list"; 3003319ac896a0fef7365d5589b8021db7e41207fe42Douglas Gregor 3004319ac896a0fef7365d5589b8021db7e41207fe42Douglas Gregor /** 3005319ac896a0fef7365d5589b8021db7e41207fe42Douglas Gregor * This field is part of 3006319ac896a0fef7365d5589b8021db7e41207fe42Douglas Gregor * {@link android.content.Intent#ACTION_EXTERNAL_APPLICATIONS_AVAILABLE}, 3007319ac896a0fef7365d5589b8021db7e41207fe42Douglas Gregor * {@link android.content.Intent#ACTION_EXTERNAL_APPLICATIONS_UNAVAILABLE} 3008319ac896a0fef7365d5589b8021db7e41207fe42Douglas Gregor * and contains a string array of all of the components that have changed. 3009b62f6813406a03bf8a371c4e46c9fad51d102121Fariborz Jahanian */ 3010b62f6813406a03bf8a371c4e46c9fad51d102121Fariborz Jahanian public static final String EXTRA_CHANGED_PACKAGE_LIST = 301135366a67baa970c287c714c957cf78a4131cf60dTed Kremenek "android.intent.extra.changed_package_list"; 3012c55a24095c3488fa6e99b537be64e57a2905477bFariborz Jahanian 3013c55a24095c3488fa6e99b537be64e57a2905477bFariborz Jahanian /** 3014b62f6813406a03bf8a371c4e46c9fad51d102121Fariborz Jahanian * This field is part of 3015c55a24095c3488fa6e99b537be64e57a2905477bFariborz Jahanian * {@link android.content.Intent#ACTION_EXTERNAL_APPLICATIONS_AVAILABLE}, 3016c55a24095c3488fa6e99b537be64e57a2905477bFariborz Jahanian * {@link android.content.Intent#ACTION_EXTERNAL_APPLICATIONS_UNAVAILABLE} 3017b62f6813406a03bf8a371c4e46c9fad51d102121Fariborz Jahanian * and contains an integer array of uids of all of the components 3018b62f6813406a03bf8a371c4e46c9fad51d102121Fariborz Jahanian * that have changed. 3019b62f6813406a03bf8a371c4e46c9fad51d102121Fariborz Jahanian */ 3020ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner public static final String EXTRA_CHANGED_UID_LIST = 3021a526c5c67e5a0473c340903ee542ce570119665fTed Kremenek "android.intent.extra.changed_uid_list"; 3022390d50a725497e99247dc104a7d2c2a255d3af14Fariborz Jahanian 3023390d50a725497e99247dc104a7d2c2a255d3af14Fariborz Jahanian /** 3024ce7b38c4f1ea9c51e2f46a82e3f57456b74269d5Chris Lattner * @hide 3025de2e22d33afec98324a66a358dfe0951b3c7259aSteve Naroff * Magic extra system code can use when binding, to give a label for 30268baaca50f07d0c10bba69c8d88c1b9078c92d06dAnders Carlsson * who it is that has bound to a service. This is an integer giving 30278baaca50f07d0c10bba69c8d88c1b9078c92d06dAnders Carlsson * a framework string resource that can be displayed to the user. 3028a526c5c67e5a0473c340903ee542ce570119665fTed Kremenek */ 3029a526c5c67e5a0473c340903ee542ce570119665fTed Kremenek public static final String EXTRA_CLIENT_LABEL = 30302198891824c38d45b2279de5d5e3ef9394eb457cSteve Naroff "android.intent.extra.client_label"; 30312198891824c38d45b2279de5d5e3ef9394eb457cSteve Naroff 3032a526c5c67e5a0473c340903ee542ce570119665fTed Kremenek /** 30332198891824c38d45b2279de5d5e3ef9394eb457cSteve Naroff * @hide 30342198891824c38d45b2279de5d5e3ef9394eb457cSteve Naroff * Magic extra system code can use when binding, to give a PendingIntent object 30357532dc66648cfe7432c9fe66dec5225f0ab301c6Douglas Gregor * that can be launched for the user to disable the system's use of this 30367532dc66648cfe7432c9fe66dec5225f0ab301c6Douglas Gregor * service. 30377532dc66648cfe7432c9fe66dec5225f0ab301c6Douglas Gregor */ 30387532dc66648cfe7432c9fe66dec5225f0ab301c6Douglas Gregor public static final String EXTRA_CLIENT_INTENT = 30397532dc66648cfe7432c9fe66dec5225f0ab301c6Douglas Gregor "android.intent.extra.client_intent"; 30407532dc66648cfe7432c9fe66dec5225f0ab301c6Douglas Gregor 30417532dc66648cfe7432c9fe66dec5225f0ab301c6Douglas Gregor /** 30427532dc66648cfe7432c9fe66dec5225f0ab301c6Douglas Gregor * Used to indicate that a {@link #ACTION_GET_CONTENT} intent should only return 30437532dc66648cfe7432c9fe66dec5225f0ab301c6Douglas Gregor * data that is on the local device. This is a boolean extra; the default 30447532dc66648cfe7432c9fe66dec5225f0ab301c6Douglas Gregor * is false. If true, an implementation of ACTION_GET_CONTENT should only allow 30457532dc66648cfe7432c9fe66dec5225f0ab301c6Douglas Gregor * the user to select media that is already on the device, not requiring it 30467532dc66648cfe7432c9fe66dec5225f0ab301c6Douglas Gregor * be downloaded from a remote service when opened. Another way to look 30477532dc66648cfe7432c9fe66dec5225f0ab301c6Douglas Gregor * at it is that such content should generally have a "_data" column to the 30487532dc66648cfe7432c9fe66dec5225f0ab301c6Douglas Gregor * path of the content on local external storage. 30497532dc66648cfe7432c9fe66dec5225f0ab301c6Douglas Gregor */ 30507532dc66648cfe7432c9fe66dec5225f0ab301c6Douglas Gregor public static final String EXTRA_LOCAL_ONLY = 30517532dc66648cfe7432c9fe66dec5225f0ab301c6Douglas Gregor "android.intent.extra.LOCAL_ONLY"; 30527532dc66648cfe7432c9fe66dec5225f0ab301c6Douglas Gregor 30537532dc66648cfe7432c9fe66dec5225f0ab301c6Douglas Gregor /** 30547532dc66648cfe7432c9fe66dec5225f0ab301c6Douglas Gregor * Used to indicate that a {@link #ACTION_GET_CONTENT} intent can allow the 30557532dc66648cfe7432c9fe66dec5225f0ab301c6Douglas Gregor * user to select and return multiple items. This is a boolean extra; the default 30567532dc66648cfe7432c9fe66dec5225f0ab301c6Douglas Gregor * is false. If true, an implementation of ACTION_GET_CONTENT is allowed to 30577532dc66648cfe7432c9fe66dec5225f0ab301c6Douglas Gregor * present the user with a UI where they can pick multiple items that are all 30587532dc66648cfe7432c9fe66dec5225f0ab301c6Douglas Gregor * returned to the caller. When this happens, they should be returned as 30597532dc66648cfe7432c9fe66dec5225f0ab301c6Douglas Gregor * the {@link #getClipData()} part of the result Intent. 30607532dc66648cfe7432c9fe66dec5225f0ab301c6Douglas Gregor */ 30617532dc66648cfe7432c9fe66dec5225f0ab301c6Douglas Gregor public static final String EXTRA_ALLOW_MULTIPLE = 30627532dc66648cfe7432c9fe66dec5225f0ab301c6Douglas Gregor "android.intent.extra.ALLOW_MULTIPLE"; 30637532dc66648cfe7432c9fe66dec5225f0ab301c6Douglas Gregor 30647532dc66648cfe7432c9fe66dec5225f0ab301c6Douglas Gregor /** 30657532dc66648cfe7432c9fe66dec5225f0ab301c6Douglas Gregor * The userHandle carried with broadcast intents related to addition, removal and switching of users 30667532dc66648cfe7432c9fe66dec5225f0ab301c6Douglas Gregor * - {@link #ACTION_USER_ADDED}, {@link #ACTION_USER_REMOVED} and {@link #ACTION_USER_SWITCHED}. 30677532dc66648cfe7432c9fe66dec5225f0ab301c6Douglas Gregor * @hide 30687532dc66648cfe7432c9fe66dec5225f0ab301c6Douglas Gregor */ 30697532dc66648cfe7432c9fe66dec5225f0ab301c6Douglas Gregor public static final String EXTRA_USER_HANDLE = 30707532dc66648cfe7432c9fe66dec5225f0ab301c6Douglas Gregor "android.intent.extra.user_handle"; 30717532dc66648cfe7432c9fe66dec5225f0ab301c6Douglas Gregor 30727532dc66648cfe7432c9fe66dec5225f0ab301c6Douglas Gregor // --------------------------------------------------------------------- 30737532dc66648cfe7432c9fe66dec5225f0ab301c6Douglas Gregor // --------------------------------------------------------------------- 30747532dc66648cfe7432c9fe66dec5225f0ab301c6Douglas Gregor // Intent flags (see mFlags variable). 30757532dc66648cfe7432c9fe66dec5225f0ab301c6Douglas Gregor 30767532dc66648cfe7432c9fe66dec5225f0ab301c6Douglas Gregor /** 30777532dc66648cfe7432c9fe66dec5225f0ab301c6Douglas Gregor * If set, the recipient of this Intent will be granted permission to 30787532dc66648cfe7432c9fe66dec5225f0ab301c6Douglas Gregor * perform read operations on the Uri in the Intent's data and any URIs 30797532dc66648cfe7432c9fe66dec5225f0ab301c6Douglas Gregor * specified in its ClipData. When applying to an Intent's ClipData, 30807532dc66648cfe7432c9fe66dec5225f0ab301c6Douglas Gregor * all URIs as well as recursive traversals through data or other ClipData 30817532dc66648cfe7432c9fe66dec5225f0ab301c6Douglas Gregor * in Intent items will be granted; only the grant flags of the top-level 3082b4e66d5259f90e9aae4d40fc5de801e046c7df94Douglas Gregor * Intent are used. 3083d934112e6170b0fd940d8e40db6936cea2cdcf62Douglas Gregor */ 3084d934112e6170b0fd940d8e40db6936cea2cdcf62Douglas Gregor public static final int FLAG_GRANT_READ_URI_PERMISSION = 0x00000001; 3085d934112e6170b0fd940d8e40db6936cea2cdcf62Douglas Gregor /** 3086b4e66d5259f90e9aae4d40fc5de801e046c7df94Douglas Gregor * If set, the recipient of this Intent will be granted permission to 3087b4e66d5259f90e9aae4d40fc5de801e046c7df94Douglas Gregor * perform write operations on the Uri in the Intent's data and any URIs 3088b4e66d5259f90e9aae4d40fc5de801e046c7df94Douglas Gregor * specified in its ClipData. When applying to an Intent's ClipData, 3089b4e66d5259f90e9aae4d40fc5de801e046c7df94Douglas Gregor * all URIs as well as recursive traversals through data or other ClipData 3090b4e66d5259f90e9aae4d40fc5de801e046c7df94Douglas Gregor * in Intent items will be granted; only the grant flags of the top-level 3091b4e66d5259f90e9aae4d40fc5de801e046c7df94Douglas Gregor * Intent are used. 3092b4e66d5259f90e9aae4d40fc5de801e046c7df94Douglas Gregor */ 3093b4e66d5259f90e9aae4d40fc5de801e046c7df94Douglas Gregor public static final int FLAG_GRANT_WRITE_URI_PERMISSION = 0x00000002; 3094b4e66d5259f90e9aae4d40fc5de801e046c7df94Douglas Gregor /** 3095b4e66d5259f90e9aae4d40fc5de801e046c7df94Douglas Gregor * Can be set by the caller to indicate that this Intent is coming from 3096b4e66d5259f90e9aae4d40fc5de801e046c7df94Douglas Gregor * a background operation, not from direct user interaction. 3097b4e66d5259f90e9aae4d40fc5de801e046c7df94Douglas Gregor */ 3098b4e66d5259f90e9aae4d40fc5de801e046c7df94Douglas Gregor public static final int FLAG_FROM_BACKGROUND = 0x00000004; 3099b3ac5434ab936f092b8cc48349cb01db3a1e1c76Daniel Dunbar /** 3100b4e66d5259f90e9aae4d40fc5de801e046c7df94Douglas Gregor * A flag you can enable for debugging: when set, log messages will be 3101b6ccaac65ca72f72954eb3893bbd940bedd23f00Ted Kremenek * printed during the resolution of this intent to show you what has 3102b6ccaac65ca72f72954eb3893bbd940bedd23f00Ted Kremenek * been found to create the final resolved list. 3103b6ccaac65ca72f72954eb3893bbd940bedd23f00Ted Kremenek */ 3104b6ccaac65ca72f72954eb3893bbd940bedd23f00Ted Kremenek public static final int FLAG_DEBUG_LOG_RESOLUTION = 0x00000008; 3105b6ccaac65ca72f72954eb3893bbd940bedd23f00Ted Kremenek /** 3106fa23c1d9adc99c662c1c0e192817185809d95614Fariborz Jahanian * If set, this intent will not match any components in packages that 3107fa23c1d9adc99c662c1c0e192817185809d95614Fariborz Jahanian * are currently stopped. If this is not set, then the default behavior 3108fa23c1d9adc99c662c1c0e192817185809d95614Fariborz Jahanian * is to include such applications in the result. 3109f49545602089be5b1f744e04326b8a566f6d8773Steve Naroff */ 3110fa23c1d9adc99c662c1c0e192817185809d95614Fariborz Jahanian public static final int FLAG_EXCLUDE_STOPPED_PACKAGES = 0x00000010; 3111fa23c1d9adc99c662c1c0e192817185809d95614Fariborz Jahanian /** 3112fa23c1d9adc99c662c1c0e192817185809d95614Fariborz Jahanian * If set, this intent will always match any components in packages that 3113fa23c1d9adc99c662c1c0e192817185809d95614Fariborz Jahanian * are currently stopped. This is the default behavior when 311440b598eea1310ec9ed554d56ce3e25b34c585458Argyrios Kyrtzidis * {@link #FLAG_EXCLUDE_STOPPED_PACKAGES} is not set. If both of these 3115fa23c1d9adc99c662c1c0e192817185809d95614Fariborz Jahanian * flags are set, this one wins (it allows overriding of exclude for 3116fa23c1d9adc99c662c1c0e192817185809d95614Fariborz Jahanian * places where the framework may automatically set the exclude flag). 3117fa23c1d9adc99c662c1c0e192817185809d95614Fariborz Jahanian */ 3118fa23c1d9adc99c662c1c0e192817185809d95614Fariborz Jahanian public static final int FLAG_INCLUDE_STOPPED_PACKAGES = 0x00000020; 3119fa23c1d9adc99c662c1c0e192817185809d95614Fariborz Jahanian 31204fd83ea566f4a0c083001c84b75da6cc8c99c1d6Fariborz Jahanian /** 31214fd83ea566f4a0c083001c84b75da6cc8c99c1d6Fariborz Jahanian * If set, the new activity is not kept in the history stack. As soon as 31224fd83ea566f4a0c083001c84b75da6cc8c99c1d6Fariborz Jahanian * the user navigates away from it, the activity is finished. This may also 31234fd83ea566f4a0c083001c84b75da6cc8c99c1d6Fariborz Jahanian * be set with the {@link android.R.styleable#AndroidManifestActivity_noHistory 3124b7d2553edd2532d29b98b9e76bcf6a62bc48b417Chris Lattner * noHistory} attribute. 31254fd83ea566f4a0c083001c84b75da6cc8c99c1d6Fariborz Jahanian */ 31264fd83ea566f4a0c083001c84b75da6cc8c99c1d6Fariborz Jahanian public static final int FLAG_ACTIVITY_NO_HISTORY = 0x40000000; 3127b7d2553edd2532d29b98b9e76bcf6a62bc48b417Chris Lattner /** 31284fd83ea566f4a0c083001c84b75da6cc8c99c1d6Fariborz Jahanian * If set, the activity will not be launched if it is already running 3129a223cca7751637f8ec1a860010c4148757fb4752Fariborz Jahanian * at the top of the history stack. 3130a223cca7751637f8ec1a860010c4148757fb4752Fariborz Jahanian */ 3131a223cca7751637f8ec1a860010c4148757fb4752Fariborz Jahanian public static final int FLAG_ACTIVITY_SINGLE_TOP = 0x20000000; 3132f49545602089be5b1f744e04326b8a566f6d8773Steve Naroff /** 3133a223cca7751637f8ec1a860010c4148757fb4752Fariborz Jahanian * If set, this activity will become the start of a new task on this 3134a223cca7751637f8ec1a860010c4148757fb4752Fariborz Jahanian * history stack. A task (from the activity that started it to the 313535366a67baa970c287c714c957cf78a4131cf60dTed Kremenek * next task activity) defines an atomic group of activities that the 3136a223cca7751637f8ec1a860010c4148757fb4752Fariborz Jahanian * user can move to. Tasks can be moved to the foreground and background; 3137c2112181b96349eb595dc5e8b7073b81ecdec0dbFariborz Jahanian * all of the activities inside of a particular task always remain in 3138c2112181b96349eb595dc5e8b7073b81ecdec0dbFariborz Jahanian * the same order. See 3139f49545602089be5b1f744e04326b8a566f6d8773Steve Naroff * <a href="{@docRoot}guide/topics/fundamentals/tasks-and-back-stack.html">Tasks and Back 3140c2112181b96349eb595dc5e8b7073b81ecdec0dbFariborz Jahanian * Stack</a> for more information about tasks. 31414fd83ea566f4a0c083001c84b75da6cc8c99c1d6Fariborz Jahanian * 3142b7d2553edd2532d29b98b9e76bcf6a62bc48b417Chris Lattner * <p>This flag is generally used by activities that want 31434fd83ea566f4a0c083001c84b75da6cc8c99c1d6Fariborz Jahanian * to present a "launcher" style behavior: they give the user a list of 31444fd83ea566f4a0c083001c84b75da6cc8c99c1d6Fariborz Jahanian * separate things that can be done, which otherwise run completely 31456ac46a4a521366d7ab36ebe2ce4e624ab96b06f9Chris Lattner * independently of the activity launching them. 31466ac46a4a521366d7ab36ebe2ce4e624ab96b06f9Chris Lattner * 31476ac46a4a521366d7ab36ebe2ce4e624ab96b06f9Chris Lattner * <p>When using this flag, if a task is already running for the activity 3148770951b5bb6028a8d326ddb4a13cef7d4a128162Chris Lattner * you are now starting, then a new activity will not be started; instead, 31496ac46a4a521366d7ab36ebe2ce4e624ab96b06f9Chris Lattner * the current task will simply be brought to the front of the screen with 31506ac46a4a521366d7ab36ebe2ce4e624ab96b06f9Chris Lattner * the state it was last in. See {@link #FLAG_ACTIVITY_MULTIPLE_TASK} for a flag 31516ac46a4a521366d7ab36ebe2ce4e624ab96b06f9Chris Lattner * to disable this behavior. 31526ac46a4a521366d7ab36ebe2ce4e624ab96b06f9Chris Lattner * 31536ac46a4a521366d7ab36ebe2ce4e624ab96b06f9Chris Lattner * <p>This flag can not be used when the caller is requesting a result from 31546ac46a4a521366d7ab36ebe2ce4e624ab96b06f9Chris Lattner * the activity being launched. 315561710854be2b098428aff5316e64bd34b30fbcb7Chris Lattner */ 31566ac46a4a521366d7ab36ebe2ce4e624ab96b06f9Chris Lattner public static final int FLAG_ACTIVITY_NEW_TASK = 0x10000000; 31576ac46a4a521366d7ab36ebe2ce4e624ab96b06f9Chris Lattner /** 31584084c306635b70f37029dca938444e6013f08684Steve Naroff * <strong>Do not use this flag unless you are implementing your own 31594084c306635b70f37029dca938444e6013f08684Steve Naroff * top-level application launcher.</strong> Used in conjunction with 31604084c306635b70f37029dca938444e6013f08684Steve Naroff * {@link #FLAG_ACTIVITY_NEW_TASK} to disable the 31614084c306635b70f37029dca938444e6013f08684Steve Naroff * behavior of bringing an existing task to the foreground. When set, 31624084c306635b70f37029dca938444e6013f08684Steve Naroff * a new task is <em>always</em> started to host the Activity for the 31634084c306635b70f37029dca938444e6013f08684Steve Naroff * Intent, regardless of whether there is already an existing task running 31644084c306635b70f37029dca938444e6013f08684Steve Naroff * the same thing. 31654084c306635b70f37029dca938444e6013f08684Steve Naroff * 31664084c306635b70f37029dca938444e6013f08684Steve Naroff * <p><strong>Because the default system does not include graphical task management, 316714108da7f7fc059772711e4ffee1322a27b152a7Steve Naroff * you should not use this flag unless you provide some way for a user to 31684084c306635b70f37029dca938444e6013f08684Steve Naroff * return back to the tasks you have launched.</strong> 31694084c306635b70f37029dca938444e6013f08684Steve Naroff * 31704084c306635b70f37029dca938444e6013f08684Steve Naroff * <p>This flag is ignored if 31714084c306635b70f37029dca938444e6013f08684Steve Naroff * {@link #FLAG_ACTIVITY_NEW_TASK} is not set. 31724084c306635b70f37029dca938444e6013f08684Steve Naroff * 31734084c306635b70f37029dca938444e6013f08684Steve Naroff * <p>See 317414108da7f7fc059772711e4ffee1322a27b152a7Steve Naroff * <a href="{@docRoot}guide/topics/fundamentals/tasks-and-back-stack.html">Tasks and Back 31754084c306635b70f37029dca938444e6013f08684Steve Naroff * Stack</a> for more information about tasks. 31764084c306635b70f37029dca938444e6013f08684Steve Naroff */ 31774084c306635b70f37029dca938444e6013f08684Steve Naroff public static final int FLAG_ACTIVITY_MULTIPLE_TASK = 0x08000000; 31784084c306635b70f37029dca938444e6013f08684Steve Naroff /** 31794084c306635b70f37029dca938444e6013f08684Steve Naroff * If set, and the activity being launched is already running in the 31804084c306635b70f37029dca938444e6013f08684Steve Naroff * current task, then instead of launching a new instance of that activity, 31814084c306635b70f37029dca938444e6013f08684Steve Naroff * all of the other activities on top of it will be closed and this Intent 31824084c306635b70f37029dca938444e6013f08684Steve Naroff * will be delivered to the (now on top) old activity as a new Intent. 31834084c306635b70f37029dca938444e6013f08684Steve Naroff * 31844084c306635b70f37029dca938444e6013f08684Steve Naroff * <p>For example, consider a task consisting of the activities: A, B, C, D. 31854084c306635b70f37029dca938444e6013f08684Steve Naroff * If D calls startActivity() with an Intent that resolves to the component 31864084c306635b70f37029dca938444e6013f08684Steve Naroff * of activity B, then C and D will be finished and B receive the given 31874084c306635b70f37029dca938444e6013f08684Steve Naroff * Intent, resulting in the stack now being: A, B. 31884084c306635b70f37029dca938444e6013f08684Steve Naroff * 31894084c306635b70f37029dca938444e6013f08684Steve Naroff * <p>The currently running instance of activity B in the above example will 31904084c306635b70f37029dca938444e6013f08684Steve Naroff * either receive the new intent you are starting here in its 31914084c306635b70f37029dca938444e6013f08684Steve Naroff * onNewIntent() method, or be itself finished and restarted with the 31924084c306635b70f37029dca938444e6013f08684Steve Naroff * new intent. If it has declared its launch mode to be "multiple" (the 31934084c306635b70f37029dca938444e6013f08684Steve Naroff * default) and you have not set {@link #FLAG_ACTIVITY_SINGLE_TOP} in 31944084c306635b70f37029dca938444e6013f08684Steve Naroff * the same intent, then it will be finished and re-created; for all other 31954084c306635b70f37029dca938444e6013f08684Steve Naroff * launch modes or if {@link #FLAG_ACTIVITY_SINGLE_TOP} is set then this 31964084c306635b70f37029dca938444e6013f08684Steve Naroff * Intent will be delivered to the current instance's onNewIntent(). 31974084c306635b70f37029dca938444e6013f08684Steve Naroff * 31984084c306635b70f37029dca938444e6013f08684Steve Naroff * <p>This launch mode can also be used to good effect in conjunction with 31994084c306635b70f37029dca938444e6013f08684Steve Naroff * {@link #FLAG_ACTIVITY_NEW_TASK}: if used to start the root activity 32004084c306635b70f37029dca938444e6013f08684Steve Naroff * of a task, it will bring any currently running instance of that task 32014084c306635b70f37029dca938444e6013f08684Steve Naroff * to the foreground, and then clear it to its root state. This is 32024084c306635b70f37029dca938444e6013f08684Steve Naroff * especially useful, for example, when launching an activity from the 32034084c306635b70f37029dca938444e6013f08684Steve Naroff * notification manager. 32044084c306635b70f37029dca938444e6013f08684Steve Naroff * 32054084c306635b70f37029dca938444e6013f08684Steve Naroff * <p>See 32064084c306635b70f37029dca938444e6013f08684Steve Naroff * <a href="{@docRoot}guide/topics/fundamentals/tasks-and-back-stack.html">Tasks and Back 32074084c306635b70f37029dca938444e6013f08684Steve Naroff * Stack</a> for more information about tasks. 32084084c306635b70f37029dca938444e6013f08684Steve Naroff */ 32094084c306635b70f37029dca938444e6013f08684Steve Naroff public static final int FLAG_ACTIVITY_CLEAR_TOP = 0x04000000; 32104084c306635b70f37029dca938444e6013f08684Steve Naroff /** 32114084c306635b70f37029dca938444e6013f08684Steve Naroff * If set and this intent is being used to launch a new activity from an 32124084c306635b70f37029dca938444e6013f08684Steve Naroff * existing one, then the reply target of the existing activity will be 32134084c306635b70f37029dca938444e6013f08684Steve Naroff * transfered to the new activity. This way the new activity can call 32144084c306635b70f37029dca938444e6013f08684Steve Naroff * {@link android.app.Activity#setResult} and have that result sent back to 32154084c306635b70f37029dca938444e6013f08684Steve Naroff * the reply target of the original activity. 32164084c306635b70f37029dca938444e6013f08684Steve Naroff */ 32174084c306635b70f37029dca938444e6013f08684Steve Naroff public static final int FLAG_ACTIVITY_FORWARD_RESULT = 0x02000000; 32184084c306635b70f37029dca938444e6013f08684Steve Naroff /** 32194084c306635b70f37029dca938444e6013f08684Steve Naroff * If set and this intent is being used to launch a new activity from an 32204084c306635b70f37029dca938444e6013f08684Steve Naroff * existing one, the current activity will not be counted as the top 32214084c306635b70f37029dca938444e6013f08684Steve Naroff * activity for deciding whether the new intent should be delivered to 32224084c306635b70f37029dca938444e6013f08684Steve Naroff * the top instead of starting a new one. The previous activity will 32234084c306635b70f37029dca938444e6013f08684Steve Naroff * be used as the top, with the assumption being that the current activity 32244084c306635b70f37029dca938444e6013f08684Steve Naroff * will finish itself immediately. 32254084c306635b70f37029dca938444e6013f08684Steve Naroff */ 32264084c306635b70f37029dca938444e6013f08684Steve Naroff public static final int FLAG_ACTIVITY_PREVIOUS_IS_TOP = 0x01000000; 32274084c306635b70f37029dca938444e6013f08684Steve Naroff /** 32284084c306635b70f37029dca938444e6013f08684Steve Naroff * If set, the new activity is not kept in the list of recently launched 32294084c306635b70f37029dca938444e6013f08684Steve Naroff * activities. 32304084c306635b70f37029dca938444e6013f08684Steve Naroff */ 32314084c306635b70f37029dca938444e6013f08684Steve Naroff public static final int FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS = 0x00800000; 32324084c306635b70f37029dca938444e6013f08684Steve Naroff /** 32334084c306635b70f37029dca938444e6013f08684Steve Naroff * This flag is not normally set by application code, but set for you by 32344084c306635b70f37029dca938444e6013f08684Steve Naroff * the system as described in the 32354084c306635b70f37029dca938444e6013f08684Steve Naroff * {@link android.R.styleable#AndroidManifestActivity_launchMode 32364084c306635b70f37029dca938444e6013f08684Steve Naroff * launchMode} documentation for the singleTask mode. 32374084c306635b70f37029dca938444e6013f08684Steve Naroff */ 32384084c306635b70f37029dca938444e6013f08684Steve Naroff public static final int FLAG_ACTIVITY_BROUGHT_TO_FRONT = 0x00400000; 32394084c306635b70f37029dca938444e6013f08684Steve Naroff /** 32404084c306635b70f37029dca938444e6013f08684Steve Naroff * If set, and this activity is either being started in a new task or 32414084c306635b70f37029dca938444e6013f08684Steve Naroff * bringing to the top an existing task, then it will be launched as 32424084c306635b70f37029dca938444e6013f08684Steve Naroff * the front door of the task. This will result in the application of 32434084c306635b70f37029dca938444e6013f08684Steve Naroff * any affinities needed to have that task in the proper state (either 32444084c306635b70f37029dca938444e6013f08684Steve Naroff * moving activities to or from it), or simply resetting that task to 32454084c306635b70f37029dca938444e6013f08684Steve Naroff * its initial state if needed. 32464084c306635b70f37029dca938444e6013f08684Steve Naroff */ 32474084c306635b70f37029dca938444e6013f08684Steve Naroff public static final int FLAG_ACTIVITY_RESET_TASK_IF_NEEDED = 0x00200000; 32484084c306635b70f37029dca938444e6013f08684Steve Naroff /** 32494084c306635b70f37029dca938444e6013f08684Steve Naroff * This flag is not normally set by application code, but set for you by 32504084c306635b70f37029dca938444e6013f08684Steve Naroff * the system if this activity is being launched from history 32514084c306635b70f37029dca938444e6013f08684Steve Naroff * (longpress home key). 32524084c306635b70f37029dca938444e6013f08684Steve Naroff */ 32534084c306635b70f37029dca938444e6013f08684Steve Naroff public static final int FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY = 0x00100000; 32544084c306635b70f37029dca938444e6013f08684Steve Naroff /** 32554084c306635b70f37029dca938444e6013f08684Steve Naroff * If set, this marks a point in the task's activity stack that should 32564084c306635b70f37029dca938444e6013f08684Steve Naroff * be cleared when the task is reset. That is, the next time the task 32574084c306635b70f37029dca938444e6013f08684Steve Naroff * is brought to the foreground with 32584084c306635b70f37029dca938444e6013f08684Steve Naroff * {@link #FLAG_ACTIVITY_RESET_TASK_IF_NEEDED} (typically as a result of 32594084c306635b70f37029dca938444e6013f08684Steve Naroff * the user re-launching it from home), this activity and all on top of 32604084c306635b70f37029dca938444e6013f08684Steve Naroff * it will be finished so that the user does not return to them, but 32614084c306635b70f37029dca938444e6013f08684Steve Naroff * instead returns to whatever activity preceeded it. 3262de2e22d33afec98324a66a358dfe0951b3c7259aSteve Naroff * 32634084c306635b70f37029dca938444e6013f08684Steve Naroff * <p>This is useful for cases where you have a logical break in your 32644084c306635b70f37029dca938444e6013f08684Steve Naroff * application. For example, an e-mail application may have a command 32654084c306635b70f37029dca938444e6013f08684Steve Naroff * to view an attachment, which launches an image view activity to 32664084c306635b70f37029dca938444e6013f08684Steve Naroff * display it. This activity should be part of the e-mail application's 3267de2e22d33afec98324a66a358dfe0951b3c7259aSteve Naroff * task, since it is a part of the task the user is involved in. However, 3268de2e22d33afec98324a66a358dfe0951b3c7259aSteve Naroff * if the user leaves that task, and later selects the e-mail app from 3269de2e22d33afec98324a66a358dfe0951b3c7259aSteve Naroff * home, we may like them to return to the conversation they were 3270de2e22d33afec98324a66a358dfe0951b3c7259aSteve Naroff * viewing, not the picture attachment, since that is confusing. By 32714084c306635b70f37029dca938444e6013f08684Steve Naroff * setting this flag when launching the image viewer, that viewer and 32724084c306635b70f37029dca938444e6013f08684Steve Naroff * any activities it starts will be removed the next time the user returns 32734084c306635b70f37029dca938444e6013f08684Steve Naroff * to mail. 32744084c306635b70f37029dca938444e6013f08684Steve Naroff */ 32754084c306635b70f37029dca938444e6013f08684Steve Naroff public static final int FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET = 0x00080000; 32764084c306635b70f37029dca938444e6013f08684Steve Naroff /** 32778f16756441450ed9fb39316e47d107fc2a1ef35bSteve Naroff * If set, this flag will prevent the normal {@link android.app.Activity#onUserLeaveHint} 32788f16756441450ed9fb39316e47d107fc2a1ef35bSteve Naroff * callback from occurring on the current frontmost activity before it is 3279de2e22d33afec98324a66a358dfe0951b3c7259aSteve Naroff * paused as the newly-started activity is brought to the front. 32804084c306635b70f37029dca938444e6013f08684Steve Naroff * 32814084c306635b70f37029dca938444e6013f08684Steve Naroff * <p>Typically, an activity can rely on that callback to indicate that an 32824084c306635b70f37029dca938444e6013f08684Steve Naroff * explicit user action has caused their activity to be moved out of the 32834084c306635b70f37029dca938444e6013f08684Steve Naroff * foreground. The callback marks an appropriate point in the activity's 32844084c306635b70f37029dca938444e6013f08684Steve Naroff * lifecycle for it to dismiss any notifications that it intends to display 32854084c306635b70f37029dca938444e6013f08684Steve Naroff * "until the user has seen them," such as a blinking LED. 32864084c306635b70f37029dca938444e6013f08684Steve Naroff * 32874084c306635b70f37029dca938444e6013f08684Steve Naroff * <p>If an activity is ever started via any non-user-driven events such as 32884084c306635b70f37029dca938444e6013f08684Steve Naroff * phone-call receipt or an alarm handler, this flag should be passed to {@link 32894084c306635b70f37029dca938444e6013f08684Steve Naroff * Context#startActivity Context.startActivity}, ensuring that the pausing 32904084c306635b70f37029dca938444e6013f08684Steve Naroff * activity does not think the user has acknowledged its notification. 32914084c306635b70f37029dca938444e6013f08684Steve Naroff */ 32924084c306635b70f37029dca938444e6013f08684Steve Naroff public static final int FLAG_ACTIVITY_NO_USER_ACTION = 0x00040000; 32934084c306635b70f37029dca938444e6013f08684Steve Naroff /** 32944084c306635b70f37029dca938444e6013f08684Steve Naroff * If set in an Intent passed to {@link Context#startActivity Context.startActivity()}, 3295de2e22d33afec98324a66a358dfe0951b3c7259aSteve Naroff * this flag will cause the launched activity to be brought to the front of its 3296de2e22d33afec98324a66a358dfe0951b3c7259aSteve Naroff * task's history stack if it is already running. 32974084c306635b70f37029dca938444e6013f08684Steve Naroff * 3298de2e22d33afec98324a66a358dfe0951b3c7259aSteve Naroff * <p>For example, consider a task consisting of four activities: A, B, C, D. 3299de2e22d33afec98324a66a358dfe0951b3c7259aSteve Naroff * If D calls startActivity() with an Intent that resolves to the component 33004084c306635b70f37029dca938444e6013f08684Steve Naroff * of activity B, then B will be brought to the front of the history stack, 33014084c306635b70f37029dca938444e6013f08684Steve Naroff * with this resulting order: A, C, D, B. 33024084c306635b70f37029dca938444e6013f08684Steve Naroff * 33034084c306635b70f37029dca938444e6013f08684Steve Naroff * This flag will be ignored if {@link #FLAG_ACTIVITY_CLEAR_TOP} is also 33044084c306635b70f37029dca938444e6013f08684Steve Naroff * specified. 33054084c306635b70f37029dca938444e6013f08684Steve Naroff */ 33064084c306635b70f37029dca938444e6013f08684Steve Naroff public static final int FLAG_ACTIVITY_REORDER_TO_FRONT = 0X00020000; 33074084c306635b70f37029dca938444e6013f08684Steve Naroff /** 33084084c306635b70f37029dca938444e6013f08684Steve Naroff * If set in an Intent passed to {@link Context#startActivity Context.startActivity()}, 33094084c306635b70f37029dca938444e6013f08684Steve Naroff * this flag will prevent the system from applying an activity transition 33104084c306635b70f37029dca938444e6013f08684Steve Naroff * animation to go to the next activity state. This doesn't mean an 33114084c306635b70f37029dca938444e6013f08684Steve Naroff * animation will never run -- if another activity change happens that doesn't 33124084c306635b70f37029dca938444e6013f08684Steve Naroff * specify this flag before the activity started here is displayed, then 33134084c306635b70f37029dca938444e6013f08684Steve Naroff * that transition will be used. This flag can be put to good use 33144084c306635b70f37029dca938444e6013f08684Steve Naroff * when you are going to do a series of activity operations but the 33154084c306635b70f37029dca938444e6013f08684Steve Naroff * animation seen by the user shouldn't be driven by the first activity 33164084c306635b70f37029dca938444e6013f08684Steve Naroff * change but rather a later one. 33174084c306635b70f37029dca938444e6013f08684Steve Naroff */ 33184084c306635b70f37029dca938444e6013f08684Steve Naroff public static final int FLAG_ACTIVITY_NO_ANIMATION = 0X00010000; 33194084c306635b70f37029dca938444e6013f08684Steve Naroff /** 33204084c306635b70f37029dca938444e6013f08684Steve Naroff * If set in an Intent passed to {@link Context#startActivity Context.startActivity()}, 33214084c306635b70f37029dca938444e6013f08684Steve Naroff * this flag will cause any existing task that would be associated with the 33224084c306635b70f37029dca938444e6013f08684Steve Naroff * activity to be cleared before the activity is started. That is, the activity 33234084c306635b70f37029dca938444e6013f08684Steve Naroff * becomes the new root of an otherwise empty task, and any old activities 33244084c306635b70f37029dca938444e6013f08684Steve Naroff * are finished. This can only be used in conjunction with {@link #FLAG_ACTIVITY_NEW_TASK}. 33254084c306635b70f37029dca938444e6013f08684Steve Naroff */ 33264084c306635b70f37029dca938444e6013f08684Steve Naroff public static final int FLAG_ACTIVITY_CLEAR_TASK = 0X00008000; 33274084c306635b70f37029dca938444e6013f08684Steve Naroff /** 33284084c306635b70f37029dca938444e6013f08684Steve Naroff * If set in an Intent passed to {@link Context#startActivity Context.startActivity()}, 33294084c306635b70f37029dca938444e6013f08684Steve Naroff * this flag will cause a newly launching task to be placed on top of the current 33304084c306635b70f37029dca938444e6013f08684Steve Naroff * home activity task (if there is one). That is, pressing back from the task 33314084c306635b70f37029dca938444e6013f08684Steve Naroff * will always return the user to home even if that was not the last activity they 33324084c306635b70f37029dca938444e6013f08684Steve Naroff * saw. This can only be used in conjunction with {@link #FLAG_ACTIVITY_NEW_TASK}. 33334084c306635b70f37029dca938444e6013f08684Steve Naroff */ 33344084c306635b70f37029dca938444e6013f08684Steve Naroff public static final int FLAG_ACTIVITY_TASK_ON_HOME = 0X00004000; 33354084c306635b70f37029dca938444e6013f08684Steve Naroff /** 33364084c306635b70f37029dca938444e6013f08684Steve Naroff * If set, when sending a broadcast only registered receivers will be 33374084c306635b70f37029dca938444e6013f08684Steve Naroff * called -- no BroadcastReceiver components will be launched. 33384084c306635b70f37029dca938444e6013f08684Steve Naroff */ 33394084c306635b70f37029dca938444e6013f08684Steve Naroff public static final int FLAG_RECEIVER_REGISTERED_ONLY = 0x40000000; 33404084c306635b70f37029dca938444e6013f08684Steve Naroff /** 33414084c306635b70f37029dca938444e6013f08684Steve Naroff * If set, when sending a broadcast the new broadcast will replace 33424084c306635b70f37029dca938444e6013f08684Steve Naroff * any existing pending broadcast that matches it. Matching is defined 33434084c306635b70f37029dca938444e6013f08684Steve Naroff * by {@link Intent#filterEquals(Intent) Intent.filterEquals} returning 33444084c306635b70f37029dca938444e6013f08684Steve Naroff * true for the intents of the two broadcasts. When a match is found, 33454084c306635b70f37029dca938444e6013f08684Steve Naroff * the new broadcast (and receivers associated with it) will replace the 33464084c306635b70f37029dca938444e6013f08684Steve Naroff * existing one in the pending broadcast list, remaining at the same 33474084c306635b70f37029dca938444e6013f08684Steve Naroff * position in the list. 33484084c306635b70f37029dca938444e6013f08684Steve Naroff * 33494084c306635b70f37029dca938444e6013f08684Steve Naroff * <p>This flag is most typically used with sticky broadcasts, which 33504084c306635b70f37029dca938444e6013f08684Steve Naroff * only care about delivering the most recent values of the broadcast 33514084c306635b70f37029dca938444e6013f08684Steve Naroff * to their receivers. 33524084c306635b70f37029dca938444e6013f08684Steve Naroff */ 33534084c306635b70f37029dca938444e6013f08684Steve Naroff public static final int FLAG_RECEIVER_REPLACE_PENDING = 0x20000000; 33544084c306635b70f37029dca938444e6013f08684Steve Naroff /** 33554084c306635b70f37029dca938444e6013f08684Steve Naroff * If set, when sending a broadcast the recipient is allowed to run at 33564084c306635b70f37029dca938444e6013f08684Steve Naroff * foreground priority, with a shorter timeout interval. During normal 33574084c306635b70f37029dca938444e6013f08684Steve Naroff * broadcasts the receivers are not automatically hoisted out of the 33584084c306635b70f37029dca938444e6013f08684Steve Naroff * background priority class. 33594084c306635b70f37029dca938444e6013f08684Steve Naroff */ 33604084c306635b70f37029dca938444e6013f08684Steve Naroff public static final int FLAG_RECEIVER_FOREGROUND = 0x10000000; 33614084c306635b70f37029dca938444e6013f08684Steve Naroff /** 33624084c306635b70f37029dca938444e6013f08684Steve Naroff * If set, when sending a broadcast <i>before boot has completed</i> only 33634084c306635b70f37029dca938444e6013f08684Steve Naroff * registered receivers will be called -- no BroadcastReceiver components 33644084c306635b70f37029dca938444e6013f08684Steve Naroff * will be launched. Sticky intent state will be recorded properly even 33654084c306635b70f37029dca938444e6013f08684Steve Naroff * if no receivers wind up being called. If {@link #FLAG_RECEIVER_REGISTERED_ONLY} 33664084c306635b70f37029dca938444e6013f08684Steve Naroff * is specified in the broadcast intent, this flag is unnecessary. 33674084c306635b70f37029dca938444e6013f08684Steve Naroff * 33684084c306635b70f37029dca938444e6013f08684Steve Naroff * <p>This flag is only for use by system sevices as a convenience to 33694084c306635b70f37029dca938444e6013f08684Steve Naroff * avoid having to implement a more complex mechanism around detection 33704084c306635b70f37029dca938444e6013f08684Steve Naroff * of boot completion. 337114108da7f7fc059772711e4ffee1322a27b152a7Steve Naroff * 337214108da7f7fc059772711e4ffee1322a27b152a7Steve Naroff * @hide 33733d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman */ 33743d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman public static final int FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT = 0x08000000; 33756ac46a4a521366d7ab36ebe2ce4e624ab96b06f9Chris Lattner /** 33766ac46a4a521366d7ab36ebe2ce4e624ab96b06f9Chris Lattner * Set when this broadcast is for a boot upgrade, a special mode that 33776ac46a4a521366d7ab36ebe2ce4e624ab96b06f9Chris Lattner * allows the broadcast to be sent before the system is ready and launches 33786ac46a4a521366d7ab36ebe2ce4e624ab96b06f9Chris Lattner * the app process with no providers running in it. 33796ac46a4a521366d7ab36ebe2ce4e624ab96b06f9Chris Lattner * @hide 33806ac46a4a521366d7ab36ebe2ce4e624ab96b06f9Chris Lattner */ 33816ac46a4a521366d7ab36ebe2ce4e624ab96b06f9Chris Lattner public static final int FLAG_RECEIVER_BOOT_UPGRADE = 0x04000000; 3382c15cb2af27514ecc879daba9aa01389c5203685dSteve Naroff 33836ac46a4a521366d7ab36ebe2ce4e624ab96b06f9Chris Lattner /** 33846ac46a4a521366d7ab36ebe2ce4e624ab96b06f9Chris Lattner * @hide Flags that can't be changed with PendingIntent. 33856ac46a4a521366d7ab36ebe2ce4e624ab96b06f9Chris Lattner */ 33866ac46a4a521366d7ab36ebe2ce4e624ab96b06f9Chris Lattner public static final int IMMUTABLE_FLAGS = 3387c15cb2af27514ecc879daba9aa01389c5203685dSteve Naroff FLAG_GRANT_READ_URI_PERMISSION 33886ac46a4a521366d7ab36ebe2ce4e624ab96b06f9Chris Lattner | FLAG_GRANT_WRITE_URI_PERMISSION; 33896ac46a4a521366d7ab36ebe2ce4e624ab96b06f9Chris Lattner 3390c15cb2af27514ecc879daba9aa01389c5203685dSteve Naroff // --------------------------------------------------------------------- 3391c15cb2af27514ecc879daba9aa01389c5203685dSteve Naroff // --------------------------------------------------------------------- 339291b0b0cf6b537cbcbca0038c7032f87161a41d31Steve Naroff // toUri() and parseUri() options. 339391b0b0cf6b537cbcbca0038c7032f87161a41d31Steve Naroff 339491b0b0cf6b537cbcbca0038c7032f87161a41d31Steve Naroff /** 339591b0b0cf6b537cbcbca0038c7032f87161a41d31Steve Naroff * Flag for use with {@link #toUri} and {@link #parseUri}: the URI string 339691b0b0cf6b537cbcbca0038c7032f87161a41d31Steve Naroff * always has the "intent:" scheme. This syntax can be used when you want 3397c15cb2af27514ecc879daba9aa01389c5203685dSteve Naroff * to later disambiguate between URIs that are intended to describe an 33984084c306635b70f37029dca938444e6013f08684Steve Naroff * Intent vs. all others that should be treated as raw URIs. When used 33998f16756441450ed9fb39316e47d107fc2a1ef35bSteve Naroff * with {@link #parseUri}, any other scheme will result in a generic 34008f16756441450ed9fb39316e47d107fc2a1ef35bSteve Naroff * VIEW action for that raw URI. 340191b0b0cf6b537cbcbca0038c7032f87161a41d31Steve Naroff */ 34028f16756441450ed9fb39316e47d107fc2a1ef35bSteve Naroff public static final int URI_INTENT_SCHEME = 1<<0; 34038f16756441450ed9fb39316e47d107fc2a1ef35bSteve Naroff 340491b0b0cf6b537cbcbca0038c7032f87161a41d31Steve Naroff // --------------------------------------------------------------------- 340591b0b0cf6b537cbcbca0038c7032f87161a41d31Steve Naroff 340691b0b0cf6b537cbcbca0038c7032f87161a41d31Steve Naroff private String mAction; 340791b0b0cf6b537cbcbca0038c7032f87161a41d31Steve Naroff private Uri mData; 340891b0b0cf6b537cbcbca0038c7032f87161a41d31Steve Naroff private String mType; 340991b0b0cf6b537cbcbca0038c7032f87161a41d31Steve Naroff private String mPackage; 341091b0b0cf6b537cbcbca0038c7032f87161a41d31Steve Naroff private ComponentName mComponent; 34116ac46a4a521366d7ab36ebe2ce4e624ab96b06f9Chris Lattner private int mFlags; 34126ac46a4a521366d7ab36ebe2ce4e624ab96b06f9Chris Lattner private HashSet<String> mCategories; 3413389bf46ae41241a656ed71b00ac2177d7f385651Steve Naroff private Bundle mExtras; 3414389bf46ae41241a656ed71b00ac2177d7f385651Steve Naroff private Rect mSourceBounds; 341514108da7f7fc059772711e4ffee1322a27b152a7Steve Naroff private Intent mSelector; 341614108da7f7fc059772711e4ffee1322a27b152a7Steve Naroff private ClipData mClipData; 3417389bf46ae41241a656ed71b00ac2177d7f385651Steve Naroff 341814108da7f7fc059772711e4ffee1322a27b152a7Steve Naroff // --------------------------------------------------------------------- 3419389bf46ae41241a656ed71b00ac2177d7f385651Steve Naroff 342014108da7f7fc059772711e4ffee1322a27b152a7Steve Naroff /** 342114108da7f7fc059772711e4ffee1322a27b152a7Steve Naroff * Create an empty intent. 342214108da7f7fc059772711e4ffee1322a27b152a7Steve Naroff */ 3423389bf46ae41241a656ed71b00ac2177d7f385651Steve Naroff public Intent() { 3424389bf46ae41241a656ed71b00ac2177d7f385651Steve Naroff } 3425ec0550fa3653d46560bf4484a2e988329c228e39Steve Naroff 3426ec0550fa3653d46560bf4484a2e988329c228e39Steve Naroff /** 3427ec0550fa3653d46560bf4484a2e988329c228e39Steve Naroff * Copy constructor. 3428ec0550fa3653d46560bf4484a2e988329c228e39Steve Naroff */ 34293d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman public Intent(Intent o) { 34303d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman this.mAction = o.mAction; 34313d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman this.mData = o.mData; 34323d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman this.mType = o.mType; 34333d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman this.mPackage = o.mPackage; 34343d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman this.mComponent = o.mComponent; 34353d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman this.mFlags = o.mFlags; 343672564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor if (o.mCategories != null) { 343772564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor this.mCategories = new HashSet<String>(o.mCategories); 34383d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman } 34393d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman if (o.mExtras != null) { 34403d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman this.mExtras = new Bundle(o.mExtras); 34413d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman } 34423d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman if (o.mSourceBounds != null) { 34433d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman this.mSourceBounds = new Rect(o.mSourceBounds); 344461710854be2b098428aff5316e64bd34b30fbcb7Chris Lattner } 344561710854be2b098428aff5316e64bd34b30fbcb7Chris Lattner if (o.mSelector != null) { 344661710854be2b098428aff5316e64bd34b30fbcb7Chris Lattner this.mSelector = new Intent(o.mSelector); 344761710854be2b098428aff5316e64bd34b30fbcb7Chris Lattner } 34486dcbc294f9b2c45680dd3227e885712c2814ec0eMike Stump if (o.mClipData != null) { 34492455636163fdd18581d7fdae816433f886d88213Mike Stump this.mClipData = new ClipData(o.mClipData); 34502455636163fdd18581d7fdae816433f886d88213Mike Stump } 34512455636163fdd18581d7fdae816433f886d88213Mike Stump } 34522455636163fdd18581d7fdae816433f886d88213Mike Stump 34532455636163fdd18581d7fdae816433f886d88213Mike Stump @Override 34542455636163fdd18581d7fdae816433f886d88213Mike Stump public Object clone() { 34553d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman return new Intent(this); 3456465226e23a3008bd68973513dda1f9e3cd27dbddSebastian Redl } 3457465226e23a3008bd68973513dda1f9e3cd27dbddSebastian Redl 34583d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman private Intent(Intent o, boolean all) { 34593d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman this.mAction = o.mAction; 34603d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman this.mData = o.mData; 34613d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman this.mType = o.mType; 34623d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman this.mPackage = o.mPackage; 34633d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman this.mComponent = o.mComponent; 34643d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman if (o.mCategories != null) { 34653d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman this.mCategories = new HashSet<String>(o.mCategories); 34663d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman } 34673d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman } 34683d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman 34697fb5e4888221cd36652d078c6b171ac55e7f406dArgyrios Kyrtzidis /** 34707fb5e4888221cd36652d078c6b171ac55e7f406dArgyrios Kyrtzidis * Make a clone of only the parts of the Intent that are relevant for 34717fb5e4888221cd36652d078c6b171ac55e7f406dArgyrios Kyrtzidis * filter matching: the action, data, type, component, and categories. 34723d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman */ 34733d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman public Intent cloneFilter() { 34743d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman return new Intent(this, false); 34753d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman } 34763d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman 34773d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman /** 34783d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman * Create an intent with a given action. All other fields (data, type, 34793d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman * class) are null. Note that the action <em>must</em> be in a 348061710854be2b098428aff5316e64bd34b30fbcb7Chris Lattner * namespace because Intents are used globally in the system -- for 348161710854be2b098428aff5316e64bd34b30fbcb7Chris Lattner * example the system VIEW action is android.intent.action.VIEW; an 348261710854be2b098428aff5316e64bd34b30fbcb7Chris Lattner * application's custom action would be something like 348361710854be2b098428aff5316e64bd34b30fbcb7Chris Lattner * com.google.app.myapp.CUSTOM_ACTION. 34843d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman * 34853d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman * @param action The Intent action, such as ACTION_VIEW. 34863d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman */ 34873d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman public Intent(String action) { 34882455636163fdd18581d7fdae816433f886d88213Mike Stump setAction(action); 34892455636163fdd18581d7fdae816433f886d88213Mike Stump } 34903d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman 34913d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman /** 34923d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman * Create an intent with a given action and for a given data url. Note 34933d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman * that the action <em>must</em> be in a namespace because Intents are 34943d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman * used globally in the system -- for example the system VIEW action is 349572564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor * android.intent.action.VIEW; an application's custom action would be 34963d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman * something like com.google.app.myapp.CUSTOM_ACTION. 3497465226e23a3008bd68973513dda1f9e3cd27dbddSebastian Redl * 34983d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman * <p><em>Note: scheme and host name matching in the Android framework is 34993d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman * case-sensitive, unlike the formal RFC. As a result, 35003d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman * you should always ensure that you write your Uri with these elements 35013d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman * using lower case letters, and normalize any Uris you receive from 35023d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman * outside of Android to ensure the scheme and host is lower case.</em></p> 35033d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman * 35043d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman * @param action The Intent action, such as ACTION_VIEW. 35053d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman * @param uri The Intent data URI. 35063d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman */ 35073d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman public Intent(String action, Uri uri) { 35083d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman setAction(action); 35093d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman mData = uri; 35103d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman } 35113d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman 35123d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman /** 35133d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman * Create an intent for a specific component. All other fields (action, data, 35143d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman * type, class) are null, though they can be modified later with explicit 35152d3c191e1d5545e1724ee6e0550c70eef54beff2Mike Stump * calls. This provides a convenient way to create an intent that is 35162d3c191e1d5545e1724ee6e0550c70eef54beff2Mike Stump * intended to execute a hard-coded class name, rather than relying on the 35173d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman * system to find an appropriate class for you; see {@link #setComponent} 35183d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman * for more information on the repercussions of this. 35193d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman * 35203d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman * @param packageContext A Context of the application package implementing 35212455636163fdd18581d7fdae816433f886d88213Mike Stump * this class. 35223d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman * @param cls The component class that is to be used for the intent. 35233d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman * 35243d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman * @see #setClass 352543d69750e7f7b26076e7474dec8839bb777b260fBill Wendling * @see #setComponent 352643d69750e7f7b26076e7474dec8839bb777b260fBill Wendling * @see #Intent(String, android.net.Uri , Context, Class) 352743d69750e7f7b26076e7474dec8839bb777b260fBill Wendling */ 35287c80bd64032e610c0dbd74fc0ef6ea334447f2fdSebastian Redl public Intent(Context packageContext, Class<?> cls) { 35297c80bd64032e610c0dbd74fc0ef6ea334447f2fdSebastian Redl mComponent = new ComponentName(packageContext, cls); 35303d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman } 35313d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman 35327c80bd64032e610c0dbd74fc0ef6ea334447f2fdSebastian Redl /** 35337c80bd64032e610c0dbd74fc0ef6ea334447f2fdSebastian Redl * Create an intent for a specific component with a specified action and data. 353435366a67baa970c287c714c957cf78a4131cf60dTed Kremenek * This is equivalent using {@link #Intent(String, android.net.Uri)} to 3535c4e405996217f4be20f73186da53b23b5c4783dcChris Lattner * construct the Intent and then calling {@link #setClass} to set its 353635366a67baa970c287c714c957cf78a4131cf60dTed Kremenek * class. 3537c4e405996217f4be20f73186da53b23b5c4783dcChris Lattner * 35383d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman * <p><em>Note: scheme and host name matching in the Android framework is 35393d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman * case-sensitive, unlike the formal RFC. As a result, 35403d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman * you should always ensure that you write your Uri with these elements 35413d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman * using lower case letters, and normalize any Uris you receive from 3542f3692dc4a47dc48d10cec0415c6e9e39b7a39707Chris Lattner * outside of Android to ensure the scheme and host is lower case.</em></p> 35433d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman * 35443d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman * @param action The Intent action, such as ACTION_VIEW. 35453d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman * @param uri The Intent data URI. 35463d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman * @param packageContext A Context of the application package implementing 35475a61f0e5c5aaecd5713c3fa4b78be7167a7eeff2Eli Friedman * this class. 35485a61f0e5c5aaecd5713c3fa4b78be7167a7eeff2Eli Friedman * @param cls The component class that is to be used for the intent. 35495a61f0e5c5aaecd5713c3fa4b78be7167a7eeff2Eli Friedman * 35503d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman * @see #Intent(String, android.net.Uri) 35513d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman * @see #Intent(Context, Class) 3552852d63b806c5cbd730c6b9d696e2e27d02546b49Eli Friedman * @see #setClass 3553852d63b806c5cbd730c6b9d696e2e27d02546b49Eli Friedman * @see #setComponent 3554f3692dc4a47dc48d10cec0415c6e9e39b7a39707Chris Lattner */ 35551adb88370beab45af2f065afe86b51ccd59ec50dChris Lattner public Intent(String action, Uri uri, 35561adb88370beab45af2f065afe86b51ccd59ec50dChris Lattner Context packageContext, Class<?> cls) { 35571adb88370beab45af2f065afe86b51ccd59ec50dChris Lattner setAction(action); 35581adb88370beab45af2f065afe86b51ccd59ec50dChris Lattner mData = uri; 35594c721d381fb279899337d120edd4a24d405e56b2Eli Friedman mComponent = new ComponentName(packageContext, cls); 356007d258756dc856c6987c394a0972884e6ed46765Eli Friedman } 356107d258756dc856c6987c394a0972884e6ed46765Eli Friedman 3562585f7b2f5c818d7579cffc91590bdc9e3d8b645dFariborz Jahanian /** 356307d258756dc856c6987c394a0972884e6ed46765Eli Friedman * Create an intent to launch the main (root) activity of a task. This 356407d258756dc856c6987c394a0972884e6ed46765Eli Friedman * is the Intent that is started when the application's is launched from 356586f4385536a0b2202860ad4e20d84f9330b1a4f4Fariborz Jahanian * Home. For anything else that wants to launch an application in the 35668df7a28269a1c0f4444928d0baea402b410e95f1Fariborz Jahanian * same way, it is important that they use an Intent structured the same 356786f4385536a0b2202860ad4e20d84f9330b1a4f4Fariborz Jahanian * way, and can use this function to ensure this is the case. 356886f4385536a0b2202860ad4e20d84f9330b1a4f4Fariborz Jahanian * 356986f4385536a0b2202860ad4e20d84f9330b1a4f4Fariborz Jahanian * <p>The returned Intent has the given Activity component as its explicit 357086f4385536a0b2202860ad4e20d84f9330b1a4f4Fariborz Jahanian * component, {@link #ACTION_MAIN} as its action, and includes the 357186f4385536a0b2202860ad4e20d84f9330b1a4f4Fariborz Jahanian * category {@link #CATEGORY_LAUNCHER}. This does <em>not</em> have 357214108da7f7fc059772711e4ffee1322a27b152a7Steve Naroff * {@link #FLAG_ACTIVITY_NEW_TASK} set, though typically you will want 35738df7a28269a1c0f4444928d0baea402b410e95f1Fariborz Jahanian * to do that through {@link #addFlags(int)} on the returned Intent. 35748df7a28269a1c0f4444928d0baea402b410e95f1Fariborz Jahanian * 357507d258756dc856c6987c394a0972884e6ed46765Eli Friedman * @param mainActivity The main activity component that this Intent will 357607d258756dc856c6987c394a0972884e6ed46765Eli Friedman * launch. 357707d258756dc856c6987c394a0972884e6ed46765Eli Friedman * @return Returns a newly created Intent that can be used to launch the 35788df7a28269a1c0f4444928d0baea402b410e95f1Fariborz Jahanian * activity as a main application entry. 35798df7a28269a1c0f4444928d0baea402b410e95f1Fariborz Jahanian * 35808df7a28269a1c0f4444928d0baea402b410e95f1Fariborz Jahanian * @see #setClass 35818df7a28269a1c0f4444928d0baea402b410e95f1Fariborz Jahanian * @see #setComponent 35828df7a28269a1c0f4444928d0baea402b410e95f1Fariborz Jahanian */ 35838df7a28269a1c0f4444928d0baea402b410e95f1Fariborz Jahanian public static Intent makeMainActivity(ComponentName mainActivity) { 358407d258756dc856c6987c394a0972884e6ed46765Eli Friedman Intent intent = new Intent(ACTION_MAIN); 358507d258756dc856c6987c394a0972884e6ed46765Eli Friedman intent.setComponent(mainActivity); 3586585f7b2f5c818d7579cffc91590bdc9e3d8b645dFariborz Jahanian intent.addCategory(CATEGORY_LAUNCHER); 3587585f7b2f5c818d7579cffc91590bdc9e3d8b645dFariborz Jahanian return intent; 358807d258756dc856c6987c394a0972884e6ed46765Eli Friedman } 358907d258756dc856c6987c394a0972884e6ed46765Eli Friedman 35908df7a28269a1c0f4444928d0baea402b410e95f1Fariborz Jahanian /** 35918df7a28269a1c0f4444928d0baea402b410e95f1Fariborz Jahanian * Make an Intent for the main activity of an application, without 359286f4385536a0b2202860ad4e20d84f9330b1a4f4Fariborz Jahanian * specifying a specific activity to run but giving a selector to find 359386f4385536a0b2202860ad4e20d84f9330b1a4f4Fariborz Jahanian * the activity. This results in a final Intent that is structured 359486f4385536a0b2202860ad4e20d84f9330b1a4f4Fariborz Jahanian * the same as when the application is launched from 359586f4385536a0b2202860ad4e20d84f9330b1a4f4Fariborz Jahanian * Home. For anything else that wants to launch an application in the 359686f4385536a0b2202860ad4e20d84f9330b1a4f4Fariborz Jahanian * same way, it is important that they use an Intent structured the same 359714108da7f7fc059772711e4ffee1322a27b152a7Steve Naroff * way, and can use this function to ensure this is the case. 35988df7a28269a1c0f4444928d0baea402b410e95f1Fariborz Jahanian * 359986f4385536a0b2202860ad4e20d84f9330b1a4f4Fariborz Jahanian * <p>The returned Intent has {@link #ACTION_MAIN} as its action, and includes the 360007d258756dc856c6987c394a0972884e6ed46765Eli Friedman * category {@link #CATEGORY_LAUNCHER}. This does <em>not</em> have 360107d258756dc856c6987c394a0972884e6ed46765Eli Friedman * {@link #FLAG_ACTIVITY_NEW_TASK} set, though typically you will want 360207d258756dc856c6987c394a0972884e6ed46765Eli Friedman * to do that through {@link #addFlags(int)} on the returned Intent. 36038df7a28269a1c0f4444928d0baea402b410e95f1Fariborz Jahanian * 36048df7a28269a1c0f4444928d0baea402b410e95f1Fariborz Jahanian * @param selectorAction The action name of the Intent's selector. 36058df7a28269a1c0f4444928d0baea402b410e95f1Fariborz Jahanian * @param selectorCategory The name of a category to add to the Intent's 36068df7a28269a1c0f4444928d0baea402b410e95f1Fariborz Jahanian * selector. 36078df7a28269a1c0f4444928d0baea402b410e95f1Fariborz Jahanian * @return Returns a newly created Intent that can be used to launch the 36088df7a28269a1c0f4444928d0baea402b410e95f1Fariborz Jahanian * activity as a main application entry. 3609354e53da656237e25518b3fafa3bf84de6e6f57eEli Friedman * 361007d258756dc856c6987c394a0972884e6ed46765Eli Friedman * @see #setSelector(Intent) 3611585f7b2f5c818d7579cffc91590bdc9e3d8b645dFariborz Jahanian */ 3612585f7b2f5c818d7579cffc91590bdc9e3d8b645dFariborz Jahanian public static Intent makeMainSelectorActivity(String selectorAction, 36134c721d381fb279899337d120edd4a24d405e56b2Eli Friedman String selectorCategory) { 3614a36a61f218b9f7a97f2c0f511e0b29eb42e8f78bChris Lattner Intent intent = new Intent(ACTION_MAIN); 3615a36a61f218b9f7a97f2c0f511e0b29eb42e8f78bChris Lattner intent.addCategory(CATEGORY_LAUNCHER); 3616a36a61f218b9f7a97f2c0f511e0b29eb42e8f78bChris Lattner Intent selector = new Intent(); 3617a36a61f218b9f7a97f2c0f511e0b29eb42e8f78bChris Lattner selector.setAction(selectorAction); 3618a36a61f218b9f7a97f2c0f511e0b29eb42e8f78bChris Lattner selector.addCategory(selectorCategory); 3619213541a68a3e137d11d2cefb612c6cdb410d7e8eNate Begeman intent.setSelector(selector); 3620213541a68a3e137d11d2cefb612c6cdb410d7e8eNate Begeman return intent; 3621213541a68a3e137d11d2cefb612c6cdb410d7e8eNate Begeman } 3622ec0550fa3653d46560bf4484a2e988329c228e39Steve Naroff 36234e78fd0a960eaa7e97467f2e8f390f3a57da279bSteve Naroff /** 36244e78fd0a960eaa7e97467f2e8f390f3a57da279bSteve Naroff * Make an Intent that can be used to re-launch an application's task 36251adb88370beab45af2f065afe86b51ccd59ec50dChris Lattner * in its base state. This is like {@link #makeMainActivity(ComponentName)}, 36261adb88370beab45af2f065afe86b51ccd59ec50dChris Lattner * but also sets the flags {@link #FLAG_ACTIVITY_NEW_TASK} and 36273d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman * {@link #FLAG_ACTIVITY_CLEAR_TASK}. 36283d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman * 36293d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman * @param mainActivity The activity component that is the root of the 3630bab96968886f4b77083f4e26a28986ddb1e42d67Eli Friedman * task; this is the activity that has been published in the application's 36313d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman * manifest as the main launcher icon. 36323d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman * 36333d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman * @return Returns a newly created Intent that can be used to relaunch the 3634bab96968886f4b77083f4e26a28986ddb1e42d67Eli Friedman * activity's task in its root state. 36351adb88370beab45af2f065afe86b51ccd59ec50dChris Lattner */ 36363d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman public static Intent makeRestartActivityTask(ComponentName mainActivity) { 3637ec0550fa3653d46560bf4484a2e988329c228e39Steve Naroff Intent intent = makeMainActivity(mainActivity); 36383d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK 36394a74678ed6c3dedac05d02b1ee341f1db869f049Steve Naroff | Intent.FLAG_ACTIVITY_CLEAR_TASK); 36401adb88370beab45af2f065afe86b51ccd59ec50dChris Lattner return intent; 364172564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor } 364272564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor 364372564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor /** 364472564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor * Call {@link #parseUri} with 0 flags. 364572564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor * @deprecated Use {@link #parseUri} instead. 364672564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor */ 364772564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor @Deprecated 364872564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor public static Intent getIntent(String uri) throws URISyntaxException { 36497c80bd64032e610c0dbd74fc0ef6ea334447f2fdSebastian Redl return parseUri(uri, 0); 36507c80bd64032e610c0dbd74fc0ef6ea334447f2fdSebastian Redl } 365172564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor 365272564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor /** 365372564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor * Create an intent from a URI. This URI may encode the action, 365472564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor * category, and other intent fields, if it was returned by 365572564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor * {@link #toUri}. If the Intent was not generate by toUri(), its data 365672564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor * will be the entire URI and its action will be ACTION_VIEW. 365772564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor * 365872564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor * <p>The URI given here must not be relative -- that is, it must include 365972564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor * the scheme and full path. 366072564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor * 366172564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor * @param uri The URI to turn into an Intent. 36621adb88370beab45af2f065afe86b51ccd59ec50dChris Lattner * @param flags Additional processing flags. Either 0 or 36633d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman * {@link #URI_INTENT_SCHEME}. 36643d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman * 366535366a67baa970c287c714c957cf78a4131cf60dTed Kremenek * @return Intent The newly created Intent object. 366635366a67baa970c287c714c957cf78a4131cf60dTed Kremenek * 36673d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman * @throws URISyntaxException Throws URISyntaxError if the basic URI syntax 36683d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman * it bad (as parsed by the Uri class) or the Intent data within the 366907d258756dc856c6987c394a0972884e6ed46765Eli Friedman * URI is invalid. 367061710854be2b098428aff5316e64bd34b30fbcb7Chris Lattner * 367107d258756dc856c6987c394a0972884e6ed46765Eli Friedman * @see #toUri 367261710854be2b098428aff5316e64bd34b30fbcb7Chris Lattner */ 36733d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman public static Intent parseUri(String uri, int flags) throws URISyntaxException { 36743d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman int i = 0; 3675c0febd58f5cbf4a93fd12f461863564dba0af76dSteve Naroff try { 3676c0febd58f5cbf4a93fd12f461863564dba0af76dSteve Naroff // Validate intent scheme for if requested. 3677c0febd58f5cbf4a93fd12f461863564dba0af76dSteve Naroff if ((flags&URI_INTENT_SCHEME) != 0) { 367835366a67baa970c287c714c957cf78a4131cf60dTed Kremenek if (!uri.startsWith("intent:")) { 367935366a67baa970c287c714c957cf78a4131cf60dTed Kremenek Intent intent = new Intent(ACTION_VIEW); 3680c0febd58f5cbf4a93fd12f461863564dba0af76dSteve Naroff try { 3681c0febd58f5cbf4a93fd12f461863564dba0af76dSteve Naroff intent.setData(Uri.parse(uri)); 3682c0febd58f5cbf4a93fd12f461863564dba0af76dSteve Naroff } catch (IllegalArgumentException e) { 3683c0febd58f5cbf4a93fd12f461863564dba0af76dSteve Naroff throw new URISyntaxException(uri, e.getMessage()); 3684c0febd58f5cbf4a93fd12f461863564dba0af76dSteve Naroff } 3685c0febd58f5cbf4a93fd12f461863564dba0af76dSteve Naroff return intent; 3686c0febd58f5cbf4a93fd12f461863564dba0af76dSteve Naroff } 3687c0febd58f5cbf4a93fd12f461863564dba0af76dSteve Naroff } 36881adb88370beab45af2f065afe86b51ccd59ec50dChris Lattner 36893d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman // simple case 36903d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman i = uri.lastIndexOf("#"); 36913d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman if (i == -1) return new Intent(ACTION_VIEW, Uri.parse(uri)); 36923d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman 36933d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman // old format Intent URI 36943d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman if (!uri.startsWith("#Intent;", i)) return getIntentOld(uri); 36953d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman 36963d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman // new format 36973d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman Intent intent = new Intent(ACTION_VIEW); 36983d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman Intent baseIntent = intent; 369961710854be2b098428aff5316e64bd34b30fbcb7Chris Lattner 370061710854be2b098428aff5316e64bd34b30fbcb7Chris Lattner // fetch data part, if present 370161710854be2b098428aff5316e64bd34b30fbcb7Chris Lattner String data = i >= 0 ? uri.substring(0, i) : null; 370261710854be2b098428aff5316e64bd34b30fbcb7Chris Lattner String scheme = null; 37033bc0f45a5e65814f42b22dcdf7249d1120d16f36Eli Friedman i += "#Intent;".length(); 37043bc0f45a5e65814f42b22dcdf7249d1120d16f36Eli Friedman 37053bc0f45a5e65814f42b22dcdf7249d1120d16f36Eli Friedman // loop over contents of Intent, all name=value; 37063bc0f45a5e65814f42b22dcdf7249d1120d16f36Eli Friedman while (!uri.startsWith("end", i)) { 37073d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman int eq = uri.indexOf('=', i); 37083d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman if (eq < 0) eq = i-1; 370961710854be2b098428aff5316e64bd34b30fbcb7Chris Lattner int semi = uri.indexOf(';', i); 371061710854be2b098428aff5316e64bd34b30fbcb7Chris Lattner String value = eq < semi ? Uri.decode(uri.substring(eq + 1, semi)) : ""; 371161710854be2b098428aff5316e64bd34b30fbcb7Chris Lattner 371261710854be2b098428aff5316e64bd34b30fbcb7Chris Lattner // action 37133d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman if (uri.startsWith("action=", i)) { 37143d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman intent.setAction(value); 37153d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman } 37163d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman 37173d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman // categories 37183d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman else if (uri.startsWith("category=", i)) { 37193d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman intent.addCategory(value); 37203d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman } 37213d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman 37223d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman // type 37233d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman else if (uri.startsWith("type=", i)) { 37243d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman intent.mType = value; 37253bc0f45a5e65814f42b22dcdf7249d1120d16f36Eli Friedman } 37263bc0f45a5e65814f42b22dcdf7249d1120d16f36Eli Friedman 37277e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor // launch flags 37287e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor else if (uri.startsWith("launchFlags=", i)) { 37293d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman intent.mFlags = Integer.decode(value).intValue(); 37301adb88370beab45af2f065afe86b51ccd59ec50dChris Lattner } 37313d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman 373272564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor // package 373372564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor else if (uri.startsWith("package=", i)) { 37343d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman intent.mPackage = value; 37351adb88370beab45af2f065afe86b51ccd59ec50dChris Lattner } 37363cc4c0c3058a788689b8fc73c0ac139544435c97Chris Lattner 37373d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman // component 373864cfdb7da3cb744642fe8a99ad5c851ad3c930b2Daniel Dunbar else if (uri.startsWith("component=", i)) { 373964cfdb7da3cb744642fe8a99ad5c851ad3c930b2Daniel Dunbar intent.mComponent = ComponentName.unflattenFromString(value); 374064cfdb7da3cb744642fe8a99ad5c851ad3c930b2Daniel Dunbar } 37413cc4c0c3058a788689b8fc73c0ac139544435c97Chris Lattner 37425a61f0e5c5aaecd5713c3fa4b78be7167a7eeff2Eli Friedman // scheme 37433d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman else if (uri.startsWith("scheme=", i)) { 37443d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman scheme = value; 374561710854be2b098428aff5316e64bd34b30fbcb7Chris Lattner } 374661490e9a965cfee8a78c12c6802138844f04250dCedric Venet 37475fd659db11922fc12a58e478f7b745f9656b15a7Steve Naroff // source bounds 37485a61f0e5c5aaecd5713c3fa4b78be7167a7eeff2Eli Friedman else if (uri.startsWith("sourceBounds=", i)) { 37495a61f0e5c5aaecd5713c3fa4b78be7167a7eeff2Eli Friedman intent.mSourceBounds = Rect.unflattenFromString(value); 37505fd659db11922fc12a58e478f7b745f9656b15a7Steve Naroff } 37515fd659db11922fc12a58e478f7b745f9656b15a7Steve Naroff 37525fd659db11922fc12a58e478f7b745f9656b15a7Steve Naroff // selector 37535fd659db11922fc12a58e478f7b745f9656b15a7Steve Naroff else if (semi == (i+3) && uri.startsWith("SEL", i)) { 37545fd659db11922fc12a58e478f7b745f9656b15a7Steve Naroff intent = new Intent(); 37555fd659db11922fc12a58e478f7b745f9656b15a7Steve Naroff } 37563d815e7eb56c25d7ed812eced32e41df43039f9aEli Friedman 375761490e9a965cfee8a78c12c6802138844f04250dCedric Venet // extra 375814108da7f7fc059772711e4ffee1322a27b152a7Steve Naroff else { 375914108da7f7fc059772711e4ffee1322a27b152a7Steve Naroff String key = Uri.decode(uri.substring(i + 2, eq)); 376014108da7f7fc059772711e4ffee1322a27b152a7Steve Naroff // create Bundle if it doesn't already exist 376114108da7f7fc059772711e4ffee1322a27b152a7Steve Naroff if (intent.mExtras == null) intent.mExtras = new Bundle(); 376214108da7f7fc059772711e4ffee1322a27b152a7Steve Naroff Bundle b = intent.mExtras; 3763bc76dd06eb881c70c9775b74bab8b88cd747f173Steve Naroff // add EXTRA 376414108da7f7fc059772711e4ffee1322a27b152a7Steve Naroff if (uri.startsWith("S.", i)) b.putString(key, value); 37655a61f0e5c5aaecd5713c3fa4b78be7167a7eeff2Eli Friedman else if (uri.startsWith("B.", i)) b.putBoolean(key, Boolean.parseBoolean(value)); 37665a61f0e5c5aaecd5713c3fa4b78be7167a7eeff2Eli Friedman else if (uri.startsWith("b.", i)) b.putByte(key, Byte.parseByte(value)); 37675a61f0e5c5aaecd5713c3fa4b78be7167a7eeff2Eli Friedman else if (uri.startsWith("c.", i)) b.putChar(key, value.charAt(0)); 37685a61f0e5c5aaecd5713c3fa4b78be7167a7eeff2Eli Friedman else if (uri.startsWith("d.", i)) b.putDouble(key, Double.parseDouble(value)); 37695a61f0e5c5aaecd5713c3fa4b78be7167a7eeff2Eli Friedman else if (uri.startsWith("f.", i)) b.putFloat(key, Float.parseFloat(value)); 37705a61f0e5c5aaecd5713c3fa4b78be7167a7eeff2Eli Friedman else if (uri.startsWith("i.", i)) b.putInt(key, Integer.parseInt(value)); 37715a61f0e5c5aaecd5713c3fa4b78be7167a7eeff2Eli Friedman else if (uri.startsWith("l.", i)) b.putLong(key, Long.parseLong(value)); 37725a61f0e5c5aaecd5713c3fa4b78be7167a7eeff2Eli Friedman else if (uri.startsWith("s.", i)) b.putShort(key, Short.parseShort(value)); 37735a61f0e5c5aaecd5713c3fa4b78be7167a7eeff2Eli Friedman else throw new URISyntaxException(uri, "unknown EXTRA type", i); 37745a61f0e5c5aaecd5713c3fa4b78be7167a7eeff2Eli Friedman } 37755a61f0e5c5aaecd5713c3fa4b78be7167a7eeff2Eli Friedman 37765a61f0e5c5aaecd5713c3fa4b78be7167a7eeff2Eli Friedman // move to the next item 37775a61f0e5c5aaecd5713c3fa4b78be7167a7eeff2Eli Friedman i = semi + 1; 37785a61f0e5c5aaecd5713c3fa4b78be7167a7eeff2Eli Friedman } 37795a61f0e5c5aaecd5713c3fa4b78be7167a7eeff2Eli Friedman 37805a61f0e5c5aaecd5713c3fa4b78be7167a7eeff2Eli Friedman if (intent != baseIntent) { 37815a61f0e5c5aaecd5713c3fa4b78be7167a7eeff2Eli Friedman // The Intent had a selector; fix it up. 37825a61f0e5c5aaecd5713c3fa4b78be7167a7eeff2Eli Friedman baseIntent.setSelector(intent); 37835a61f0e5c5aaecd5713c3fa4b78be7167a7eeff2Eli Friedman intent = baseIntent; 37845a61f0e5c5aaecd5713c3fa4b78be7167a7eeff2Eli Friedman } 37855a61f0e5c5aaecd5713c3fa4b78be7167a7eeff2Eli Friedman 37865a61f0e5c5aaecd5713c3fa4b78be7167a7eeff2Eli Friedman if (data != null) { 37875a61f0e5c5aaecd5713c3fa4b78be7167a7eeff2Eli Friedman if (data.startsWith("intent:")) { 37885a61f0e5c5aaecd5713c3fa4b78be7167a7eeff2Eli Friedman data = data.substring(7); 37895a61f0e5c5aaecd5713c3fa4b78be7167a7eeff2Eli Friedman if (scheme != null) { 37905a61f0e5c5aaecd5713c3fa4b78be7167a7eeff2Eli Friedman data = scheme + ':' + data; 37915a61f0e5c5aaecd5713c3fa4b78be7167a7eeff2Eli Friedman } 37925a61f0e5c5aaecd5713c3fa4b78be7167a7eeff2Eli Friedman } 37935a61f0e5c5aaecd5713c3fa4b78be7167a7eeff2Eli Friedman 37945a61f0e5c5aaecd5713c3fa4b78be7167a7eeff2Eli Friedman if (data.length() > 0) { 37957532dc66648cfe7432c9fe66dec5225f0ab301c6Douglas Gregor try { 37967532dc66648cfe7432c9fe66dec5225f0ab301c6Douglas Gregor intent.mData = Uri.parse(data); 37977532dc66648cfe7432c9fe66dec5225f0ab301c6Douglas Gregor } catch (IllegalArgumentException e) { 37987532dc66648cfe7432c9fe66dec5225f0ab301c6Douglas Gregor throw new URISyntaxException(uri, e.getMessage()); 3799ec0550fa3653d46560bf4484a2e988329c228e39Steve Naroff } 380072564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor } 380172564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor } 3802ec0550fa3653d46560bf4484a2e988329c228e39Steve Naroff 38037192f8e9592729882a09d84d77838db26e39ebd4Ted Kremenek return intent; 38045426bf6456a5aeac416a9150de157904d101c819Chris Lattner 3805ad74a758189180b8ab8faea648e4766c3bfd7fcbEli Friedman } catch (IndexOutOfBoundsException e) { 3806ad74a758189180b8ab8faea648e4766c3bfd7fcbEli Friedman throw new URISyntaxException(uri, "illegal Intent URI format", i); 380788054dee0402e4d3c1f64e6b697acc47195c0d72Chris Lattner } 3808ad74a758189180b8ab8faea648e4766c3bfd7fcbEli Friedman } 3809ad74a758189180b8ab8faea648e4766c3bfd7fcbEli Friedman 3810ad74a758189180b8ab8faea648e4766c3bfd7fcbEli Friedman public static Intent getIntentOld(String uri) throws URISyntaxException { 3811f98aba35e6c3da5aae61843fc01334939e4e12ecEli Friedman Intent intent; 3812f98aba35e6c3da5aae61843fc01334939e4e12ecEli Friedman 3813f98aba35e6c3da5aae61843fc01334939e4e12ecEli Friedman int i = uri.lastIndexOf('#'); 3814f98aba35e6c3da5aae61843fc01334939e4e12ecEli Friedman if (i >= 0) { 3815ad74a758189180b8ab8faea648e4766c3bfd7fcbEli Friedman String action = null; 3816ad74a758189180b8ab8faea648e4766c3bfd7fcbEli Friedman final int intentFragmentStart = i; 3817ad74a758189180b8ab8faea648e4766c3bfd7fcbEli Friedman boolean isIntentFragment = false; 3818ad74a758189180b8ab8faea648e4766c3bfd7fcbEli Friedman 3819ad74a758189180b8ab8faea648e4766c3bfd7fcbEli Friedman i++; 3820ad74a758189180b8ab8faea648e4766c3bfd7fcbEli Friedman 3821ad74a758189180b8ab8faea648e4766c3bfd7fcbEli Friedman if (uri.regionMatches(i, "action(", 0, 7)) { 3822ad74a758189180b8ab8faea648e4766c3bfd7fcbEli Friedman isIntentFragment = true; 3823ad74a758189180b8ab8faea648e4766c3bfd7fcbEli Friedman i += 7; 3824ad74a758189180b8ab8faea648e4766c3bfd7fcbEli Friedman int j = uri.indexOf(')', i); 3825ad74a758189180b8ab8faea648e4766c3bfd7fcbEli Friedman action = uri.substring(i, j); 3826ad74a758189180b8ab8faea648e4766c3bfd7fcbEli Friedman i = j + 1; 3827ad74a758189180b8ab8faea648e4766c3bfd7fcbEli Friedman } 3828ad74a758189180b8ab8faea648e4766c3bfd7fcbEli Friedman 3829ad74a758189180b8ab8faea648e4766c3bfd7fcbEli Friedman intent = new Intent(action); 3830ad74a758189180b8ab8faea648e4766c3bfd7fcbEli Friedman 3831ad74a758189180b8ab8faea648e4766c3bfd7fcbEli Friedman if (uri.regionMatches(i, "categories(", 0, 11)) { 3832ad74a758189180b8ab8faea648e4766c3bfd7fcbEli Friedman isIntentFragment = true; 3833ad74a758189180b8ab8faea648e4766c3bfd7fcbEli Friedman i += 11; 3834ad74a758189180b8ab8faea648e4766c3bfd7fcbEli Friedman int j = uri.indexOf(')', i); 3835ad74a758189180b8ab8faea648e4766c3bfd7fcbEli Friedman while (i < j) { 38362df9ced9fd1e8c7d7b38443db07e0e811de22571Chris Lattner int sep = uri.indexOf('!', i); 38372df9ced9fd1e8c7d7b38443db07e0e811de22571Chris Lattner if (sep < 0) sep = j; 3838ad74a758189180b8ab8faea648e4766c3bfd7fcbEli Friedman if (i < sep) { 3839ad74a758189180b8ab8faea648e4766c3bfd7fcbEli Friedman intent.addCategory(uri.substring(i, sep)); 3840ad74a758189180b8ab8faea648e4766c3bfd7fcbEli Friedman } 3841ad74a758189180b8ab8faea648e4766c3bfd7fcbEli Friedman i = sep + 1; 3842ad74a758189180b8ab8faea648e4766c3bfd7fcbEli Friedman } 3843ad74a758189180b8ab8faea648e4766c3bfd7fcbEli Friedman i = j + 1; 38442cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor } 38452cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor 38462cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor if (uri.regionMatches(i, "type(", 0, 5)) { 384786df27bbdbb98c39ec2184695c0561209f91beddChris Lattner isIntentFragment = true; 384886df27bbdbb98c39ec2184695c0561209f91beddChris Lattner i += 5; 384986df27bbdbb98c39ec2184695c0561209f91beddChris Lattner int j = uri.indexOf(')', i); 385086df27bbdbb98c39ec2184695c0561209f91beddChris Lattner intent.mType = uri.substring(i, j); 385186df27bbdbb98c39ec2184695c0561209f91beddChris Lattner i = j + 1; 385286df27bbdbb98c39ec2184695c0561209f91beddChris Lattner } 385386df27bbdbb98c39ec2184695c0561209f91beddChris Lattner 385486df27bbdbb98c39ec2184695c0561209f91beddChris Lattner if (uri.regionMatches(i, "launchFlags(", 0, 12)) { 385586df27bbdbb98c39ec2184695c0561209f91beddChris Lattner isIntentFragment = true; 385686df27bbdbb98c39ec2184695c0561209f91beddChris Lattner i += 12; 385786df27bbdbb98c39ec2184695c0561209f91beddChris Lattner int j = uri.indexOf(')', i); 385886df27bbdbb98c39ec2184695c0561209f91beddChris Lattner intent.mFlags = Integer.decode(uri.substring(i, j)).intValue(); 385986df27bbdbb98c39ec2184695c0561209f91beddChris Lattner i = j + 1; 386086df27bbdbb98c39ec2184695c0561209f91beddChris Lattner } 386186df27bbdbb98c39ec2184695c0561209f91beddChris Lattner 386286df27bbdbb98c39ec2184695c0561209f91beddChris Lattner if (uri.regionMatches(i, "component(", 0, 10)) { 386386df27bbdbb98c39ec2184695c0561209f91beddChris Lattner isIntentFragment = true; 386486df27bbdbb98c39ec2184695c0561209f91beddChris Lattner i += 10; 386586df27bbdbb98c39ec2184695c0561209f91beddChris Lattner int j = uri.indexOf(')', i); 386686df27bbdbb98c39ec2184695c0561209f91beddChris Lattner int sep = uri.indexOf('!', i); 386786df27bbdbb98c39ec2184695c0561209f91beddChris Lattner if (sep >= 0 && sep < j) { 386886df27bbdbb98c39ec2184695c0561209f91beddChris Lattner String pkg = uri.substring(i, sep); 386986df27bbdbb98c39ec2184695c0561209f91beddChris Lattner String cls = uri.substring(sep + 1, j); 387086df27bbdbb98c39ec2184695c0561209f91beddChris Lattner intent.mComponent = new ComponentName(pkg, cls); 387186df27bbdbb98c39ec2184695c0561209f91beddChris Lattner } 387286df27bbdbb98c39ec2184695c0561209f91beddChris Lattner i = j + 1; 387386df27bbdbb98c39ec2184695c0561209f91beddChris Lattner } 387486df27bbdbb98c39ec2184695c0561209f91beddChris Lattner 387586df27bbdbb98c39ec2184695c0561209f91beddChris Lattner if (uri.regionMatches(i, "extras(", 0, 7)) { 387686df27bbdbb98c39ec2184695c0561209f91beddChris Lattner isIntentFragment = true; 387786df27bbdbb98c39ec2184695c0561209f91beddChris Lattner i += 7; 387886df27bbdbb98c39ec2184695c0561209f91beddChris Lattner 387986df27bbdbb98c39ec2184695c0561209f91beddChris Lattner final int closeParen = uri.indexOf(')', i); 388086df27bbdbb98c39ec2184695c0561209f91beddChris Lattner if (closeParen == -1) throw new URISyntaxException(uri, 388186df27bbdbb98c39ec2184695c0561209f91beddChris Lattner "EXTRA missing trailing ')'", i); 388286df27bbdbb98c39ec2184695c0561209f91beddChris Lattner 388386df27bbdbb98c39ec2184695c0561209f91beddChris Lattner while (i < closeParen) { 388486df27bbdbb98c39ec2184695c0561209f91beddChris Lattner // fetch the key value 388586df27bbdbb98c39ec2184695c0561209f91beddChris Lattner int j = uri.indexOf('=', i); 388686df27bbdbb98c39ec2184695c0561209f91beddChris Lattner if (j <= i + 1 || i >= closeParen) { 388786df27bbdbb98c39ec2184695c0561209f91beddChris Lattner throw new URISyntaxException(uri, "EXTRA missing '='", i); 388886df27bbdbb98c39ec2184695c0561209f91beddChris Lattner } 388986df27bbdbb98c39ec2184695c0561209f91beddChris Lattner char type = uri.charAt(i); 389086df27bbdbb98c39ec2184695c0561209f91beddChris Lattner i++; 389186df27bbdbb98c39ec2184695c0561209f91beddChris Lattner String key = uri.substring(i, j); 389286df27bbdbb98c39ec2184695c0561209f91beddChris Lattner i = j + 1; 389386df27bbdbb98c39ec2184695c0561209f91beddChris Lattner 389486df27bbdbb98c39ec2184695c0561209f91beddChris Lattner // get type-value 389586df27bbdbb98c39ec2184695c0561209f91beddChris Lattner j = uri.indexOf('!', i); 389686df27bbdbb98c39ec2184695c0561209f91beddChris Lattner if (j == -1 || j >= closeParen) j = closeParen; 389786df27bbdbb98c39ec2184695c0561209f91beddChris Lattner if (i >= j) throw new URISyntaxException(uri, "EXTRA missing '!'", i); 389886df27bbdbb98c39ec2184695c0561209f91beddChris Lattner String value = uri.substring(i, j); 389986df27bbdbb98c39ec2184695c0561209f91beddChris Lattner i = j; 390086df27bbdbb98c39ec2184695c0561209f91beddChris Lattner 390186df27bbdbb98c39ec2184695c0561209f91beddChris Lattner // create Bundle if it doesn't already exist 390286df27bbdbb98c39ec2184695c0561209f91beddChris Lattner if (intent.mExtras == null) intent.mExtras = new Bundle(); 390386df27bbdbb98c39ec2184695c0561209f91beddChris Lattner 390486df27bbdbb98c39ec2184695c0561209f91beddChris Lattner // add item to bundle 390586df27bbdbb98c39ec2184695c0561209f91beddChris Lattner try { 390686df27bbdbb98c39ec2184695c0561209f91beddChris Lattner switch (type) { 390786df27bbdbb98c39ec2184695c0561209f91beddChris Lattner case 'S': 390886df27bbdbb98c39ec2184695c0561209f91beddChris Lattner intent.mExtras.putString(key, Uri.decode(value)); 390986df27bbdbb98c39ec2184695c0561209f91beddChris Lattner break; 391086df27bbdbb98c39ec2184695c0561209f91beddChris Lattner case 'B': 391186df27bbdbb98c39ec2184695c0561209f91beddChris Lattner intent.mExtras.putBoolean(key, Boolean.parseBoolean(value)); 391286df27bbdbb98c39ec2184695c0561209f91beddChris Lattner break; 391386df27bbdbb98c39ec2184695c0561209f91beddChris Lattner case 'b': 391486df27bbdbb98c39ec2184695c0561209f91beddChris Lattner intent.mExtras.putByte(key, Byte.parseByte(value)); 391586df27bbdbb98c39ec2184695c0561209f91beddChris Lattner break; 391686df27bbdbb98c39ec2184695c0561209f91beddChris Lattner case 'c': 391786df27bbdbb98c39ec2184695c0561209f91beddChris Lattner intent.mExtras.putChar(key, Uri.decode(value).charAt(0)); 391886df27bbdbb98c39ec2184695c0561209f91beddChris Lattner break; 391986df27bbdbb98c39ec2184695c0561209f91beddChris Lattner case 'd': 392086df27bbdbb98c39ec2184695c0561209f91beddChris Lattner intent.mExtras.putDouble(key, Double.parseDouble(value)); 392186df27bbdbb98c39ec2184695c0561209f91beddChris Lattner break; 392286df27bbdbb98c39ec2184695c0561209f91beddChris Lattner case 'f': 392386df27bbdbb98c39ec2184695c0561209f91beddChris Lattner intent.mExtras.putFloat(key, Float.parseFloat(value)); 392486df27bbdbb98c39ec2184695c0561209f91beddChris Lattner break; 392586df27bbdbb98c39ec2184695c0561209f91beddChris Lattner case 'i': 392686df27bbdbb98c39ec2184695c0561209f91beddChris Lattner intent.mExtras.putInt(key, Integer.parseInt(value)); 392786df27bbdbb98c39ec2184695c0561209f91beddChris Lattner break; 392886df27bbdbb98c39ec2184695c0561209f91beddChris Lattner case 'l': 392986df27bbdbb98c39ec2184695c0561209f91beddChris Lattner intent.mExtras.putLong(key, Long.parseLong(value)); 393086df27bbdbb98c39ec2184695c0561209f91beddChris Lattner break; 393186df27bbdbb98c39ec2184695c0561209f91beddChris Lattner case 's': 393286df27bbdbb98c39ec2184695c0561209f91beddChris Lattner intent.mExtras.putShort(key, Short.parseShort(value)); 393386df27bbdbb98c39ec2184695c0561209f91beddChris Lattner break; 393486df27bbdbb98c39ec2184695c0561209f91beddChris Lattner default: 393586df27bbdbb98c39ec2184695c0561209f91beddChris Lattner throw new URISyntaxException(uri, "EXTRA has unknown type", i); 393686df27bbdbb98c39ec2184695c0561209f91beddChris Lattner } 393786df27bbdbb98c39ec2184695c0561209f91beddChris Lattner } catch (NumberFormatException e) { 393886df27bbdbb98c39ec2184695c0561209f91beddChris Lattner throw new URISyntaxException(uri, "EXTRA value can't be parsed", i); 393986df27bbdbb98c39ec2184695c0561209f91beddChris Lattner } 394086df27bbdbb98c39ec2184695c0561209f91beddChris Lattner 394186df27bbdbb98c39ec2184695c0561209f91beddChris Lattner char ch = uri.charAt(i); 394286df27bbdbb98c39ec2184695c0561209f91beddChris Lattner if (ch == ')') break; 394386df27bbdbb98c39ec2184695c0561209f91beddChris Lattner if (ch != '!') throw new URISyntaxException(uri, "EXTRA missing '!'", i); 394486df27bbdbb98c39ec2184695c0561209f91beddChris Lattner i++; 394586df27bbdbb98c39ec2184695c0561209f91beddChris Lattner } 394686df27bbdbb98c39ec2184695c0561209f91beddChris Lattner } 394786df27bbdbb98c39ec2184695c0561209f91beddChris Lattner 394886df27bbdbb98c39ec2184695c0561209f91beddChris Lattner if (isIntentFragment) { 394986df27bbdbb98c39ec2184695c0561209f91beddChris Lattner intent.mData = Uri.parse(uri.substring(0, intentFragmentStart)); 395086df27bbdbb98c39ec2184695c0561209f91beddChris Lattner } else { 395186df27bbdbb98c39ec2184695c0561209f91beddChris Lattner intent.mData = Uri.parse(uri); 395286df27bbdbb98c39ec2184695c0561209f91beddChris Lattner } 395386df27bbdbb98c39ec2184695c0561209f91beddChris Lattner 395486df27bbdbb98c39ec2184695c0561209f91beddChris Lattner if (intent.mAction == null) { 395586df27bbdbb98c39ec2184695c0561209f91beddChris Lattner // By default, if no action is specified, then use VIEW. 395686df27bbdbb98c39ec2184695c0561209f91beddChris Lattner intent.mAction = ACTION_VIEW; 395786df27bbdbb98c39ec2184695c0561209f91beddChris Lattner } 395886df27bbdbb98c39ec2184695c0561209f91beddChris Lattner 395986df27bbdbb98c39ec2184695c0561209f91beddChris Lattner } else { 396086df27bbdbb98c39ec2184695c0561209f91beddChris Lattner intent = new Intent(ACTION_VIEW, Uri.parse(uri)); 396186df27bbdbb98c39ec2184695c0561209f91beddChris Lattner } 396286df27bbdbb98c39ec2184695c0561209f91beddChris Lattner 396386df27bbdbb98c39ec2184695c0561209f91beddChris Lattner return intent; 396486df27bbdbb98c39ec2184695c0561209f91beddChris Lattner } 396586df27bbdbb98c39ec2184695c0561209f91beddChris Lattner 396686df27bbdbb98c39ec2184695c0561209f91beddChris Lattner /** 396786df27bbdbb98c39ec2184695c0561209f91beddChris Lattner * Retrieve the general action to be performed, such as 396886df27bbdbb98c39ec2184695c0561209f91beddChris Lattner * {@link #ACTION_VIEW}. The action describes the general way the rest of 396986df27bbdbb98c39ec2184695c0561209f91beddChris Lattner * the information in the intent should be interpreted -- most importantly, 397086df27bbdbb98c39ec2184695c0561209f91beddChris Lattner * what to do with the data returned by {@link #getData}. 397186df27bbdbb98c39ec2184695c0561209f91beddChris Lattner * 397286df27bbdbb98c39ec2184695c0561209f91beddChris Lattner * @return The action of this intent or null if none is specified. 397386df27bbdbb98c39ec2184695c0561209f91beddChris Lattner * 397486df27bbdbb98c39ec2184695c0561209f91beddChris Lattner * @see #setAction 397586df27bbdbb98c39ec2184695c0561209f91beddChris Lattner */ 39769a5a7e7351f78345a72c4956af25590f6d40ebcdChris Lattner public String getAction() { 3977c29f77b769bcc5b6dc85e72c8e3cc2e348e5cf25Douglas Gregor return mAction; 3978c29f77b769bcc5b6dc85e72c8e3cc2e348e5cf25Douglas Gregor } 397986df27bbdbb98c39ec2184695c0561209f91beddChris Lattner 398086df27bbdbb98c39ec2184695c0561209f91beddChris Lattner /** 398186df27bbdbb98c39ec2184695c0561209f91beddChris Lattner * Retrieve data this intent is operating on. This URI specifies the name 3982fd612dbb23cd31c03c898ae53ff18d0dfd8488f9Mike Stump * of the data; often it uses the content: scheme, specifying data in a 39839a5a7e7351f78345a72c4956af25590f6d40ebcdChris Lattner * content provider. Other schemes may be handled by specific activities, 3984782fa308a765aeac2acb39c4e697c937ec21185bMike Stump * such as http: by the web browser. 3985782fa308a765aeac2acb39c4e697c937ec21185bMike Stump * 3986782fa308a765aeac2acb39c4e697c937ec21185bMike Stump * @return The URI of the data this intent is targeting or null. 3987782fa308a765aeac2acb39c4e697c937ec21185bMike Stump * 3988782fa308a765aeac2acb39c4e697c937ec21185bMike Stump * @see #getScheme 3989782fa308a765aeac2acb39c4e697c937ec21185bMike Stump * @see #setData 3990fd612dbb23cd31c03c898ae53ff18d0dfd8488f9Mike Stump */ 3991782fa308a765aeac2acb39c4e697c937ec21185bMike Stump public Uri getData() { 3992fd612dbb23cd31c03c898ae53ff18d0dfd8488f9Mike Stump return mData; 3993fd612dbb23cd31c03c898ae53ff18d0dfd8488f9Mike Stump } 3994fd612dbb23cd31c03c898ae53ff18d0dfd8488f9Mike Stump 3995fd612dbb23cd31c03c898ae53ff18d0dfd8488f9Mike Stump /** 3996fd612dbb23cd31c03c898ae53ff18d0dfd8488f9Mike Stump * The same as {@link #getData()}, but returns the URI as an encoded 3997fd612dbb23cd31c03c898ae53ff18d0dfd8488f9Mike Stump * String. 3998782fa308a765aeac2acb39c4e697c937ec21185bMike Stump */ 399986df27bbdbb98c39ec2184695c0561209f91beddChris Lattner public String getDataString() { 400086df27bbdbb98c39ec2184695c0561209f91beddChris Lattner return mData != null ? mData.toString() : null; 400186df27bbdbb98c39ec2184695c0561209f91beddChris Lattner } 400286df27bbdbb98c39ec2184695c0561209f91beddChris Lattner 400386df27bbdbb98c39ec2184695c0561209f91beddChris Lattner /** 400486df27bbdbb98c39ec2184695c0561209f91beddChris Lattner * Return the scheme portion of the intent's data. If the data is null or 400586df27bbdbb98c39ec2184695c0561209f91beddChris Lattner * does not include a scheme, null is returned. Otherwise, the scheme 400686df27bbdbb98c39ec2184695c0561209f91beddChris Lattner * prefix without the final ':' is returned, i.e. "http". 400786df27bbdbb98c39ec2184695c0561209f91beddChris Lattner * 400886df27bbdbb98c39ec2184695c0561209f91beddChris Lattner * <p>This is the same as calling getData().getScheme() (and checking for 400986df27bbdbb98c39ec2184695c0561209f91beddChris Lattner * null data). 401086df27bbdbb98c39ec2184695c0561209f91beddChris Lattner * 401186df27bbdbb98c39ec2184695c0561209f91beddChris Lattner * @return The scheme of this intent. 401286df27bbdbb98c39ec2184695c0561209f91beddChris Lattner * 401386df27bbdbb98c39ec2184695c0561209f91beddChris Lattner * @see #getData 401486df27bbdbb98c39ec2184695c0561209f91beddChris Lattner */ 401586df27bbdbb98c39ec2184695c0561209f91beddChris Lattner public String getScheme() { 401686df27bbdbb98c39ec2184695c0561209f91beddChris Lattner return mData != null ? mData.getScheme() : null; 401786df27bbdbb98c39ec2184695c0561209f91beddChris Lattner } 401886df27bbdbb98c39ec2184695c0561209f91beddChris Lattner 401986df27bbdbb98c39ec2184695c0561209f91beddChris Lattner /** 402086df27bbdbb98c39ec2184695c0561209f91beddChris Lattner * Retrieve any explicit MIME type included in the intent. This is usually 402186df27bbdbb98c39ec2184695c0561209f91beddChris Lattner * null, as the type is determined by the intent data. 402286df27bbdbb98c39ec2184695c0561209f91beddChris Lattner * 402386df27bbdbb98c39ec2184695c0561209f91beddChris Lattner * @return If a type was manually set, it is returned; else null is 402486df27bbdbb98c39ec2184695c0561209f91beddChris Lattner * returned. 402586df27bbdbb98c39ec2184695c0561209f91beddChris Lattner * 402686df27bbdbb98c39ec2184695c0561209f91beddChris Lattner * @see #resolveType(ContentResolver) 402786df27bbdbb98c39ec2184695c0561209f91beddChris Lattner * @see #setType 402886df27bbdbb98c39ec2184695c0561209f91beddChris Lattner */ 402986df27bbdbb98c39ec2184695c0561209f91beddChris Lattner public String getType() { 403086df27bbdbb98c39ec2184695c0561209f91beddChris Lattner return mType; 403186df27bbdbb98c39ec2184695c0561209f91beddChris Lattner } 403286df27bbdbb98c39ec2184695c0561209f91beddChris Lattner 403386df27bbdbb98c39ec2184695c0561209f91beddChris Lattner /** 403486df27bbdbb98c39ec2184695c0561209f91beddChris Lattner * Return the MIME data type of this intent. If the type field is 403586df27bbdbb98c39ec2184695c0561209f91beddChris Lattner * explicitly set, that is simply returned. Otherwise, if the data is set, 403686df27bbdbb98c39ec2184695c0561209f91beddChris Lattner * the type of that data is returned. If neither fields are set, a null is 403786df27bbdbb98c39ec2184695c0561209f91beddChris Lattner * returned. 403886df27bbdbb98c39ec2184695c0561209f91beddChris Lattner * 403986df27bbdbb98c39ec2184695c0561209f91beddChris Lattner * @return The MIME type of this intent. 404086df27bbdbb98c39ec2184695c0561209f91beddChris Lattner * 404186df27bbdbb98c39ec2184695c0561209f91beddChris Lattner * @see #getType 404286df27bbdbb98c39ec2184695c0561209f91beddChris Lattner * @see #resolveType(ContentResolver) 404386df27bbdbb98c39ec2184695c0561209f91beddChris Lattner */ 404486df27bbdbb98c39ec2184695c0561209f91beddChris Lattner public String resolveType(Context context) { 404586df27bbdbb98c39ec2184695c0561209f91beddChris Lattner return resolveType(context.getContentResolver()); 404686df27bbdbb98c39ec2184695c0561209f91beddChris Lattner } 404786df27bbdbb98c39ec2184695c0561209f91beddChris Lattner 404886df27bbdbb98c39ec2184695c0561209f91beddChris Lattner /** 404986df27bbdbb98c39ec2184695c0561209f91beddChris Lattner * Return the MIME data type of this intent. If the type field is 405086df27bbdbb98c39ec2184695c0561209f91beddChris Lattner * explicitly set, that is simply returned. Otherwise, if the data is set, 405186df27bbdbb98c39ec2184695c0561209f91beddChris Lattner * the type of that data is returned. If neither fields are set, a null is 405286df27bbdbb98c39ec2184695c0561209f91beddChris Lattner * returned. 405386df27bbdbb98c39ec2184695c0561209f91beddChris Lattner * 405486df27bbdbb98c39ec2184695c0561209f91beddChris Lattner * @param resolver A ContentResolver that can be used to determine the MIME 4055 * type of the intent's data. 4056 * 4057 * @return The MIME type of this intent. 4058 * 4059 * @see #getType 4060 * @see #resolveType(Context) 4061 */ 4062 public String resolveType(ContentResolver resolver) { 4063 if (mType != null) { 4064 return mType; 4065 } 4066 if (mData != null) { 4067 if ("content".equals(mData.getScheme())) { 4068 return resolver.getType(mData); 4069 } 4070 } 4071 return null; 4072 } 4073 4074 /** 4075 * Return the MIME data type of this intent, only if it will be needed for 4076 * intent resolution. This is not generally useful for application code; 4077 * it is used by the frameworks for communicating with back-end system 4078 * services. 4079 * 4080 * @param resolver A ContentResolver that can be used to determine the MIME 4081 * type of the intent's data. 4082 * 4083 * @return The MIME type of this intent, or null if it is unknown or not 4084 * needed. 4085 */ 4086 public String resolveTypeIfNeeded(ContentResolver resolver) { 4087 if (mComponent != null) { 4088 return mType; 4089 } 4090 return resolveType(resolver); 4091 } 4092 4093 /** 4094 * Check if a category exists in the intent. 4095 * 4096 * @param category The category to check. 4097 * 4098 * @return boolean True if the intent contains the category, else false. 4099 * 4100 * @see #getCategories 4101 * @see #addCategory 4102 */ 4103 public boolean hasCategory(String category) { 4104 return mCategories != null && mCategories.contains(category); 4105 } 4106 4107 /** 4108 * Return the set of all categories in the intent. If there are no categories, 4109 * returns NULL. 4110 * 4111 * @return The set of categories you can examine. Do not modify! 4112 * 4113 * @see #hasCategory 4114 * @see #addCategory 4115 */ 4116 public Set<String> getCategories() { 4117 return mCategories; 4118 } 4119 4120 /** 4121 * Return the specific selector associated with this Intent. If there is 4122 * none, returns null. See {@link #setSelector} for more information. 4123 * 4124 * @see #setSelector 4125 */ 4126 public Intent getSelector() { 4127 return mSelector; 4128 } 4129 4130 /** 4131 * Return the {@link ClipData} associated with this Intent. If there is 4132 * none, returns null. See {@link #setClipData} for more information. 4133 * 4134 * @see #setClipData; 4135 */ 4136 public ClipData getClipData() { 4137 return mClipData; 4138 } 4139 4140 /** 4141 * Sets the ClassLoader that will be used when unmarshalling 4142 * any Parcelable values from the extras of this Intent. 4143 * 4144 * @param loader a ClassLoader, or null to use the default loader 4145 * at the time of unmarshalling. 4146 */ 4147 public void setExtrasClassLoader(ClassLoader loader) { 4148 if (mExtras != null) { 4149 mExtras.setClassLoader(loader); 4150 } 4151 } 4152 4153 /** 4154 * Returns true if an extra value is associated with the given name. 4155 * @param name the extra's name 4156 * @return true if the given extra is present. 4157 */ 4158 public boolean hasExtra(String name) { 4159 return mExtras != null && mExtras.containsKey(name); 4160 } 4161 4162 /** 4163 * Returns true if the Intent's extras contain a parcelled file descriptor. 4164 * @return true if the Intent contains a parcelled file descriptor. 4165 */ 4166 public boolean hasFileDescriptors() { 4167 return mExtras != null && mExtras.hasFileDescriptors(); 4168 } 4169 4170 /** @hide */ 4171 public void setAllowFds(boolean allowFds) { 4172 if (mExtras != null) { 4173 mExtras.setAllowFds(allowFds); 4174 } 4175 } 4176 4177 /** 4178 * Retrieve extended data from the intent. 4179 * 4180 * @param name The name of the desired item. 4181 * 4182 * @return the value of an item that previously added with putExtra() 4183 * or null if none was found. 4184 * 4185 * @deprecated 4186 * @hide 4187 */ 4188 @Deprecated 4189 public Object getExtra(String name) { 4190 return getExtra(name, null); 4191 } 4192 4193 /** 4194 * Retrieve extended data from the intent. 4195 * 4196 * @param name The name of the desired item. 4197 * @param defaultValue the value to be returned if no value of the desired 4198 * type is stored with the given name. 4199 * 4200 * @return the value of an item that previously added with putExtra() 4201 * or the default value if none was found. 4202 * 4203 * @see #putExtra(String, boolean) 4204 */ 4205 public boolean getBooleanExtra(String name, boolean defaultValue) { 4206 return mExtras == null ? defaultValue : 4207 mExtras.getBoolean(name, defaultValue); 4208 } 4209 4210 /** 4211 * Retrieve extended data from the intent. 4212 * 4213 * @param name The name of the desired item. 4214 * @param defaultValue the value to be returned if no value of the desired 4215 * type is stored with the given name. 4216 * 4217 * @return the value of an item that previously added with putExtra() 4218 * or the default value if none was found. 4219 * 4220 * @see #putExtra(String, byte) 4221 */ 4222 public byte getByteExtra(String name, byte defaultValue) { 4223 return mExtras == null ? defaultValue : 4224 mExtras.getByte(name, defaultValue); 4225 } 4226 4227 /** 4228 * Retrieve extended data from the intent. 4229 * 4230 * @param name The name of the desired item. 4231 * @param defaultValue the value to be returned if no value of the desired 4232 * type is stored with the given name. 4233 * 4234 * @return the value of an item that previously added with putExtra() 4235 * or the default value if none was found. 4236 * 4237 * @see #putExtra(String, short) 4238 */ 4239 public short getShortExtra(String name, short defaultValue) { 4240 return mExtras == null ? defaultValue : 4241 mExtras.getShort(name, defaultValue); 4242 } 4243 4244 /** 4245 * Retrieve extended data from the intent. 4246 * 4247 * @param name The name of the desired item. 4248 * @param defaultValue the value to be returned if no value of the desired 4249 * type is stored with the given name. 4250 * 4251 * @return the value of an item that previously added with putExtra() 4252 * or the default value if none was found. 4253 * 4254 * @see #putExtra(String, char) 4255 */ 4256 public char getCharExtra(String name, char defaultValue) { 4257 return mExtras == null ? defaultValue : 4258 mExtras.getChar(name, defaultValue); 4259 } 4260 4261 /** 4262 * Retrieve extended data from the intent. 4263 * 4264 * @param name The name of the desired item. 4265 * @param defaultValue the value to be returned if no value of the desired 4266 * type is stored with the given name. 4267 * 4268 * @return the value of an item that previously added with putExtra() 4269 * or the default value if none was found. 4270 * 4271 * @see #putExtra(String, int) 4272 */ 4273 public int getIntExtra(String name, int defaultValue) { 4274 return mExtras == null ? defaultValue : 4275 mExtras.getInt(name, defaultValue); 4276 } 4277 4278 /** 4279 * Retrieve extended data from the intent. 4280 * 4281 * @param name The name of the desired item. 4282 * @param defaultValue the value to be returned if no value of the desired 4283 * type is stored with the given name. 4284 * 4285 * @return the value of an item that previously added with putExtra() 4286 * or the default value if none was found. 4287 * 4288 * @see #putExtra(String, long) 4289 */ 4290 public long getLongExtra(String name, long defaultValue) { 4291 return mExtras == null ? defaultValue : 4292 mExtras.getLong(name, defaultValue); 4293 } 4294 4295 /** 4296 * Retrieve extended data from the intent. 4297 * 4298 * @param name The name of the desired item. 4299 * @param defaultValue the value to be returned if no value of the desired 4300 * type is stored with the given name. 4301 * 4302 * @return the value of an item that previously added with putExtra(), 4303 * or the default value if no such item is present 4304 * 4305 * @see #putExtra(String, float) 4306 */ 4307 public float getFloatExtra(String name, float defaultValue) { 4308 return mExtras == null ? defaultValue : 4309 mExtras.getFloat(name, defaultValue); 4310 } 4311 4312 /** 4313 * Retrieve extended data from the intent. 4314 * 4315 * @param name The name of the desired item. 4316 * @param defaultValue the value to be returned if no value of the desired 4317 * type is stored with the given name. 4318 * 4319 * @return the value of an item that previously added with putExtra() 4320 * or the default value if none was found. 4321 * 4322 * @see #putExtra(String, double) 4323 */ 4324 public double getDoubleExtra(String name, double defaultValue) { 4325 return mExtras == null ? defaultValue : 4326 mExtras.getDouble(name, defaultValue); 4327 } 4328 4329 /** 4330 * Retrieve extended data from the intent. 4331 * 4332 * @param name The name of the desired item. 4333 * 4334 * @return the value of an item that previously added with putExtra() 4335 * or null if no String value was found. 4336 * 4337 * @see #putExtra(String, String) 4338 */ 4339 public String getStringExtra(String name) { 4340 return mExtras == null ? null : mExtras.getString(name); 4341 } 4342 4343 /** 4344 * Retrieve extended data from the intent. 4345 * 4346 * @param name The name of the desired item. 4347 * 4348 * @return the value of an item that previously added with putExtra() 4349 * or null if no CharSequence value was found. 4350 * 4351 * @see #putExtra(String, CharSequence) 4352 */ 4353 public CharSequence getCharSequenceExtra(String name) { 4354 return mExtras == null ? null : mExtras.getCharSequence(name); 4355 } 4356 4357 /** 4358 * Retrieve extended data from the intent. 4359 * 4360 * @param name The name of the desired item. 4361 * 4362 * @return the value of an item that previously added with putExtra() 4363 * or null if no Parcelable value was found. 4364 * 4365 * @see #putExtra(String, Parcelable) 4366 */ 4367 public <T extends Parcelable> T getParcelableExtra(String name) { 4368 return mExtras == null ? null : mExtras.<T>getParcelable(name); 4369 } 4370 4371 /** 4372 * Retrieve extended data from the intent. 4373 * 4374 * @param name The name of the desired item. 4375 * 4376 * @return the value of an item that previously added with putExtra() 4377 * or null if no Parcelable[] value was found. 4378 * 4379 * @see #putExtra(String, Parcelable[]) 4380 */ 4381 public Parcelable[] getParcelableArrayExtra(String name) { 4382 return mExtras == null ? null : mExtras.getParcelableArray(name); 4383 } 4384 4385 /** 4386 * Retrieve extended data from the intent. 4387 * 4388 * @param name The name of the desired item. 4389 * 4390 * @return the value of an item that previously added with putExtra() 4391 * or null if no ArrayList<Parcelable> value was found. 4392 * 4393 * @see #putParcelableArrayListExtra(String, ArrayList) 4394 */ 4395 public <T extends Parcelable> ArrayList<T> getParcelableArrayListExtra(String name) { 4396 return mExtras == null ? null : mExtras.<T>getParcelableArrayList(name); 4397 } 4398 4399 /** 4400 * Retrieve extended data from the intent. 4401 * 4402 * @param name The name of the desired item. 4403 * 4404 * @return the value of an item that previously added with putExtra() 4405 * or null if no Serializable value was found. 4406 * 4407 * @see #putExtra(String, Serializable) 4408 */ 4409 public Serializable getSerializableExtra(String name) { 4410 return mExtras == null ? null : mExtras.getSerializable(name); 4411 } 4412 4413 /** 4414 * Retrieve extended data from the intent. 4415 * 4416 * @param name The name of the desired item. 4417 * 4418 * @return the value of an item that previously added with putExtra() 4419 * or null if no ArrayList<Integer> value was found. 4420 * 4421 * @see #putIntegerArrayListExtra(String, ArrayList) 4422 */ 4423 public ArrayList<Integer> getIntegerArrayListExtra(String name) { 4424 return mExtras == null ? null : mExtras.getIntegerArrayList(name); 4425 } 4426 4427 /** 4428 * Retrieve extended data from the intent. 4429 * 4430 * @param name The name of the desired item. 4431 * 4432 * @return the value of an item that previously added with putExtra() 4433 * or null if no ArrayList<String> value was found. 4434 * 4435 * @see #putStringArrayListExtra(String, ArrayList) 4436 */ 4437 public ArrayList<String> getStringArrayListExtra(String name) { 4438 return mExtras == null ? null : mExtras.getStringArrayList(name); 4439 } 4440 4441 /** 4442 * Retrieve extended data from the intent. 4443 * 4444 * @param name The name of the desired item. 4445 * 4446 * @return the value of an item that previously added with putExtra() 4447 * or null if no ArrayList<CharSequence> value was found. 4448 * 4449 * @see #putCharSequenceArrayListExtra(String, ArrayList) 4450 */ 4451 public ArrayList<CharSequence> getCharSequenceArrayListExtra(String name) { 4452 return mExtras == null ? null : mExtras.getCharSequenceArrayList(name); 4453 } 4454 4455 /** 4456 * Retrieve extended data from the intent. 4457 * 4458 * @param name The name of the desired item. 4459 * 4460 * @return the value of an item that previously added with putExtra() 4461 * or null if no boolean array value was found. 4462 * 4463 * @see #putExtra(String, boolean[]) 4464 */ 4465 public boolean[] getBooleanArrayExtra(String name) { 4466 return mExtras == null ? null : mExtras.getBooleanArray(name); 4467 } 4468 4469 /** 4470 * Retrieve extended data from the intent. 4471 * 4472 * @param name The name of the desired item. 4473 * 4474 * @return the value of an item that previously added with putExtra() 4475 * or null if no byte array value was found. 4476 * 4477 * @see #putExtra(String, byte[]) 4478 */ 4479 public byte[] getByteArrayExtra(String name) { 4480 return mExtras == null ? null : mExtras.getByteArray(name); 4481 } 4482 4483 /** 4484 * Retrieve extended data from the intent. 4485 * 4486 * @param name The name of the desired item. 4487 * 4488 * @return the value of an item that previously added with putExtra() 4489 * or null if no short array value was found. 4490 * 4491 * @see #putExtra(String, short[]) 4492 */ 4493 public short[] getShortArrayExtra(String name) { 4494 return mExtras == null ? null : mExtras.getShortArray(name); 4495 } 4496 4497 /** 4498 * Retrieve extended data from the intent. 4499 * 4500 * @param name The name of the desired item. 4501 * 4502 * @return the value of an item that previously added with putExtra() 4503 * or null if no char array value was found. 4504 * 4505 * @see #putExtra(String, char[]) 4506 */ 4507 public char[] getCharArrayExtra(String name) { 4508 return mExtras == null ? null : mExtras.getCharArray(name); 4509 } 4510 4511 /** 4512 * Retrieve extended data from the intent. 4513 * 4514 * @param name The name of the desired item. 4515 * 4516 * @return the value of an item that previously added with putExtra() 4517 * or null if no int array value was found. 4518 * 4519 * @see #putExtra(String, int[]) 4520 */ 4521 public int[] getIntArrayExtra(String name) { 4522 return mExtras == null ? null : mExtras.getIntArray(name); 4523 } 4524 4525 /** 4526 * Retrieve extended data from the intent. 4527 * 4528 * @param name The name of the desired item. 4529 * 4530 * @return the value of an item that previously added with putExtra() 4531 * or null if no long array value was found. 4532 * 4533 * @see #putExtra(String, long[]) 4534 */ 4535 public long[] getLongArrayExtra(String name) { 4536 return mExtras == null ? null : mExtras.getLongArray(name); 4537 } 4538 4539 /** 4540 * Retrieve extended data from the intent. 4541 * 4542 * @param name The name of the desired item. 4543 * 4544 * @return the value of an item that previously added with putExtra() 4545 * or null if no float array value was found. 4546 * 4547 * @see #putExtra(String, float[]) 4548 */ 4549 public float[] getFloatArrayExtra(String name) { 4550 return mExtras == null ? null : mExtras.getFloatArray(name); 4551 } 4552 4553 /** 4554 * Retrieve extended data from the intent. 4555 * 4556 * @param name The name of the desired item. 4557 * 4558 * @return the value of an item that previously added with putExtra() 4559 * or null if no double array value was found. 4560 * 4561 * @see #putExtra(String, double[]) 4562 */ 4563 public double[] getDoubleArrayExtra(String name) { 4564 return mExtras == null ? null : mExtras.getDoubleArray(name); 4565 } 4566 4567 /** 4568 * Retrieve extended data from the intent. 4569 * 4570 * @param name The name of the desired item. 4571 * 4572 * @return the value of an item that previously added with putExtra() 4573 * or null if no String array value was found. 4574 * 4575 * @see #putExtra(String, String[]) 4576 */ 4577 public String[] getStringArrayExtra(String name) { 4578 return mExtras == null ? null : mExtras.getStringArray(name); 4579 } 4580 4581 /** 4582 * Retrieve extended data from the intent. 4583 * 4584 * @param name The name of the desired item. 4585 * 4586 * @return the value of an item that previously added with putExtra() 4587 * or null if no CharSequence array value was found. 4588 * 4589 * @see #putExtra(String, CharSequence[]) 4590 */ 4591 public CharSequence[] getCharSequenceArrayExtra(String name) { 4592 return mExtras == null ? null : mExtras.getCharSequenceArray(name); 4593 } 4594 4595 /** 4596 * Retrieve extended data from the intent. 4597 * 4598 * @param name The name of the desired item. 4599 * 4600 * @return the value of an item that previously added with putExtra() 4601 * or null if no Bundle value was found. 4602 * 4603 * @see #putExtra(String, Bundle) 4604 */ 4605 public Bundle getBundleExtra(String name) { 4606 return mExtras == null ? null : mExtras.getBundle(name); 4607 } 4608 4609 /** 4610 * Retrieve extended data from the intent. 4611 * 4612 * @param name The name of the desired item. 4613 * 4614 * @return the value of an item that previously added with putExtra() 4615 * or null if no IBinder value was found. 4616 * 4617 * @see #putExtra(String, IBinder) 4618 * 4619 * @deprecated 4620 * @hide 4621 */ 4622 @Deprecated 4623 public IBinder getIBinderExtra(String name) { 4624 return mExtras == null ? null : mExtras.getIBinder(name); 4625 } 4626 4627 /** 4628 * Retrieve extended data from the intent. 4629 * 4630 * @param name The name of the desired item. 4631 * @param defaultValue The default value to return in case no item is 4632 * associated with the key 'name' 4633 * 4634 * @return the value of an item that previously added with putExtra() 4635 * or defaultValue if none was found. 4636 * 4637 * @see #putExtra 4638 * 4639 * @deprecated 4640 * @hide 4641 */ 4642 @Deprecated 4643 public Object getExtra(String name, Object defaultValue) { 4644 Object result = defaultValue; 4645 if (mExtras != null) { 4646 Object result2 = mExtras.get(name); 4647 if (result2 != null) { 4648 result = result2; 4649 } 4650 } 4651 4652 return result; 4653 } 4654 4655 /** 4656 * Retrieves a map of extended data from the intent. 4657 * 4658 * @return the map of all extras previously added with putExtra(), 4659 * or null if none have been added. 4660 */ 4661 public Bundle getExtras() { 4662 return (mExtras != null) 4663 ? new Bundle(mExtras) 4664 : null; 4665 } 4666 4667 /** 4668 * Retrieve any special flags associated with this intent. You will 4669 * normally just set them with {@link #setFlags} and let the system 4670 * take the appropriate action with them. 4671 * 4672 * @return int The currently set flags. 4673 * 4674 * @see #setFlags 4675 */ 4676 public int getFlags() { 4677 return mFlags; 4678 } 4679 4680 /** @hide */ 4681 public boolean isExcludingStopped() { 4682 return (mFlags&(FLAG_EXCLUDE_STOPPED_PACKAGES|FLAG_INCLUDE_STOPPED_PACKAGES)) 4683 == FLAG_EXCLUDE_STOPPED_PACKAGES; 4684 } 4685 4686 /** 4687 * Retrieve the application package name this Intent is limited to. When 4688 * resolving an Intent, if non-null this limits the resolution to only 4689 * components in the given application package. 4690 * 4691 * @return The name of the application package for the Intent. 4692 * 4693 * @see #resolveActivity 4694 * @see #setPackage 4695 */ 4696 public String getPackage() { 4697 return mPackage; 4698 } 4699 4700 /** 4701 * Retrieve the concrete component associated with the intent. When receiving 4702 * an intent, this is the component that was found to best handle it (that is, 4703 * yourself) and will always be non-null; in all other cases it will be 4704 * null unless explicitly set. 4705 * 4706 * @return The name of the application component to handle the intent. 4707 * 4708 * @see #resolveActivity 4709 * @see #setComponent 4710 */ 4711 public ComponentName getComponent() { 4712 return mComponent; 4713 } 4714 4715 /** 4716 * Get the bounds of the sender of this intent, in screen coordinates. This can be 4717 * used as a hint to the receiver for animations and the like. Null means that there 4718 * is no source bounds. 4719 */ 4720 public Rect getSourceBounds() { 4721 return mSourceBounds; 4722 } 4723 4724 /** 4725 * Return the Activity component that should be used to handle this intent. 4726 * The appropriate component is determined based on the information in the 4727 * intent, evaluated as follows: 4728 * 4729 * <p>If {@link #getComponent} returns an explicit class, that is returned 4730 * without any further consideration. 4731 * 4732 * <p>The activity must handle the {@link Intent#CATEGORY_DEFAULT} Intent 4733 * category to be considered. 4734 * 4735 * <p>If {@link #getAction} is non-NULL, the activity must handle this 4736 * action. 4737 * 4738 * <p>If {@link #resolveType} returns non-NULL, the activity must handle 4739 * this type. 4740 * 4741 * <p>If {@link #addCategory} has added any categories, the activity must 4742 * handle ALL of the categories specified. 4743 * 4744 * <p>If {@link #getPackage} is non-NULL, only activity components in 4745 * that application package will be considered. 4746 * 4747 * <p>If there are no activities that satisfy all of these conditions, a 4748 * null string is returned. 4749 * 4750 * <p>If multiple activities are found to satisfy the intent, the one with 4751 * the highest priority will be used. If there are multiple activities 4752 * with the same priority, the system will either pick the best activity 4753 * based on user preference, or resolve to a system class that will allow 4754 * the user to pick an activity and forward from there. 4755 * 4756 * <p>This method is implemented simply by calling 4757 * {@link PackageManager#resolveActivity} with the "defaultOnly" parameter 4758 * true.</p> 4759 * <p> This API is called for you as part of starting an activity from an 4760 * intent. You do not normally need to call it yourself.</p> 4761 * 4762 * @param pm The package manager with which to resolve the Intent. 4763 * 4764 * @return Name of the component implementing an activity that can 4765 * display the intent. 4766 * 4767 * @see #setComponent 4768 * @see #getComponent 4769 * @see #resolveActivityInfo 4770 */ 4771 public ComponentName resolveActivity(PackageManager pm) { 4772 if (mComponent != null) { 4773 return mComponent; 4774 } 4775 4776 ResolveInfo info = pm.resolveActivity( 4777 this, PackageManager.MATCH_DEFAULT_ONLY); 4778 if (info != null) { 4779 return new ComponentName( 4780 info.activityInfo.applicationInfo.packageName, 4781 info.activityInfo.name); 4782 } 4783 4784 return null; 4785 } 4786 4787 /** 4788 * Resolve the Intent into an {@link ActivityInfo} 4789 * describing the activity that should execute the intent. Resolution 4790 * follows the same rules as described for {@link #resolveActivity}, but 4791 * you get back the completely information about the resolved activity 4792 * instead of just its class name. 4793 * 4794 * @param pm The package manager with which to resolve the Intent. 4795 * @param flags Addition information to retrieve as per 4796 * {@link PackageManager#getActivityInfo(ComponentName, int) 4797 * PackageManager.getActivityInfo()}. 4798 * 4799 * @return PackageManager.ActivityInfo 4800 * 4801 * @see #resolveActivity 4802 */ 4803 public ActivityInfo resolveActivityInfo(PackageManager pm, int flags) { 4804 ActivityInfo ai = null; 4805 if (mComponent != null) { 4806 try { 4807 ai = pm.getActivityInfo(mComponent, flags); 4808 } catch (PackageManager.NameNotFoundException e) { 4809 // ignore 4810 } 4811 } else { 4812 ResolveInfo info = pm.resolveActivity( 4813 this, PackageManager.MATCH_DEFAULT_ONLY | flags); 4814 if (info != null) { 4815 ai = info.activityInfo; 4816 } 4817 } 4818 4819 return ai; 4820 } 4821 4822 /** 4823 * Set the general action to be performed. 4824 * 4825 * @param action An action name, such as ACTION_VIEW. Application-specific 4826 * actions should be prefixed with the vendor's package name. 4827 * 4828 * @return Returns the same Intent object, for chaining multiple calls 4829 * into a single statement. 4830 * 4831 * @see #getAction 4832 */ 4833 public Intent setAction(String action) { 4834 mAction = action != null ? action.intern() : null; 4835 return this; 4836 } 4837 4838 /** 4839 * Set the data this intent is operating on. This method automatically 4840 * clears any type that was previously set by {@link #setType} or 4841 * {@link #setTypeAndNormalize}. 4842 * 4843 * <p><em>Note: scheme matching in the Android framework is 4844 * case-sensitive, unlike the formal RFC. As a result, 4845 * you should always write your Uri with a lower case scheme, 4846 * or use {@link Uri#normalizeScheme} or 4847 * {@link #setDataAndNormalize} 4848 * to ensure that the scheme is converted to lower case.</em> 4849 * 4850 * @param data The Uri of the data this intent is now targeting. 4851 * 4852 * @return Returns the same Intent object, for chaining multiple calls 4853 * into a single statement. 4854 * 4855 * @see #getData 4856 * @see #setDataAndNormalize 4857 * @see android.net.Intent#normalize 4858 */ 4859 public Intent setData(Uri data) { 4860 mData = data; 4861 mType = null; 4862 return this; 4863 } 4864 4865 /** 4866 * Normalize and set the data this intent is operating on. 4867 * 4868 * <p>This method automatically clears any type that was 4869 * previously set (for example, by {@link #setType}). 4870 * 4871 * <p>The data Uri is normalized using 4872 * {@link android.net.Uri#normalizeScheme} before it is set, 4873 * so really this is just a convenience method for 4874 * <pre> 4875 * setData(data.normalize()) 4876 * </pre> 4877 * 4878 * @param data The Uri of the data this intent is now targeting. 4879 * 4880 * @return Returns the same Intent object, for chaining multiple calls 4881 * into a single statement. 4882 * 4883 * @see #getData 4884 * @see #setType 4885 * @see android.net.Uri#normalizeScheme 4886 */ 4887 public Intent setDataAndNormalize(Uri data) { 4888 return setData(data.normalizeScheme()); 4889 } 4890 4891 /** 4892 * Set an explicit MIME data type. 4893 * 4894 * <p>This is used to create intents that only specify a type and not data, 4895 * for example to indicate the type of data to return. 4896 * 4897 * <p>This method automatically clears any data that was 4898 * previously set (for example by {@link #setData}). 4899 * 4900 * <p><em>Note: MIME type matching in the Android framework is 4901 * case-sensitive, unlike formal RFC MIME types. As a result, 4902 * you should always write your MIME types with lower case letters, 4903 * or use {@link #normalizeMimeType} or {@link #setTypeAndNormalize} 4904 * to ensure that it is converted to lower case.</em> 4905 * 4906 * @param type The MIME type of the data being handled by this intent. 4907 * 4908 * @return Returns the same Intent object, for chaining multiple calls 4909 * into a single statement. 4910 * 4911 * @see #getType 4912 * @see #setTypeAndNormalize 4913 * @see #setDataAndType 4914 * @see #normalizeMimeType 4915 */ 4916 public Intent setType(String type) { 4917 mData = null; 4918 mType = type; 4919 return this; 4920 } 4921 4922 /** 4923 * Normalize and set an explicit MIME data type. 4924 * 4925 * <p>This is used to create intents that only specify a type and not data, 4926 * for example to indicate the type of data to return. 4927 * 4928 * <p>This method automatically clears any data that was 4929 * previously set (for example by {@link #setData}). 4930 * 4931 * <p>The MIME type is normalized using 4932 * {@link #normalizeMimeType} before it is set, 4933 * so really this is just a convenience method for 4934 * <pre> 4935 * setType(Intent.normalizeMimeType(type)) 4936 * </pre> 4937 * 4938 * @param type The MIME type of the data being handled by this intent. 4939 * 4940 * @return Returns the same Intent object, for chaining multiple calls 4941 * into a single statement. 4942 * 4943 * @see #getType 4944 * @see #setData 4945 * @see #normalizeMimeType 4946 */ 4947 public Intent setTypeAndNormalize(String type) { 4948 return setType(normalizeMimeType(type)); 4949 } 4950 4951 /** 4952 * (Usually optional) Set the data for the intent along with an explicit 4953 * MIME data type. This method should very rarely be used -- it allows you 4954 * to override the MIME type that would ordinarily be inferred from the 4955 * data with your own type given here. 4956 * 4957 * <p><em>Note: MIME type and Uri scheme matching in the 4958 * Android framework is case-sensitive, unlike the formal RFC definitions. 4959 * As a result, you should always write these elements with lower case letters, 4960 * or use {@link #normalizeMimeType} or {@link android.net.Uri#normalizeScheme} or 4961 * {@link #setDataAndTypeAndNormalize} 4962 * to ensure that they are converted to lower case.</em> 4963 * 4964 * @param data The Uri of the data this intent is now targeting. 4965 * @param type The MIME type of the data being handled by this intent. 4966 * 4967 * @return Returns the same Intent object, for chaining multiple calls 4968 * into a single statement. 4969 * 4970 * @see #setType 4971 * @see #setData 4972 * @see #normalizeMimeType 4973 * @see android.net.Uri#normalizeScheme 4974 * @see #setDataAndTypeAndNormalize 4975 */ 4976 public Intent setDataAndType(Uri data, String type) { 4977 mData = data; 4978 mType = type; 4979 return this; 4980 } 4981 4982 /** 4983 * (Usually optional) Normalize and set both the data Uri and an explicit 4984 * MIME data type. This method should very rarely be used -- it allows you 4985 * to override the MIME type that would ordinarily be inferred from the 4986 * data with your own type given here. 4987 * 4988 * <p>The data Uri and the MIME type are normalize using 4989 * {@link android.net.Uri#normalizeScheme} and {@link #normalizeMimeType} 4990 * before they are set, so really this is just a convenience method for 4991 * <pre> 4992 * setDataAndType(data.normalize(), Intent.normalizeMimeType(type)) 4993 * </pre> 4994 * 4995 * @param data The Uri of the data this intent is now targeting. 4996 * @param type The MIME type of the data being handled by this intent. 4997 * 4998 * @return Returns the same Intent object, for chaining multiple calls 4999 * into a single statement. 5000 * 5001 * @see #setType 5002 * @see #setData 5003 * @see #setDataAndType 5004 * @see #normalizeMimeType 5005 * @see android.net.Uri#normalizeScheme 5006 */ 5007 public Intent setDataAndTypeAndNormalize(Uri data, String type) { 5008 return setDataAndType(data.normalizeScheme(), normalizeMimeType(type)); 5009 } 5010 5011 /** 5012 * Add a new category to the intent. Categories provide additional detail 5013 * about the action the intent performs. When resolving an intent, only 5014 * activities that provide <em>all</em> of the requested categories will be 5015 * used. 5016 * 5017 * @param category The desired category. This can be either one of the 5018 * predefined Intent categories, or a custom category in your own 5019 * namespace. 5020 * 5021 * @return Returns the same Intent object, for chaining multiple calls 5022 * into a single statement. 5023 * 5024 * @see #hasCategory 5025 * @see #removeCategory 5026 */ 5027 public Intent addCategory(String category) { 5028 if (mCategories == null) { 5029 mCategories = new HashSet<String>(); 5030 } 5031 mCategories.add(category.intern()); 5032 return this; 5033 } 5034 5035 /** 5036 * Remove a category from an intent. 5037 * 5038 * @param category The category to remove. 5039 * 5040 * @see #addCategory 5041 */ 5042 public void removeCategory(String category) { 5043 if (mCategories != null) { 5044 mCategories.remove(category); 5045 if (mCategories.size() == 0) { 5046 mCategories = null; 5047 } 5048 } 5049 } 5050 5051 /** 5052 * Set a selector for this Intent. This is a modification to the kinds of 5053 * things the Intent will match. If the selector is set, it will be used 5054 * when trying to find entities that can handle the Intent, instead of the 5055 * main contents of the Intent. This allows you build an Intent containing 5056 * a generic protocol while targeting it more specifically. 5057 * 5058 * <p>An example of where this may be used is with things like 5059 * {@link #CATEGORY_APP_BROWSER}. This category allows you to build an 5060 * Intent that will launch the Browser application. However, the correct 5061 * main entry point of an application is actually {@link #ACTION_MAIN} 5062 * {@link #CATEGORY_LAUNCHER} with {@link #setComponent(ComponentName)} 5063 * used to specify the actual Activity to launch. If you launch the browser 5064 * with something different, undesired behavior may happen if the user has 5065 * previously or later launches it the normal way, since they do not match. 5066 * Instead, you can build an Intent with the MAIN action (but no ComponentName 5067 * yet specified) and set a selector with {@link #ACTION_MAIN} and 5068 * {@link #CATEGORY_APP_BROWSER} to point it specifically to the browser activity. 5069 * 5070 * <p>Setting a selector does not impact the behavior of 5071 * {@link #filterEquals(Intent)} and {@link #filterHashCode()}. This is part of the 5072 * desired behavior of a selector -- it does not impact the base meaning 5073 * of the Intent, just what kinds of things will be matched against it 5074 * when determining who can handle it.</p> 5075 * 5076 * <p>You can not use both a selector and {@link #setPackage(String)} on 5077 * the same base Intent.</p> 5078 * 5079 * @param selector The desired selector Intent; set to null to not use 5080 * a special selector. 5081 */ 5082 public void setSelector(Intent selector) { 5083 if (selector == this) { 5084 throw new IllegalArgumentException( 5085 "Intent being set as a selector of itself"); 5086 } 5087 if (selector != null && mPackage != null) { 5088 throw new IllegalArgumentException( 5089 "Can't set selector when package name is already set"); 5090 } 5091 mSelector = selector; 5092 } 5093 5094 /** 5095 * Set a {@link ClipData} associated with this Intent. This replaces any 5096 * previously set ClipData. 5097 * 5098 * <p>The ClipData in an intent is not used for Intent matching or other 5099 * such operations. Semantically it is like extras, used to transmit 5100 * additional data with the Intent. The main feature of using this over 5101 * the extras for data is that {@link #FLAG_GRANT_READ_URI_PERMISSION} 5102 * and {@link #FLAG_GRANT_WRITE_URI_PERMISSION} will operate on any URI 5103 * items included in the clip data. This is useful, in particular, if 5104 * you want to transmit an Intent containing multiple <code>content:</code> 5105 * URIs for which the recipient may not have global permission to access the 5106 * content provider. 5107 * 5108 * <p>If the ClipData contains items that are themselves Intents, any 5109 * grant flags in those Intents will be ignored. Only the top-level flags 5110 * of the main Intent are respected, and will be applied to all Uri or 5111 * Intent items in the clip (or sub-items of the clip). 5112 * 5113 * <p>The MIME type, label, and icon in the ClipData object are not 5114 * directly used by Intent. Applications should generally rely on the 5115 * MIME type of the Intent itself, not what it may find in the ClipData. 5116 * A common practice is to construct a ClipData for use with an Intent 5117 * with a MIME type of "*\/*". 5118 * 5119 * @param clip The new clip to set. May be null to clear the current clip. 5120 */ 5121 public void setClipData(ClipData clip) { 5122 mClipData = clip; 5123 } 5124 5125 /** 5126 * Add extended data to the intent. The name must include a package 5127 * prefix, for example the app com.android.contacts would use names 5128 * like "com.android.contacts.ShowAll". 5129 * 5130 * @param name The name of the extra data, with package prefix. 5131 * @param value The boolean data value. 5132 * 5133 * @return Returns the same Intent object, for chaining multiple calls 5134 * into a single statement. 5135 * 5136 * @see #putExtras 5137 * @see #removeExtra 5138 * @see #getBooleanExtra(String, boolean) 5139 */ 5140 public Intent putExtra(String name, boolean value) { 5141 if (mExtras == null) { 5142 mExtras = new Bundle(); 5143 } 5144 mExtras.putBoolean(name, value); 5145 return this; 5146 } 5147 5148 /** 5149 * Add extended data to the intent. The name must include a package 5150 * prefix, for example the app com.android.contacts would use names 5151 * like "com.android.contacts.ShowAll". 5152 * 5153 * @param name The name of the extra data, with package prefix. 5154 * @param value The byte data value. 5155 * 5156 * @return Returns the same Intent object, for chaining multiple calls 5157 * into a single statement. 5158 * 5159 * @see #putExtras 5160 * @see #removeExtra 5161 * @see #getByteExtra(String, byte) 5162 */ 5163 public Intent putExtra(String name, byte value) { 5164 if (mExtras == null) { 5165 mExtras = new Bundle(); 5166 } 5167 mExtras.putByte(name, value); 5168 return this; 5169 } 5170 5171 /** 5172 * Add extended data to the intent. The name must include a package 5173 * prefix, for example the app com.android.contacts would use names 5174 * like "com.android.contacts.ShowAll". 5175 * 5176 * @param name The name of the extra data, with package prefix. 5177 * @param value The char data value. 5178 * 5179 * @return Returns the same Intent object, for chaining multiple calls 5180 * into a single statement. 5181 * 5182 * @see #putExtras 5183 * @see #removeExtra 5184 * @see #getCharExtra(String, char) 5185 */ 5186 public Intent putExtra(String name, char value) { 5187 if (mExtras == null) { 5188 mExtras = new Bundle(); 5189 } 5190 mExtras.putChar(name, value); 5191 return this; 5192 } 5193 5194 /** 5195 * Add extended data to the intent. The name must include a package 5196 * prefix, for example the app com.android.contacts would use names 5197 * like "com.android.contacts.ShowAll". 5198 * 5199 * @param name The name of the extra data, with package prefix. 5200 * @param value The short data value. 5201 * 5202 * @return Returns the same Intent object, for chaining multiple calls 5203 * into a single statement. 5204 * 5205 * @see #putExtras 5206 * @see #removeExtra 5207 * @see #getShortExtra(String, short) 5208 */ 5209 public Intent putExtra(String name, short value) { 5210 if (mExtras == null) { 5211 mExtras = new Bundle(); 5212 } 5213 mExtras.putShort(name, value); 5214 return this; 5215 } 5216 5217 /** 5218 * Add extended data to the intent. The name must include a package 5219 * prefix, for example the app com.android.contacts would use names 5220 * like "com.android.contacts.ShowAll". 5221 * 5222 * @param name The name of the extra data, with package prefix. 5223 * @param value The integer data value. 5224 * 5225 * @return Returns the same Intent object, for chaining multiple calls 5226 * into a single statement. 5227 * 5228 * @see #putExtras 5229 * @see #removeExtra 5230 * @see #getIntExtra(String, int) 5231 */ 5232 public Intent putExtra(String name, int value) { 5233 if (mExtras == null) { 5234 mExtras = new Bundle(); 5235 } 5236 mExtras.putInt(name, value); 5237 return this; 5238 } 5239 5240 /** 5241 * Add extended data to the intent. The name must include a package 5242 * prefix, for example the app com.android.contacts would use names 5243 * like "com.android.contacts.ShowAll". 5244 * 5245 * @param name The name of the extra data, with package prefix. 5246 * @param value The long data value. 5247 * 5248 * @return Returns the same Intent object, for chaining multiple calls 5249 * into a single statement. 5250 * 5251 * @see #putExtras 5252 * @see #removeExtra 5253 * @see #getLongExtra(String, long) 5254 */ 5255 public Intent putExtra(String name, long value) { 5256 if (mExtras == null) { 5257 mExtras = new Bundle(); 5258 } 5259 mExtras.putLong(name, value); 5260 return this; 5261 } 5262 5263 /** 5264 * Add extended data to the intent. The name must include a package 5265 * prefix, for example the app com.android.contacts would use names 5266 * like "com.android.contacts.ShowAll". 5267 * 5268 * @param name The name of the extra data, with package prefix. 5269 * @param value The float data value. 5270 * 5271 * @return Returns the same Intent object, for chaining multiple calls 5272 * into a single statement. 5273 * 5274 * @see #putExtras 5275 * @see #removeExtra 5276 * @see #getFloatExtra(String, float) 5277 */ 5278 public Intent putExtra(String name, float value) { 5279 if (mExtras == null) { 5280 mExtras = new Bundle(); 5281 } 5282 mExtras.putFloat(name, value); 5283 return this; 5284 } 5285 5286 /** 5287 * Add extended data to the intent. The name must include a package 5288 * prefix, for example the app com.android.contacts would use names 5289 * like "com.android.contacts.ShowAll". 5290 * 5291 * @param name The name of the extra data, with package prefix. 5292 * @param value The double data value. 5293 * 5294 * @return Returns the same Intent object, for chaining multiple calls 5295 * into a single statement. 5296 * 5297 * @see #putExtras 5298 * @see #removeExtra 5299 * @see #getDoubleExtra(String, double) 5300 */ 5301 public Intent putExtra(String name, double value) { 5302 if (mExtras == null) { 5303 mExtras = new Bundle(); 5304 } 5305 mExtras.putDouble(name, value); 5306 return this; 5307 } 5308 5309 /** 5310 * Add extended data to the intent. The name must include a package 5311 * prefix, for example the app com.android.contacts would use names 5312 * like "com.android.contacts.ShowAll". 5313 * 5314 * @param name The name of the extra data, with package prefix. 5315 * @param value The String data value. 5316 * 5317 * @return Returns the same Intent object, for chaining multiple calls 5318 * into a single statement. 5319 * 5320 * @see #putExtras 5321 * @see #removeExtra 5322 * @see #getStringExtra(String) 5323 */ 5324 public Intent putExtra(String name, String value) { 5325 if (mExtras == null) { 5326 mExtras = new Bundle(); 5327 } 5328 mExtras.putString(name, value); 5329 return this; 5330 } 5331 5332 /** 5333 * Add extended data to the intent. The name must include a package 5334 * prefix, for example the app com.android.contacts would use names 5335 * like "com.android.contacts.ShowAll". 5336 * 5337 * @param name The name of the extra data, with package prefix. 5338 * @param value The CharSequence data value. 5339 * 5340 * @return Returns the same Intent object, for chaining multiple calls 5341 * into a single statement. 5342 * 5343 * @see #putExtras 5344 * @see #removeExtra 5345 * @see #getCharSequenceExtra(String) 5346 */ 5347 public Intent putExtra(String name, CharSequence value) { 5348 if (mExtras == null) { 5349 mExtras = new Bundle(); 5350 } 5351 mExtras.putCharSequence(name, value); 5352 return this; 5353 } 5354 5355 /** 5356 * Add extended data to the intent. The name must include a package 5357 * prefix, for example the app com.android.contacts would use names 5358 * like "com.android.contacts.ShowAll". 5359 * 5360 * @param name The name of the extra data, with package prefix. 5361 * @param value The Parcelable data value. 5362 * 5363 * @return Returns the same Intent object, for chaining multiple calls 5364 * into a single statement. 5365 * 5366 * @see #putExtras 5367 * @see #removeExtra 5368 * @see #getParcelableExtra(String) 5369 */ 5370 public Intent putExtra(String name, Parcelable value) { 5371 if (mExtras == null) { 5372 mExtras = new Bundle(); 5373 } 5374 mExtras.putParcelable(name, value); 5375 return this; 5376 } 5377 5378 /** 5379 * Add extended data to the intent. The name must include a package 5380 * prefix, for example the app com.android.contacts would use names 5381 * like "com.android.contacts.ShowAll". 5382 * 5383 * @param name The name of the extra data, with package prefix. 5384 * @param value The Parcelable[] data value. 5385 * 5386 * @return Returns the same Intent object, for chaining multiple calls 5387 * into a single statement. 5388 * 5389 * @see #putExtras 5390 * @see #removeExtra 5391 * @see #getParcelableArrayExtra(String) 5392 */ 5393 public Intent putExtra(String name, Parcelable[] value) { 5394 if (mExtras == null) { 5395 mExtras = new Bundle(); 5396 } 5397 mExtras.putParcelableArray(name, value); 5398 return this; 5399 } 5400 5401 /** 5402 * Add extended data to the intent. The name must include a package 5403 * prefix, for example the app com.android.contacts would use names 5404 * like "com.android.contacts.ShowAll". 5405 * 5406 * @param name The name of the extra data, with package prefix. 5407 * @param value The ArrayList<Parcelable> data value. 5408 * 5409 * @return Returns the same Intent object, for chaining multiple calls 5410 * into a single statement. 5411 * 5412 * @see #putExtras 5413 * @see #removeExtra 5414 * @see #getParcelableArrayListExtra(String) 5415 */ 5416 public Intent putParcelableArrayListExtra(String name, ArrayList<? extends Parcelable> value) { 5417 if (mExtras == null) { 5418 mExtras = new Bundle(); 5419 } 5420 mExtras.putParcelableArrayList(name, value); 5421 return this; 5422 } 5423 5424 /** 5425 * Add extended data to the intent. The name must include a package 5426 * prefix, for example the app com.android.contacts would use names 5427 * like "com.android.contacts.ShowAll". 5428 * 5429 * @param name The name of the extra data, with package prefix. 5430 * @param value The ArrayList<Integer> data value. 5431 * 5432 * @return Returns the same Intent object, for chaining multiple calls 5433 * into a single statement. 5434 * 5435 * @see #putExtras 5436 * @see #removeExtra 5437 * @see #getIntegerArrayListExtra(String) 5438 */ 5439 public Intent putIntegerArrayListExtra(String name, ArrayList<Integer> value) { 5440 if (mExtras == null) { 5441 mExtras = new Bundle(); 5442 } 5443 mExtras.putIntegerArrayList(name, value); 5444 return this; 5445 } 5446 5447 /** 5448 * Add extended data to the intent. The name must include a package 5449 * prefix, for example the app com.android.contacts would use names 5450 * like "com.android.contacts.ShowAll". 5451 * 5452 * @param name The name of the extra data, with package prefix. 5453 * @param value The ArrayList<String> data value. 5454 * 5455 * @return Returns the same Intent object, for chaining multiple calls 5456 * into a single statement. 5457 * 5458 * @see #putExtras 5459 * @see #removeExtra 5460 * @see #getStringArrayListExtra(String) 5461 */ 5462 public Intent putStringArrayListExtra(String name, ArrayList<String> value) { 5463 if (mExtras == null) { 5464 mExtras = new Bundle(); 5465 } 5466 mExtras.putStringArrayList(name, value); 5467 return this; 5468 } 5469 5470 /** 5471 * Add extended data to the intent. The name must include a package 5472 * prefix, for example the app com.android.contacts would use names 5473 * like "com.android.contacts.ShowAll". 5474 * 5475 * @param name The name of the extra data, with package prefix. 5476 * @param value The ArrayList<CharSequence> data value. 5477 * 5478 * @return Returns the same Intent object, for chaining multiple calls 5479 * into a single statement. 5480 * 5481 * @see #putExtras 5482 * @see #removeExtra 5483 * @see #getCharSequenceArrayListExtra(String) 5484 */ 5485 public Intent putCharSequenceArrayListExtra(String name, ArrayList<CharSequence> value) { 5486 if (mExtras == null) { 5487 mExtras = new Bundle(); 5488 } 5489 mExtras.putCharSequenceArrayList(name, value); 5490 return this; 5491 } 5492 5493 /** 5494 * Add extended data to the intent. The name must include a package 5495 * prefix, for example the app com.android.contacts would use names 5496 * like "com.android.contacts.ShowAll". 5497 * 5498 * @param name The name of the extra data, with package prefix. 5499 * @param value The Serializable data value. 5500 * 5501 * @return Returns the same Intent object, for chaining multiple calls 5502 * into a single statement. 5503 * 5504 * @see #putExtras 5505 * @see #removeExtra 5506 * @see #getSerializableExtra(String) 5507 */ 5508 public Intent putExtra(String name, Serializable value) { 5509 if (mExtras == null) { 5510 mExtras = new Bundle(); 5511 } 5512 mExtras.putSerializable(name, value); 5513 return this; 5514 } 5515 5516 /** 5517 * Add extended data to the intent. The name must include a package 5518 * prefix, for example the app com.android.contacts would use names 5519 * like "com.android.contacts.ShowAll". 5520 * 5521 * @param name The name of the extra data, with package prefix. 5522 * @param value The boolean array data value. 5523 * 5524 * @return Returns the same Intent object, for chaining multiple calls 5525 * into a single statement. 5526 * 5527 * @see #putExtras 5528 * @see #removeExtra 5529 * @see #getBooleanArrayExtra(String) 5530 */ 5531 public Intent putExtra(String name, boolean[] value) { 5532 if (mExtras == null) { 5533 mExtras = new Bundle(); 5534 } 5535 mExtras.putBooleanArray(name, value); 5536 return this; 5537 } 5538 5539 /** 5540 * Add extended data to the intent. The name must include a package 5541 * prefix, for example the app com.android.contacts would use names 5542 * like "com.android.contacts.ShowAll". 5543 * 5544 * @param name The name of the extra data, with package prefix. 5545 * @param value The byte array data value. 5546 * 5547 * @return Returns the same Intent object, for chaining multiple calls 5548 * into a single statement. 5549 * 5550 * @see #putExtras 5551 * @see #removeExtra 5552 * @see #getByteArrayExtra(String) 5553 */ 5554 public Intent putExtra(String name, byte[] value) { 5555 if (mExtras == null) { 5556 mExtras = new Bundle(); 5557 } 5558 mExtras.putByteArray(name, value); 5559 return this; 5560 } 5561 5562 /** 5563 * Add extended data to the intent. The name must include a package 5564 * prefix, for example the app com.android.contacts would use names 5565 * like "com.android.contacts.ShowAll". 5566 * 5567 * @param name The name of the extra data, with package prefix. 5568 * @param value The short array data value. 5569 * 5570 * @return Returns the same Intent object, for chaining multiple calls 5571 * into a single statement. 5572 * 5573 * @see #putExtras 5574 * @see #removeExtra 5575 * @see #getShortArrayExtra(String) 5576 */ 5577 public Intent putExtra(String name, short[] value) { 5578 if (mExtras == null) { 5579 mExtras = new Bundle(); 5580 } 5581 mExtras.putShortArray(name, value); 5582 return this; 5583 } 5584 5585 /** 5586 * Add extended data to the intent. The name must include a package 5587 * prefix, for example the app com.android.contacts would use names 5588 * like "com.android.contacts.ShowAll". 5589 * 5590 * @param name The name of the extra data, with package prefix. 5591 * @param value The char array data value. 5592 * 5593 * @return Returns the same Intent object, for chaining multiple calls 5594 * into a single statement. 5595 * 5596 * @see #putExtras 5597 * @see #removeExtra 5598 * @see #getCharArrayExtra(String) 5599 */ 5600 public Intent putExtra(String name, char[] value) { 5601 if (mExtras == null) { 5602 mExtras = new Bundle(); 5603 } 5604 mExtras.putCharArray(name, value); 5605 return this; 5606 } 5607 5608 /** 5609 * Add extended data to the intent. The name must include a package 5610 * prefix, for example the app com.android.contacts would use names 5611 * like "com.android.contacts.ShowAll". 5612 * 5613 * @param name The name of the extra data, with package prefix. 5614 * @param value The int array data value. 5615 * 5616 * @return Returns the same Intent object, for chaining multiple calls 5617 * into a single statement. 5618 * 5619 * @see #putExtras 5620 * @see #removeExtra 5621 * @see #getIntArrayExtra(String) 5622 */ 5623 public Intent putExtra(String name, int[] value) { 5624 if (mExtras == null) { 5625 mExtras = new Bundle(); 5626 } 5627 mExtras.putIntArray(name, value); 5628 return this; 5629 } 5630 5631 /** 5632 * Add extended data to the intent. The name must include a package 5633 * prefix, for example the app com.android.contacts would use names 5634 * like "com.android.contacts.ShowAll". 5635 * 5636 * @param name The name of the extra data, with package prefix. 5637 * @param value The byte array data value. 5638 * 5639 * @return Returns the same Intent object, for chaining multiple calls 5640 * into a single statement. 5641 * 5642 * @see #putExtras 5643 * @see #removeExtra 5644 * @see #getLongArrayExtra(String) 5645 */ 5646 public Intent putExtra(String name, long[] value) { 5647 if (mExtras == null) { 5648 mExtras = new Bundle(); 5649 } 5650 mExtras.putLongArray(name, value); 5651 return this; 5652 } 5653 5654 /** 5655 * Add extended data to the intent. The name must include a package 5656 * prefix, for example the app com.android.contacts would use names 5657 * like "com.android.contacts.ShowAll". 5658 * 5659 * @param name The name of the extra data, with package prefix. 5660 * @param value The float array data value. 5661 * 5662 * @return Returns the same Intent object, for chaining multiple calls 5663 * into a single statement. 5664 * 5665 * @see #putExtras 5666 * @see #removeExtra 5667 * @see #getFloatArrayExtra(String) 5668 */ 5669 public Intent putExtra(String name, float[] value) { 5670 if (mExtras == null) { 5671 mExtras = new Bundle(); 5672 } 5673 mExtras.putFloatArray(name, value); 5674 return this; 5675 } 5676 5677 /** 5678 * Add extended data to the intent. The name must include a package 5679 * prefix, for example the app com.android.contacts would use names 5680 * like "com.android.contacts.ShowAll". 5681 * 5682 * @param name The name of the extra data, with package prefix. 5683 * @param value The double array data value. 5684 * 5685 * @return Returns the same Intent object, for chaining multiple calls 5686 * into a single statement. 5687 * 5688 * @see #putExtras 5689 * @see #removeExtra 5690 * @see #getDoubleArrayExtra(String) 5691 */ 5692 public Intent putExtra(String name, double[] value) { 5693 if (mExtras == null) { 5694 mExtras = new Bundle(); 5695 } 5696 mExtras.putDoubleArray(name, value); 5697 return this; 5698 } 5699 5700 /** 5701 * Add extended data to the intent. The name must include a package 5702 * prefix, for example the app com.android.contacts would use names 5703 * like "com.android.contacts.ShowAll". 5704 * 5705 * @param name The name of the extra data, with package prefix. 5706 * @param value The String array data value. 5707 * 5708 * @return Returns the same Intent object, for chaining multiple calls 5709 * into a single statement. 5710 * 5711 * @see #putExtras 5712 * @see #removeExtra 5713 * @see #getStringArrayExtra(String) 5714 */ 5715 public Intent putExtra(String name, String[] value) { 5716 if (mExtras == null) { 5717 mExtras = new Bundle(); 5718 } 5719 mExtras.putStringArray(name, value); 5720 return this; 5721 } 5722 5723 /** 5724 * Add extended data to the intent. The name must include a package 5725 * prefix, for example the app com.android.contacts would use names 5726 * like "com.android.contacts.ShowAll". 5727 * 5728 * @param name The name of the extra data, with package prefix. 5729 * @param value The CharSequence array data value. 5730 * 5731 * @return Returns the same Intent object, for chaining multiple calls 5732 * into a single statement. 5733 * 5734 * @see #putExtras 5735 * @see #removeExtra 5736 * @see #getCharSequenceArrayExtra(String) 5737 */ 5738 public Intent putExtra(String name, CharSequence[] value) { 5739 if (mExtras == null) { 5740 mExtras = new Bundle(); 5741 } 5742 mExtras.putCharSequenceArray(name, value); 5743 return this; 5744 } 5745 5746 /** 5747 * Add extended data to the intent. The name must include a package 5748 * prefix, for example the app com.android.contacts would use names 5749 * like "com.android.contacts.ShowAll". 5750 * 5751 * @param name The name of the extra data, with package prefix. 5752 * @param value The Bundle data value. 5753 * 5754 * @return Returns the same Intent object, for chaining multiple calls 5755 * into a single statement. 5756 * 5757 * @see #putExtras 5758 * @see #removeExtra 5759 * @see #getBundleExtra(String) 5760 */ 5761 public Intent putExtra(String name, Bundle value) { 5762 if (mExtras == null) { 5763 mExtras = new Bundle(); 5764 } 5765 mExtras.putBundle(name, value); 5766 return this; 5767 } 5768 5769 /** 5770 * Add extended data to the intent. The name must include a package 5771 * prefix, for example the app com.android.contacts would use names 5772 * like "com.android.contacts.ShowAll". 5773 * 5774 * @param name The name of the extra data, with package prefix. 5775 * @param value The IBinder data value. 5776 * 5777 * @return Returns the same Intent object, for chaining multiple calls 5778 * into a single statement. 5779 * 5780 * @see #putExtras 5781 * @see #removeExtra 5782 * @see #getIBinderExtra(String) 5783 * 5784 * @deprecated 5785 * @hide 5786 */ 5787 @Deprecated 5788 public Intent putExtra(String name, IBinder value) { 5789 if (mExtras == null) { 5790 mExtras = new Bundle(); 5791 } 5792 mExtras.putIBinder(name, value); 5793 return this; 5794 } 5795 5796 /** 5797 * Copy all extras in 'src' in to this intent. 5798 * 5799 * @param src Contains the extras to copy. 5800 * 5801 * @see #putExtra 5802 */ 5803 public Intent putExtras(Intent src) { 5804 if (src.mExtras != null) { 5805 if (mExtras == null) { 5806 mExtras = new Bundle(src.mExtras); 5807 } else { 5808 mExtras.putAll(src.mExtras); 5809 } 5810 } 5811 return this; 5812 } 5813 5814 /** 5815 * Add a set of extended data to the intent. The keys must include a package 5816 * prefix, for example the app com.android.contacts would use names 5817 * like "com.android.contacts.ShowAll". 5818 * 5819 * @param extras The Bundle of extras to add to this intent. 5820 * 5821 * @see #putExtra 5822 * @see #removeExtra 5823 */ 5824 public Intent putExtras(Bundle extras) { 5825 if (mExtras == null) { 5826 mExtras = new Bundle(); 5827 } 5828 mExtras.putAll(extras); 5829 return this; 5830 } 5831 5832 /** 5833 * Completely replace the extras in the Intent with the extras in the 5834 * given Intent. 5835 * 5836 * @param src The exact extras contained in this Intent are copied 5837 * into the target intent, replacing any that were previously there. 5838 */ 5839 public Intent replaceExtras(Intent src) { 5840 mExtras = src.mExtras != null ? new Bundle(src.mExtras) : null; 5841 return this; 5842 } 5843 5844 /** 5845 * Completely replace the extras in the Intent with the given Bundle of 5846 * extras. 5847 * 5848 * @param extras The new set of extras in the Intent, or null to erase 5849 * all extras. 5850 */ 5851 public Intent replaceExtras(Bundle extras) { 5852 mExtras = extras != null ? new Bundle(extras) : null; 5853 return this; 5854 } 5855 5856 /** 5857 * Remove extended data from the intent. 5858 * 5859 * @see #putExtra 5860 */ 5861 public void removeExtra(String name) { 5862 if (mExtras != null) { 5863 mExtras.remove(name); 5864 if (mExtras.size() == 0) { 5865 mExtras = null; 5866 } 5867 } 5868 } 5869 5870 /** 5871 * Set special flags controlling how this intent is handled. Most values 5872 * here depend on the type of component being executed by the Intent, 5873 * specifically the FLAG_ACTIVITY_* flags are all for use with 5874 * {@link Context#startActivity Context.startActivity()} and the 5875 * FLAG_RECEIVER_* flags are all for use with 5876 * {@link Context#sendBroadcast(Intent) Context.sendBroadcast()}. 5877 * 5878 * <p>See the 5879 * <a href="{@docRoot}guide/topics/fundamentals/tasks-and-back-stack.html">Tasks and Back 5880 * Stack</a> documentation for important information on how some of these options impact 5881 * the behavior of your application. 5882 * 5883 * @param flags The desired flags. 5884 * 5885 * @return Returns the same Intent object, for chaining multiple calls 5886 * into a single statement. 5887 * 5888 * @see #getFlags 5889 * @see #addFlags 5890 * 5891 * @see #FLAG_GRANT_READ_URI_PERMISSION 5892 * @see #FLAG_GRANT_WRITE_URI_PERMISSION 5893 * @see #FLAG_DEBUG_LOG_RESOLUTION 5894 * @see #FLAG_FROM_BACKGROUND 5895 * @see #FLAG_ACTIVITY_BROUGHT_TO_FRONT 5896 * @see #FLAG_ACTIVITY_CLEAR_TASK 5897 * @see #FLAG_ACTIVITY_CLEAR_TOP 5898 * @see #FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET 5899 * @see #FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS 5900 * @see #FLAG_ACTIVITY_FORWARD_RESULT 5901 * @see #FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY 5902 * @see #FLAG_ACTIVITY_MULTIPLE_TASK 5903 * @see #FLAG_ACTIVITY_NEW_TASK 5904 * @see #FLAG_ACTIVITY_NO_ANIMATION 5905 * @see #FLAG_ACTIVITY_NO_HISTORY 5906 * @see #FLAG_ACTIVITY_NO_USER_ACTION 5907 * @see #FLAG_ACTIVITY_PREVIOUS_IS_TOP 5908 * @see #FLAG_ACTIVITY_RESET_TASK_IF_NEEDED 5909 * @see #FLAG_ACTIVITY_REORDER_TO_FRONT 5910 * @see #FLAG_ACTIVITY_SINGLE_TOP 5911 * @see #FLAG_ACTIVITY_TASK_ON_HOME 5912 * @see #FLAG_RECEIVER_REGISTERED_ONLY 5913 */ 5914 public Intent setFlags(int flags) { 5915 mFlags = flags; 5916 return this; 5917 } 5918 5919 /** 5920 * Add additional flags to the intent (or with existing flags 5921 * value). 5922 * 5923 * @param flags The new flags to set. 5924 * 5925 * @return Returns the same Intent object, for chaining multiple calls 5926 * into a single statement. 5927 * 5928 * @see #setFlags 5929 */ 5930 public Intent addFlags(int flags) { 5931 mFlags |= flags; 5932 return this; 5933 } 5934 5935 /** 5936 * (Usually optional) Set an explicit application package name that limits 5937 * the components this Intent will resolve to. If left to the default 5938 * value of null, all components in all applications will considered. 5939 * If non-null, the Intent can only match the components in the given 5940 * application package. 5941 * 5942 * @param packageName The name of the application package to handle the 5943 * intent, or null to allow any application package. 5944 * 5945 * @return Returns the same Intent object, for chaining multiple calls 5946 * into a single statement. 5947 * 5948 * @see #getPackage 5949 * @see #resolveActivity 5950 */ 5951 public Intent setPackage(String packageName) { 5952 if (packageName != null && mSelector != null) { 5953 throw new IllegalArgumentException( 5954 "Can't set package name when selector is already set"); 5955 } 5956 mPackage = packageName; 5957 return this; 5958 } 5959 5960 /** 5961 * (Usually optional) Explicitly set the component to handle the intent. 5962 * If left with the default value of null, the system will determine the 5963 * appropriate class to use based on the other fields (action, data, 5964 * type, categories) in the Intent. If this class is defined, the 5965 * specified class will always be used regardless of the other fields. You 5966 * should only set this value when you know you absolutely want a specific 5967 * class to be used; otherwise it is better to let the system find the 5968 * appropriate class so that you will respect the installed applications 5969 * and user preferences. 5970 * 5971 * @param component The name of the application component to handle the 5972 * intent, or null to let the system find one for you. 5973 * 5974 * @return Returns the same Intent object, for chaining multiple calls 5975 * into a single statement. 5976 * 5977 * @see #setClass 5978 * @see #setClassName(Context, String) 5979 * @see #setClassName(String, String) 5980 * @see #getComponent 5981 * @see #resolveActivity 5982 */ 5983 public Intent setComponent(ComponentName component) { 5984 mComponent = component; 5985 return this; 5986 } 5987 5988 /** 5989 * Convenience for calling {@link #setComponent} with an 5990 * explicit class name. 5991 * 5992 * @param packageContext A Context of the application package implementing 5993 * this class. 5994 * @param className The name of a class inside of the application package 5995 * that will be used as the component for this Intent. 5996 * 5997 * @return Returns the same Intent object, for chaining multiple calls 5998 * into a single statement. 5999 * 6000 * @see #setComponent 6001 * @see #setClass 6002 */ 6003 public Intent setClassName(Context packageContext, String className) { 6004 mComponent = new ComponentName(packageContext, className); 6005 return this; 6006 } 6007 6008 /** 6009 * Convenience for calling {@link #setComponent} with an 6010 * explicit application package name and class name. 6011 * 6012 * @param packageName The name of the package implementing the desired 6013 * component. 6014 * @param className The name of a class inside of the application package 6015 * that will be used as the component for this Intent. 6016 * 6017 * @return Returns the same Intent object, for chaining multiple calls 6018 * into a single statement. 6019 * 6020 * @see #setComponent 6021 * @see #setClass 6022 */ 6023 public Intent setClassName(String packageName, String className) { 6024 mComponent = new ComponentName(packageName, className); 6025 return this; 6026 } 6027 6028 /** 6029 * Convenience for calling {@link #setComponent(ComponentName)} with the 6030 * name returned by a {@link Class} object. 6031 * 6032 * @param packageContext A Context of the application package implementing 6033 * this class. 6034 * @param cls The class name to set, equivalent to 6035 * <code>setClassName(context, cls.getName())</code>. 6036 * 6037 * @return Returns the same Intent object, for chaining multiple calls 6038 * into a single statement. 6039 * 6040 * @see #setComponent 6041 */ 6042 public Intent setClass(Context packageContext, Class<?> cls) { 6043 mComponent = new ComponentName(packageContext, cls); 6044 return this; 6045 } 6046 6047 /** 6048 * Set the bounds of the sender of this intent, in screen coordinates. This can be 6049 * used as a hint to the receiver for animations and the like. Null means that there 6050 * is no source bounds. 6051 */ 6052 public void setSourceBounds(Rect r) { 6053 if (r != null) { 6054 mSourceBounds = new Rect(r); 6055 } else { 6056 mSourceBounds = null; 6057 } 6058 } 6059 6060 /** 6061 * Use with {@link #fillIn} to allow the current action value to be 6062 * overwritten, even if it is already set. 6063 */ 6064 public static final int FILL_IN_ACTION = 1<<0; 6065 6066 /** 6067 * Use with {@link #fillIn} to allow the current data or type value 6068 * overwritten, even if it is already set. 6069 */ 6070 public static final int FILL_IN_DATA = 1<<1; 6071 6072 /** 6073 * Use with {@link #fillIn} to allow the current categories to be 6074 * overwritten, even if they are already set. 6075 */ 6076 public static final int FILL_IN_CATEGORIES = 1<<2; 6077 6078 /** 6079 * Use with {@link #fillIn} to allow the current component value to be 6080 * overwritten, even if it is already set. 6081 */ 6082 public static final int FILL_IN_COMPONENT = 1<<3; 6083 6084 /** 6085 * Use with {@link #fillIn} to allow the current package value to be 6086 * overwritten, even if it is already set. 6087 */ 6088 public static final int FILL_IN_PACKAGE = 1<<4; 6089 6090 /** 6091 * Use with {@link #fillIn} to allow the current bounds rectangle to be 6092 * overwritten, even if it is already set. 6093 */ 6094 public static final int FILL_IN_SOURCE_BOUNDS = 1<<5; 6095 6096 /** 6097 * Use with {@link #fillIn} to allow the current selector to be 6098 * overwritten, even if it is already set. 6099 */ 6100 public static final int FILL_IN_SELECTOR = 1<<6; 6101 6102 /** 6103 * Use with {@link #fillIn} to allow the current ClipData to be 6104 * overwritten, even if it is already set. 6105 */ 6106 public static final int FILL_IN_CLIP_DATA = 1<<7; 6107 6108 /** 6109 * Copy the contents of <var>other</var> in to this object, but only 6110 * where fields are not defined by this object. For purposes of a field 6111 * being defined, the following pieces of data in the Intent are 6112 * considered to be separate fields: 6113 * 6114 * <ul> 6115 * <li> action, as set by {@link #setAction}. 6116 * <li> data Uri and MIME type, as set by {@link #setData(Uri)}, 6117 * {@link #setType(String)}, or {@link #setDataAndType(Uri, String)}. 6118 * <li> categories, as set by {@link #addCategory}. 6119 * <li> package, as set by {@link #setPackage}. 6120 * <li> component, as set by {@link #setComponent(ComponentName)} or 6121 * related methods. 6122 * <li> source bounds, as set by {@link #setSourceBounds}. 6123 * <li> selector, as set by {@link #setSelector(Intent)}. 6124 * <li> clip data, as set by {@link #setClipData(ClipData)}. 6125 * <li> each top-level name in the associated extras. 6126 * </ul> 6127 * 6128 * <p>In addition, you can use the {@link #FILL_IN_ACTION}, 6129 * {@link #FILL_IN_DATA}, {@link #FILL_IN_CATEGORIES}, {@link #FILL_IN_PACKAGE}, 6130 * {@link #FILL_IN_COMPONENT}, {@link #FILL_IN_SOURCE_BOUNDS}, 6131 * {@link #FILL_IN_SELECTOR}, and {@link #FILL_IN_CLIP_DATA} to override 6132 * the restriction where the corresponding field will not be replaced if 6133 * it is already set. 6134 * 6135 * <p>Note: The component field will only be copied if {@link #FILL_IN_COMPONENT} 6136 * is explicitly specified. The selector will only be copied if 6137 * {@link #FILL_IN_SELECTOR} is explicitly specified. 6138 * 6139 * <p>For example, consider Intent A with {data="foo", categories="bar"} 6140 * and Intent B with {action="gotit", data-type="some/thing", 6141 * categories="one","two"}. 6142 * 6143 * <p>Calling A.fillIn(B, Intent.FILL_IN_DATA) will result in A now 6144 * containing: {action="gotit", data-type="some/thing", 6145 * categories="bar"}. 6146 * 6147 * @param other Another Intent whose values are to be used to fill in 6148 * the current one. 6149 * @param flags Options to control which fields can be filled in. 6150 * 6151 * @return Returns a bit mask of {@link #FILL_IN_ACTION}, 6152 * {@link #FILL_IN_DATA}, {@link #FILL_IN_CATEGORIES}, {@link #FILL_IN_PACKAGE}, 6153 * {@link #FILL_IN_COMPONENT}, {@link #FILL_IN_SOURCE_BOUNDS}, and 6154 * {@link #FILL_IN_SELECTOR} indicating which fields were changed. 6155 */ 6156 public int fillIn(Intent other, int flags) { 6157 int changes = 0; 6158 if (other.mAction != null 6159 && (mAction == null || (flags&FILL_IN_ACTION) != 0)) { 6160 mAction = other.mAction; 6161 changes |= FILL_IN_ACTION; 6162 } 6163 if ((other.mData != null || other.mType != null) 6164 && ((mData == null && mType == null) 6165 || (flags&FILL_IN_DATA) != 0)) { 6166 mData = other.mData; 6167 mType = other.mType; 6168 changes |= FILL_IN_DATA; 6169 } 6170 if (other.mCategories != null 6171 && (mCategories == null || (flags&FILL_IN_CATEGORIES) != 0)) { 6172 if (other.mCategories != null) { 6173 mCategories = new HashSet<String>(other.mCategories); 6174 } 6175 changes |= FILL_IN_CATEGORIES; 6176 } 6177 if (other.mPackage != null 6178 && (mPackage == null || (flags&FILL_IN_PACKAGE) != 0)) { 6179 // Only do this if mSelector is not set. 6180 if (mSelector == null) { 6181 mPackage = other.mPackage; 6182 changes |= FILL_IN_PACKAGE; 6183 } 6184 } 6185 // Selector is special: it can only be set if explicitly allowed, 6186 // for the same reason as the component name. 6187 if (other.mSelector != null && (flags&FILL_IN_SELECTOR) != 0) { 6188 if (mPackage == null) { 6189 mSelector = new Intent(other.mSelector); 6190 mPackage = null; 6191 changes |= FILL_IN_SELECTOR; 6192 } 6193 } 6194 if (other.mClipData != null 6195 && (mClipData == null || (flags&FILL_IN_CLIP_DATA) != 0)) { 6196 mClipData = other.mClipData; 6197 changes |= FILL_IN_CLIP_DATA; 6198 } 6199 // Component is special: it can -only- be set if explicitly allowed, 6200 // since otherwise the sender could force the intent somewhere the 6201 // originator didn't intend. 6202 if (other.mComponent != null && (flags&FILL_IN_COMPONENT) != 0) { 6203 mComponent = other.mComponent; 6204 changes |= FILL_IN_COMPONENT; 6205 } 6206 mFlags |= other.mFlags; 6207 if (other.mSourceBounds != null 6208 && (mSourceBounds == null || (flags&FILL_IN_SOURCE_BOUNDS) != 0)) { 6209 mSourceBounds = new Rect(other.mSourceBounds); 6210 changes |= FILL_IN_SOURCE_BOUNDS; 6211 } 6212 if (mExtras == null) { 6213 if (other.mExtras != null) { 6214 mExtras = new Bundle(other.mExtras); 6215 } 6216 } else if (other.mExtras != null) { 6217 try { 6218 Bundle newb = new Bundle(other.mExtras); 6219 newb.putAll(mExtras); 6220 mExtras = newb; 6221 } catch (RuntimeException e) { 6222 // Modifying the extras can cause us to unparcel the contents 6223 // of the bundle, and if we do this in the system process that 6224 // may fail. We really should handle this (i.e., the Bundle 6225 // impl shouldn't be on top of a plain map), but for now just 6226 // ignore it and keep the original contents. :( 6227 Log.w("Intent", "Failure filling in extras", e); 6228 } 6229 } 6230 return changes; 6231 } 6232 6233 /** 6234 * Wrapper class holding an Intent and implementing comparisons on it for 6235 * the purpose of filtering. The class implements its 6236 * {@link #equals equals()} and {@link #hashCode hashCode()} methods as 6237 * simple calls to {@link Intent#filterEquals(Intent)} filterEquals()} and 6238 * {@link android.content.Intent#filterHashCode()} filterHashCode()} 6239 * on the wrapped Intent. 6240 */ 6241 public static final class FilterComparison { 6242 private final Intent mIntent; 6243 private final int mHashCode; 6244 6245 public FilterComparison(Intent intent) { 6246 mIntent = intent; 6247 mHashCode = intent.filterHashCode(); 6248 } 6249 6250 /** 6251 * Return the Intent that this FilterComparison represents. 6252 * @return Returns the Intent held by the FilterComparison. Do 6253 * not modify! 6254 */ 6255 public Intent getIntent() { 6256 return mIntent; 6257 } 6258 6259 @Override 6260 public boolean equals(Object obj) { 6261 if (obj instanceof FilterComparison) { 6262 Intent other = ((FilterComparison)obj).mIntent; 6263 return mIntent.filterEquals(other); 6264 } 6265 return false; 6266 } 6267 6268 @Override 6269 public int hashCode() { 6270 return mHashCode; 6271 } 6272 } 6273 6274 /** 6275 * Determine if two intents are the same for the purposes of intent 6276 * resolution (filtering). That is, if their action, data, type, 6277 * class, and categories are the same. This does <em>not</em> compare 6278 * any extra data included in the intents. 6279 * 6280 * @param other The other Intent to compare against. 6281 * 6282 * @return Returns true if action, data, type, class, and categories 6283 * are the same. 6284 */ 6285 public boolean filterEquals(Intent other) { 6286 if (other == null) { 6287 return false; 6288 } 6289 if (mAction != other.mAction) { 6290 if (mAction != null) { 6291 if (!mAction.equals(other.mAction)) { 6292 return false; 6293 } 6294 } else { 6295 if (!other.mAction.equals(mAction)) { 6296 return false; 6297 } 6298 } 6299 } 6300 if (mData != other.mData) { 6301 if (mData != null) { 6302 if (!mData.equals(other.mData)) { 6303 return false; 6304 } 6305 } else { 6306 if (!other.mData.equals(mData)) { 6307 return false; 6308 } 6309 } 6310 } 6311 if (mType != other.mType) { 6312 if (mType != null) { 6313 if (!mType.equals(other.mType)) { 6314 return false; 6315 } 6316 } else { 6317 if (!other.mType.equals(mType)) { 6318 return false; 6319 } 6320 } 6321 } 6322 if (mPackage != other.mPackage) { 6323 if (mPackage != null) { 6324 if (!mPackage.equals(other.mPackage)) { 6325 return false; 6326 } 6327 } else { 6328 if (!other.mPackage.equals(mPackage)) { 6329 return false; 6330 } 6331 } 6332 } 6333 if (mComponent != other.mComponent) { 6334 if (mComponent != null) { 6335 if (!mComponent.equals(other.mComponent)) { 6336 return false; 6337 } 6338 } else { 6339 if (!other.mComponent.equals(mComponent)) { 6340 return false; 6341 } 6342 } 6343 } 6344 if (mCategories != other.mCategories) { 6345 if (mCategories != null) { 6346 if (!mCategories.equals(other.mCategories)) { 6347 return false; 6348 } 6349 } else { 6350 if (!other.mCategories.equals(mCategories)) { 6351 return false; 6352 } 6353 } 6354 } 6355 6356 return true; 6357 } 6358 6359 /** 6360 * Generate hash code that matches semantics of filterEquals(). 6361 * 6362 * @return Returns the hash value of the action, data, type, class, and 6363 * categories. 6364 * 6365 * @see #filterEquals 6366 */ 6367 public int filterHashCode() { 6368 int code = 0; 6369 if (mAction != null) { 6370 code += mAction.hashCode(); 6371 } 6372 if (mData != null) { 6373 code += mData.hashCode(); 6374 } 6375 if (mType != null) { 6376 code += mType.hashCode(); 6377 } 6378 if (mPackage != null) { 6379 code += mPackage.hashCode(); 6380 } 6381 if (mComponent != null) { 6382 code += mComponent.hashCode(); 6383 } 6384 if (mCategories != null) { 6385 code += mCategories.hashCode(); 6386 } 6387 return code; 6388 } 6389 6390 @Override 6391 public String toString() { 6392 StringBuilder b = new StringBuilder(128); 6393 6394 b.append("Intent { "); 6395 toShortString(b, true, true, true, false); 6396 b.append(" }"); 6397 6398 return b.toString(); 6399 } 6400 6401 /** @hide */ 6402 public String toInsecureString() { 6403 StringBuilder b = new StringBuilder(128); 6404 6405 b.append("Intent { "); 6406 toShortString(b, false, true, true, false); 6407 b.append(" }"); 6408 6409 return b.toString(); 6410 } 6411 6412 /** @hide */ 6413 public String toInsecureStringWithClip() { 6414 StringBuilder b = new StringBuilder(128); 6415 6416 b.append("Intent { "); 6417 toShortString(b, false, true, true, true); 6418 b.append(" }"); 6419 6420 return b.toString(); 6421 } 6422 6423 /** @hide */ 6424 public String toShortString(boolean secure, boolean comp, boolean extras, boolean clip) { 6425 StringBuilder b = new StringBuilder(128); 6426 toShortString(b, secure, comp, extras, clip); 6427 return b.toString(); 6428 } 6429 6430 /** @hide */ 6431 public void toShortString(StringBuilder b, boolean secure, boolean comp, boolean extras, 6432 boolean clip) { 6433 boolean first = true; 6434 if (mAction != null) { 6435 b.append("act=").append(mAction); 6436 first = false; 6437 } 6438 if (mCategories != null) { 6439 if (!first) { 6440 b.append(' '); 6441 } 6442 first = false; 6443 b.append("cat=["); 6444 Iterator<String> i = mCategories.iterator(); 6445 boolean didone = false; 6446 while (i.hasNext()) { 6447 if (didone) b.append(","); 6448 didone = true; 6449 b.append(i.next()); 6450 } 6451 b.append("]"); 6452 } 6453 if (mData != null) { 6454 if (!first) { 6455 b.append(' '); 6456 } 6457 first = false; 6458 b.append("dat="); 6459 if (secure) { 6460 b.append(mData.toSafeString()); 6461 } else { 6462 b.append(mData); 6463 } 6464 } 6465 if (mType != null) { 6466 if (!first) { 6467 b.append(' '); 6468 } 6469 first = false; 6470 b.append("typ=").append(mType); 6471 } 6472 if (mFlags != 0) { 6473 if (!first) { 6474 b.append(' '); 6475 } 6476 first = false; 6477 b.append("flg=0x").append(Integer.toHexString(mFlags)); 6478 } 6479 if (mPackage != null) { 6480 if (!first) { 6481 b.append(' '); 6482 } 6483 first = false; 6484 b.append("pkg=").append(mPackage); 6485 } 6486 if (comp && mComponent != null) { 6487 if (!first) { 6488 b.append(' '); 6489 } 6490 first = false; 6491 b.append("cmp=").append(mComponent.flattenToShortString()); 6492 } 6493 if (mSourceBounds != null) { 6494 if (!first) { 6495 b.append(' '); 6496 } 6497 first = false; 6498 b.append("bnds=").append(mSourceBounds.toShortString()); 6499 } 6500 if (mClipData != null) { 6501 if (!first) { 6502 b.append(' '); 6503 } 6504 first = false; 6505 if (clip) { 6506 b.append("clip={"); 6507 mClipData.toShortString(b); 6508 b.append('}'); 6509 } else { 6510 b.append("(has clip)"); 6511 } 6512 } 6513 if (extras && mExtras != null) { 6514 if (!first) { 6515 b.append(' '); 6516 } 6517 first = false; 6518 b.append("(has extras)"); 6519 } 6520 if (mSelector != null) { 6521 b.append(" sel={"); 6522 mSelector.toShortString(b, secure, comp, extras, clip); 6523 b.append("}"); 6524 } 6525 } 6526 6527 /** 6528 * Call {@link #toUri} with 0 flags. 6529 * @deprecated Use {@link #toUri} instead. 6530 */ 6531 @Deprecated 6532 public String toURI() { 6533 return toUri(0); 6534 } 6535 6536 /** 6537 * Convert this Intent into a String holding a URI representation of it. 6538 * The returned URI string has been properly URI encoded, so it can be 6539 * used with {@link Uri#parse Uri.parse(String)}. The URI contains the 6540 * Intent's data as the base URI, with an additional fragment describing 6541 * the action, categories, type, flags, package, component, and extras. 6542 * 6543 * <p>You can convert the returned string back to an Intent with 6544 * {@link #getIntent}. 6545 * 6546 * @param flags Additional operating flags. Either 0 or 6547 * {@link #URI_INTENT_SCHEME}. 6548 * 6549 * @return Returns a URI encoding URI string describing the entire contents 6550 * of the Intent. 6551 */ 6552 public String toUri(int flags) { 6553 StringBuilder uri = new StringBuilder(128); 6554 String scheme = null; 6555 if (mData != null) { 6556 String data = mData.toString(); 6557 if ((flags&URI_INTENT_SCHEME) != 0) { 6558 final int N = data.length(); 6559 for (int i=0; i<N; i++) { 6560 char c = data.charAt(i); 6561 if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') 6562 || c == '.' || c == '-') { 6563 continue; 6564 } 6565 if (c == ':' && i > 0) { 6566 // Valid scheme. 6567 scheme = data.substring(0, i); 6568 uri.append("intent:"); 6569 data = data.substring(i+1); 6570 break; 6571 } 6572 6573 // No scheme. 6574 break; 6575 } 6576 } 6577 uri.append(data); 6578 6579 } else if ((flags&URI_INTENT_SCHEME) != 0) { 6580 uri.append("intent:"); 6581 } 6582 6583 uri.append("#Intent;"); 6584 6585 toUriInner(uri, scheme, flags); 6586 if (mSelector != null) { 6587 uri.append("SEL;"); 6588 // Note that for now we are not going to try to handle the 6589 // data part; not clear how to represent this as a URI, and 6590 // not much utility in it. 6591 mSelector.toUriInner(uri, null, flags); 6592 } 6593 6594 uri.append("end"); 6595 6596 return uri.toString(); 6597 } 6598 6599 private void toUriInner(StringBuilder uri, String scheme, int flags) { 6600 if (scheme != null) { 6601 uri.append("scheme=").append(scheme).append(';'); 6602 } 6603 if (mAction != null) { 6604 uri.append("action=").append(Uri.encode(mAction)).append(';'); 6605 } 6606 if (mCategories != null) { 6607 for (String category : mCategories) { 6608 uri.append("category=").append(Uri.encode(category)).append(';'); 6609 } 6610 } 6611 if (mType != null) { 6612 uri.append("type=").append(Uri.encode(mType, "/")).append(';'); 6613 } 6614 if (mFlags != 0) { 6615 uri.append("launchFlags=0x").append(Integer.toHexString(mFlags)).append(';'); 6616 } 6617 if (mPackage != null) { 6618 uri.append("package=").append(Uri.encode(mPackage)).append(';'); 6619 } 6620 if (mComponent != null) { 6621 uri.append("component=").append(Uri.encode( 6622 mComponent.flattenToShortString(), "/")).append(';'); 6623 } 6624 if (mSourceBounds != null) { 6625 uri.append("sourceBounds=") 6626 .append(Uri.encode(mSourceBounds.flattenToString())) 6627 .append(';'); 6628 } 6629 if (mExtras != null) { 6630 for (String key : mExtras.keySet()) { 6631 final Object value = mExtras.get(key); 6632 char entryType = 6633 value instanceof String ? 'S' : 6634 value instanceof Boolean ? 'B' : 6635 value instanceof Byte ? 'b' : 6636 value instanceof Character ? 'c' : 6637 value instanceof Double ? 'd' : 6638 value instanceof Float ? 'f' : 6639 value instanceof Integer ? 'i' : 6640 value instanceof Long ? 'l' : 6641 value instanceof Short ? 's' : 6642 '\0'; 6643 6644 if (entryType != '\0') { 6645 uri.append(entryType); 6646 uri.append('.'); 6647 uri.append(Uri.encode(key)); 6648 uri.append('='); 6649 uri.append(Uri.encode(value.toString())); 6650 uri.append(';'); 6651 } 6652 } 6653 } 6654 } 6655 6656 public int describeContents() { 6657 return (mExtras != null) ? mExtras.describeContents() : 0; 6658 } 6659 6660 public void writeToParcel(Parcel out, int flags) { 6661 out.writeString(mAction); 6662 Uri.writeToParcel(out, mData); 6663 out.writeString(mType); 6664 out.writeInt(mFlags); 6665 out.writeString(mPackage); 6666 ComponentName.writeToParcel(mComponent, out); 6667 6668 if (mSourceBounds != null) { 6669 out.writeInt(1); 6670 mSourceBounds.writeToParcel(out, flags); 6671 } else { 6672 out.writeInt(0); 6673 } 6674 6675 if (mCategories != null) { 6676 out.writeInt(mCategories.size()); 6677 for (String category : mCategories) { 6678 out.writeString(category); 6679 } 6680 } else { 6681 out.writeInt(0); 6682 } 6683 6684 if (mSelector != null) { 6685 out.writeInt(1); 6686 mSelector.writeToParcel(out, flags); 6687 } else { 6688 out.writeInt(0); 6689 } 6690 6691 if (mClipData != null) { 6692 out.writeInt(1); 6693 mClipData.writeToParcel(out, flags); 6694 } else { 6695 out.writeInt(0); 6696 } 6697 6698 out.writeBundle(mExtras); 6699 } 6700 6701 public static final Parcelable.Creator<Intent> CREATOR 6702 = new Parcelable.Creator<Intent>() { 6703 public Intent createFromParcel(Parcel in) { 6704 return new Intent(in); 6705 } 6706 public Intent[] newArray(int size) { 6707 return new Intent[size]; 6708 } 6709 }; 6710 6711 /** @hide */ 6712 protected Intent(Parcel in) { 6713 readFromParcel(in); 6714 } 6715 6716 public void readFromParcel(Parcel in) { 6717 setAction(in.readString()); 6718 mData = Uri.CREATOR.createFromParcel(in); 6719 mType = in.readString(); 6720 mFlags = in.readInt(); 6721 mPackage = in.readString(); 6722 mComponent = ComponentName.readFromParcel(in); 6723 6724 if (in.readInt() != 0) { 6725 mSourceBounds = Rect.CREATOR.createFromParcel(in); 6726 } 6727 6728 int N = in.readInt(); 6729 if (N > 0) { 6730 mCategories = new HashSet<String>(); 6731 int i; 6732 for (i=0; i<N; i++) { 6733 mCategories.add(in.readString().intern()); 6734 } 6735 } else { 6736 mCategories = null; 6737 } 6738 6739 if (in.readInt() != 0) { 6740 mSelector = new Intent(in); 6741 } 6742 6743 if (in.readInt() != 0) { 6744 mClipData = new ClipData(in); 6745 } 6746 6747 mExtras = in.readBundle(); 6748 } 6749 6750 /** 6751 * Parses the "intent" element (and its children) from XML and instantiates 6752 * an Intent object. The given XML parser should be located at the tag 6753 * where parsing should start (often named "intent"), from which the 6754 * basic action, data, type, and package and class name will be 6755 * retrieved. The function will then parse in to any child elements, 6756 * looking for <category android:name="xxx"> tags to add categories and 6757 * <extra android:name="xxx" android:value="yyy"> to attach extra data 6758 * to the intent. 6759 * 6760 * @param resources The Resources to use when inflating resources. 6761 * @param parser The XML parser pointing at an "intent" tag. 6762 * @param attrs The AttributeSet interface for retrieving extended 6763 * attribute data at the current <var>parser</var> location. 6764 * @return An Intent object matching the XML data. 6765 * @throws XmlPullParserException If there was an XML parsing error. 6766 * @throws IOException If there was an I/O error. 6767 */ 6768 public static Intent parseIntent(Resources resources, XmlPullParser parser, AttributeSet attrs) 6769 throws XmlPullParserException, IOException { 6770 Intent intent = new Intent(); 6771 6772 TypedArray sa = resources.obtainAttributes(attrs, 6773 com.android.internal.R.styleable.Intent); 6774 6775 intent.setAction(sa.getString(com.android.internal.R.styleable.Intent_action)); 6776 6777 String data = sa.getString(com.android.internal.R.styleable.Intent_data); 6778 String mimeType = sa.getString(com.android.internal.R.styleable.Intent_mimeType); 6779 intent.setDataAndType(data != null ? Uri.parse(data) : null, mimeType); 6780 6781 String packageName = sa.getString(com.android.internal.R.styleable.Intent_targetPackage); 6782 String className = sa.getString(com.android.internal.R.styleable.Intent_targetClass); 6783 if (packageName != null && className != null) { 6784 intent.setComponent(new ComponentName(packageName, className)); 6785 } 6786 6787 sa.recycle(); 6788 6789 int outerDepth = parser.getDepth(); 6790 int type; 6791 while ((type=parser.next()) != XmlPullParser.END_DOCUMENT 6792 && (type != XmlPullParser.END_TAG || parser.getDepth() > outerDepth)) { 6793 if (type == XmlPullParser.END_TAG || type == XmlPullParser.TEXT) { 6794 continue; 6795 } 6796 6797 String nodeName = parser.getName(); 6798 if (nodeName.equals("category")) { 6799 sa = resources.obtainAttributes(attrs, 6800 com.android.internal.R.styleable.IntentCategory); 6801 String cat = sa.getString(com.android.internal.R.styleable.IntentCategory_name); 6802 sa.recycle(); 6803 6804 if (cat != null) { 6805 intent.addCategory(cat); 6806 } 6807 XmlUtils.skipCurrentTag(parser); 6808 6809 } else if (nodeName.equals("extra")) { 6810 if (intent.mExtras == null) { 6811 intent.mExtras = new Bundle(); 6812 } 6813 resources.parseBundleExtra("extra", attrs, intent.mExtras); 6814 XmlUtils.skipCurrentTag(parser); 6815 6816 } else { 6817 XmlUtils.skipCurrentTag(parser); 6818 } 6819 } 6820 6821 return intent; 6822 } 6823 6824 /** 6825 * Normalize a MIME data type. 6826 * 6827 * <p>A normalized MIME type has white-space trimmed, 6828 * content-type parameters removed, and is lower-case. 6829 * This aligns the type with Android best practices for 6830 * intent filtering. 6831 * 6832 * <p>For example, "text/plain; charset=utf-8" becomes "text/plain". 6833 * "text/x-vCard" becomes "text/x-vcard". 6834 * 6835 * <p>All MIME types received from outside Android (such as user input, 6836 * or external sources like Bluetooth, NFC, or the Internet) should 6837 * be normalized before they are used to create an Intent. 6838 * 6839 * @param type MIME data type to normalize 6840 * @return normalized MIME data type, or null if the input was null 6841 * @see {@link #setType} 6842 * @see {@link #setTypeAndNormalize} 6843 */ 6844 public static String normalizeMimeType(String type) { 6845 if (type == null) { 6846 return null; 6847 } 6848 6849 type = type.trim().toLowerCase(Locale.US); 6850 6851 final int semicolonIndex = type.indexOf(';'); 6852 if (semicolonIndex != -1) { 6853 type = type.substring(0, semicolonIndex); 6854 } 6855 return type; 6856 } 6857 6858 /** 6859 * Migrate any {@link #EXTRA_STREAM} in {@link #ACTION_SEND} and 6860 * {@link #ACTION_SEND_MULTIPLE} to {@link ClipData}. Also inspects nested 6861 * intents in {@link #ACTION_CHOOSER}. 6862 * 6863 * @return Whether any contents were migrated. 6864 * @hide 6865 */ 6866 public boolean migrateExtraStreamToClipData() { 6867 // Refuse to touch if extras already parcelled 6868 if (mExtras != null && mExtras.isParcelled()) return false; 6869 6870 // Bail when someone already gave us ClipData 6871 if (getClipData() != null) return false; 6872 6873 final String action = getAction(); 6874 if (ACTION_CHOOSER.equals(action)) { 6875 try { 6876 // Inspect target intent to see if we need to migrate 6877 final Intent target = getParcelableExtra(EXTRA_INTENT); 6878 if (target != null && target.migrateExtraStreamToClipData()) { 6879 // Since we migrated in child, we need to promote ClipData 6880 // and flags to ourselves to grant. 6881 setClipData(target.getClipData()); 6882 addFlags(target.getFlags() 6883 & (FLAG_GRANT_READ_URI_PERMISSION | FLAG_GRANT_WRITE_URI_PERMISSION)); 6884 return true; 6885 } else { 6886 return false; 6887 } 6888 } catch (ClassCastException e) { 6889 } 6890 6891 } else if (ACTION_SEND.equals(action)) { 6892 try { 6893 final Uri stream = getParcelableExtra(EXTRA_STREAM); 6894 final CharSequence text = getCharSequenceExtra(EXTRA_TEXT); 6895 final String htmlText = getStringExtra(EXTRA_HTML_TEXT); 6896 if (stream != null || text != null || htmlText != null) { 6897 final ClipData clipData = new ClipData( 6898 null, new String[] { getType() }, 6899 new ClipData.Item(text, htmlText, null, stream)); 6900 setClipData(clipData); 6901 addFlags(FLAG_GRANT_READ_URI_PERMISSION); 6902 return true; 6903 } 6904 } catch (ClassCastException e) { 6905 } 6906 6907 } else if (ACTION_SEND_MULTIPLE.equals(action)) { 6908 try { 6909 final ArrayList<Uri> streams = getParcelableArrayListExtra(EXTRA_STREAM); 6910 final ArrayList<CharSequence> texts = getCharSequenceArrayListExtra(EXTRA_TEXT); 6911 final ArrayList<String> htmlTexts = getStringArrayListExtra(EXTRA_HTML_TEXT); 6912 int num = -1; 6913 if (streams != null) { 6914 num = streams.size(); 6915 } 6916 if (texts != null) { 6917 if (num >= 0 && num != texts.size()) { 6918 // Wha...! F- you. 6919 return false; 6920 } 6921 num = texts.size(); 6922 } 6923 if (htmlTexts != null) { 6924 if (num >= 0 && num != htmlTexts.size()) { 6925 // Wha...! F- you. 6926 return false; 6927 } 6928 num = htmlTexts.size(); 6929 } 6930 if (num > 0) { 6931 final ClipData clipData = new ClipData( 6932 null, new String[] { getType() }, 6933 makeClipItem(streams, texts, htmlTexts, 0)); 6934 6935 for (int i = 1; i < num; i++) { 6936 clipData.addItem(makeClipItem(streams, texts, htmlTexts, i)); 6937 } 6938 6939 setClipData(clipData); 6940 addFlags(FLAG_GRANT_READ_URI_PERMISSION); 6941 return true; 6942 } 6943 } catch (ClassCastException e) { 6944 } 6945 } 6946 6947 return false; 6948 } 6949 6950 private static ClipData.Item makeClipItem(ArrayList<Uri> streams, ArrayList<CharSequence> texts, 6951 ArrayList<String> htmlTexts, int which) { 6952 Uri uri = streams != null ? streams.get(which) : null; 6953 CharSequence text = texts != null ? texts.get(which) : null; 6954 String htmlText = htmlTexts != null ? htmlTexts.get(which) : null; 6955 return new ClipData.Item(text, htmlText, null, uri); 6956 } 6957} 6958