ActivityInfo.java revision 9d4e9bcebbd97ad51daa0ef15cfba5aabb399bbb
115a4d2ffd04dc6c70f2cd17dae12ac6bc14c69abKenny Root/* 215a4d2ffd04dc6c70f2cd17dae12ac6bc14c69abKenny Root * Copyright (C) 2007 The Android Open Source Project 315a4d2ffd04dc6c70f2cd17dae12ac6bc14c69abKenny Root * 415a4d2ffd04dc6c70f2cd17dae12ac6bc14c69abKenny Root * Licensed under the Apache License, Version 2.0 (the "License"); 515a4d2ffd04dc6c70f2cd17dae12ac6bc14c69abKenny Root * you may not use this file except in compliance with the License. 615a4d2ffd04dc6c70f2cd17dae12ac6bc14c69abKenny Root * You may obtain a copy of the License at 715a4d2ffd04dc6c70f2cd17dae12ac6bc14c69abKenny Root * 815a4d2ffd04dc6c70f2cd17dae12ac6bc14c69abKenny Root * http://www.apache.org/licenses/LICENSE-2.0 915a4d2ffd04dc6c70f2cd17dae12ac6bc14c69abKenny Root * 1015a4d2ffd04dc6c70f2cd17dae12ac6bc14c69abKenny Root * Unless required by applicable law or agreed to in writing, software 1115a4d2ffd04dc6c70f2cd17dae12ac6bc14c69abKenny Root * distributed under the License is distributed on an "AS IS" BASIS, 1215a4d2ffd04dc6c70f2cd17dae12ac6bc14c69abKenny Root * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1315a4d2ffd04dc6c70f2cd17dae12ac6bc14c69abKenny Root * See the License for the specific language governing permissions and 1415a4d2ffd04dc6c70f2cd17dae12ac6bc14c69abKenny Root * limitations under the License. 1515a4d2ffd04dc6c70f2cd17dae12ac6bc14c69abKenny Root */ 1615a4d2ffd04dc6c70f2cd17dae12ac6bc14c69abKenny Root 179066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Projectpackage android.content.pm; 189066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 19d9273d6f289d9b55da3fd0db2f659fdfb48106a8Tor Norbyeimport android.annotation.IntDef; 201d0b177754c81a20e272b91c6f703a634fe5c856Dianne Hackbornimport android.content.res.Configuration; 219066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Projectimport android.os.Parcel; 229066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Projectimport android.os.Parcelable; 239066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Projectimport android.util.Printer; 249066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 25d9273d6f289d9b55da3fd0db2f659fdfb48106a8Tor Norbyeimport java.lang.annotation.Retention; 26d9273d6f289d9b55da3fd0db2f659fdfb48106a8Tor Norbyeimport java.lang.annotation.RetentionPolicy; 27d9273d6f289d9b55da3fd0db2f659fdfb48106a8Tor Norbye 289066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project/** 299066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Information you can retrieve about a particular application 309066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * activity or receiver. This corresponds to information collected 319066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * from the AndroidManifest.xml's <activity> and 329066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * <receiver> tags. 339066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 349066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Projectpublic class ActivityInfo extends ComponentInfo 359066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project implements Parcelable { 369066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 379066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * A style resource identifier (in the package's resources) of this 389066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * activity's theme. From the "theme" attribute or, if not set, 0. 399066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 409066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public int theme; 419066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 429066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 439066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Constant corresponding to <code>standard</code> in 449066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * the {@link android.R.attr#launchMode} attribute. 459066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 469066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public static final int LAUNCH_MULTIPLE = 0; 479066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 489066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Constant corresponding to <code>singleTop</code> in 499066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * the {@link android.R.attr#launchMode} attribute. 509066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 519066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public static final int LAUNCH_SINGLE_TOP = 1; 529066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 539066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Constant corresponding to <code>singleTask</code> in 549066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * the {@link android.R.attr#launchMode} attribute. 559066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 569066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public static final int LAUNCH_SINGLE_TASK = 2; 579066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 589066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Constant corresponding to <code>singleInstance</code> in 599066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * the {@link android.R.attr#launchMode} attribute. 609066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 619066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public static final int LAUNCH_SINGLE_INSTANCE = 3; 629066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 639066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * The launch mode style requested by the activity. From the 649066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * {@link android.R.attr#launchMode} attribute, one of 659066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * {@link #LAUNCH_MULTIPLE}, 669066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * {@link #LAUNCH_SINGLE_TOP}, {@link #LAUNCH_SINGLE_TASK}, or 679066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * {@link #LAUNCH_SINGLE_INSTANCE}. 689066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 699066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public int launchMode; 702dac05617952e1341f9c522e4c05936d7ef07399Craig Mautner 712dac05617952e1341f9c522e4c05936d7ef07399Craig Mautner /** 722dac05617952e1341f9c522e4c05936d7ef07399Craig Mautner * Constant corresponding to <code>none</code> in 732dac05617952e1341f9c522e4c05936d7ef07399Craig Mautner * the {@link android.R.attr#documentLaunchMode} attribute. 742dac05617952e1341f9c522e4c05936d7ef07399Craig Mautner */ 752dac05617952e1341f9c522e4c05936d7ef07399Craig Mautner public static final int DOCUMENT_LAUNCH_NONE = 0; 762dac05617952e1341f9c522e4c05936d7ef07399Craig Mautner /** 772dac05617952e1341f9c522e4c05936d7ef07399Craig Mautner * Constant corresponding to <code>intoExisting</code> in 782dac05617952e1341f9c522e4c05936d7ef07399Craig Mautner * the {@link android.R.attr#documentLaunchMode} attribute. 792dac05617952e1341f9c522e4c05936d7ef07399Craig Mautner */ 802dac05617952e1341f9c522e4c05936d7ef07399Craig Mautner public static final int DOCUMENT_LAUNCH_INTO_EXISTING = 1; 812dac05617952e1341f9c522e4c05936d7ef07399Craig Mautner /** 822dac05617952e1341f9c522e4c05936d7ef07399Craig Mautner * Constant corresponding to <code>always</code> in 832dac05617952e1341f9c522e4c05936d7ef07399Craig Mautner * the {@link android.R.attr#documentLaunchMode} attribute. 842dac05617952e1341f9c522e4c05936d7ef07399Craig Mautner */ 852dac05617952e1341f9c522e4c05936d7ef07399Craig Mautner public static final int DOCUMENT_LAUNCH_ALWAYS = 2; 862dac05617952e1341f9c522e4c05936d7ef07399Craig Mautner /** 87f357c0ca514d73273a18b3896e565b2272e608adCraig Mautner * Constant corresponding to <code>never</code> in 88f357c0ca514d73273a18b3896e565b2272e608adCraig Mautner * the {@link android.R.attr#documentLaunchMode} attribute. 89f357c0ca514d73273a18b3896e565b2272e608adCraig Mautner */ 90f357c0ca514d73273a18b3896e565b2272e608adCraig Mautner public static final int DOCUMENT_LAUNCH_NEVER = 3; 91f357c0ca514d73273a18b3896e565b2272e608adCraig Mautner /** 922dac05617952e1341f9c522e4c05936d7ef07399Craig Mautner * The document launch mode style requested by the activity. From the 932dac05617952e1341f9c522e4c05936d7ef07399Craig Mautner * {@link android.R.attr#documentLaunchMode} attribute, one of 942dac05617952e1341f9c522e4c05936d7ef07399Craig Mautner * {@link #DOCUMENT_LAUNCH_NONE}, {@link #DOCUMENT_LAUNCH_INTO_EXISTING}, 952dac05617952e1341f9c522e4c05936d7ef07399Craig Mautner * {@link #DOCUMENT_LAUNCH_ALWAYS}. 962dac05617952e1341f9c522e4c05936d7ef07399Craig Mautner * 972dac05617952e1341f9c522e4c05936d7ef07399Craig Mautner * <p>Modes DOCUMENT_LAUNCH_ALWAYS 982dac05617952e1341f9c522e4c05936d7ef07399Craig Mautner * and DOCUMENT_LAUNCH_INTO_EXISTING are equivalent to {@link 992dac05617952e1341f9c522e4c05936d7ef07399Craig Mautner * android.content.Intent#FLAG_ACTIVITY_NEW_DOCUMENT 1002dac05617952e1341f9c522e4c05936d7ef07399Craig Mautner * Intent.FLAG_ACTIVITY_NEW_DOCUMENT} with and without {@link 1012dac05617952e1341f9c522e4c05936d7ef07399Craig Mautner * android.content.Intent#FLAG_ACTIVITY_MULTIPLE_TASK 1022dac05617952e1341f9c522e4c05936d7ef07399Craig Mautner * Intent.FLAG_ACTIVITY_MULTIPLE_TASK} respectively. 1032dac05617952e1341f9c522e4c05936d7ef07399Craig Mautner */ 1042dac05617952e1341f9c522e4c05936d7ef07399Craig Mautner public int documentLaunchMode; 1052dac05617952e1341f9c522e4c05936d7ef07399Craig Mautner 1069066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 10743e52ed32e2d55ef4aee18c4b4bc13b7fdef9cc4Craig Mautner * Constant corresponding to <code>persistRootOnly</code> in 10843e52ed32e2d55ef4aee18c4b4bc13b7fdef9cc4Craig Mautner * the {@link android.R.attr#persistableMode} attribute. 10943e52ed32e2d55ef4aee18c4b4bc13b7fdef9cc4Craig Mautner */ 11043e52ed32e2d55ef4aee18c4b4bc13b7fdef9cc4Craig Mautner public static final int PERSIST_ROOT_ONLY = 0; 11143e52ed32e2d55ef4aee18c4b4bc13b7fdef9cc4Craig Mautner /** 11243e52ed32e2d55ef4aee18c4b4bc13b7fdef9cc4Craig Mautner * Constant corresponding to <code>doNotPersist</code> in 11343e52ed32e2d55ef4aee18c4b4bc13b7fdef9cc4Craig Mautner * the {@link android.R.attr#persistableMode} attribute. 11443e52ed32e2d55ef4aee18c4b4bc13b7fdef9cc4Craig Mautner */ 11543e52ed32e2d55ef4aee18c4b4bc13b7fdef9cc4Craig Mautner public static final int DO_NOT_PERSIST = 1; 11643e52ed32e2d55ef4aee18c4b4bc13b7fdef9cc4Craig Mautner /** 11743e52ed32e2d55ef4aee18c4b4bc13b7fdef9cc4Craig Mautner * Constant corresponding to <code>persistAcrossReboots</code> in 11843e52ed32e2d55ef4aee18c4b4bc13b7fdef9cc4Craig Mautner * the {@link android.R.attr#persistableMode} attribute. 11943e52ed32e2d55ef4aee18c4b4bc13b7fdef9cc4Craig Mautner */ 12043e52ed32e2d55ef4aee18c4b4bc13b7fdef9cc4Craig Mautner public static final int PERSIST_ACROSS_REBOOTS = 2; 12143e52ed32e2d55ef4aee18c4b4bc13b7fdef9cc4Craig Mautner /** 12243e52ed32e2d55ef4aee18c4b4bc13b7fdef9cc4Craig Mautner * Value indicating how this activity is to be persisted across 12343e52ed32e2d55ef4aee18c4b4bc13b7fdef9cc4Craig Mautner * reboots for restoring in the Recents list. 12443e52ed32e2d55ef4aee18c4b4bc13b7fdef9cc4Craig Mautner * {@link android.R.attr#persistableMode} 12543e52ed32e2d55ef4aee18c4b4bc13b7fdef9cc4Craig Mautner */ 12643e52ed32e2d55ef4aee18c4b4bc13b7fdef9cc4Craig Mautner public int persistableMode; 12743e52ed32e2d55ef4aee18c4b4bc13b7fdef9cc4Craig Mautner 12843e52ed32e2d55ef4aee18c4b4bc13b7fdef9cc4Craig Mautner /** 129ffcfcaadfefec2fb56f67a0a614a54bf4599d62bCraig Mautner * The maximum number of tasks rooted at this activity that can be in the recent task list. 130ffcfcaadfefec2fb56f67a0a614a54bf4599d62bCraig Mautner * Refer to {@link android.R.attr#maxRecents}. 131ffcfcaadfefec2fb56f67a0a614a54bf4599d62bCraig Mautner */ 132ffcfcaadfefec2fb56f67a0a614a54bf4599d62bCraig Mautner public int maxRecents; 133ffcfcaadfefec2fb56f67a0a614a54bf4599d62bCraig Mautner 134ffcfcaadfefec2fb56f67a0a614a54bf4599d62bCraig Mautner /** 1359066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Optional name of a permission required to be able to access this 1369066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Activity. From the "permission" attribute. 1379066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 1389066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public String permission; 1399066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 1409066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 1419066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * The affinity this activity has for another task in the system. The 1429066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * string here is the name of the task, often the package name of the 1439066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * overall package. If null, the activity has no affinity. Set from the 1449066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * {@link android.R.attr#taskAffinity} attribute. 1459066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 1469066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public String taskAffinity; 1479066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 1489066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 1499066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * If this is an activity alias, this is the real activity class to run 1509066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * for it. Otherwise, this is null. 1519066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 1529066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public String targetActivity; 1539066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 1549066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 1559066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Bit in {@link #flags} indicating whether this activity is able to 1569066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * run in multiple processes. If 1579066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * true, the system may instantiate it in the some process as the 1589066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * process starting it in order to conserve resources. If false, the 1599066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * default, it always runs in {@link #processName}. Set from the 1609066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * {@link android.R.attr#multiprocess} attribute. 1619066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 1629066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public static final int FLAG_MULTIPROCESS = 0x0001; 1639066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 1649066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Bit in {@link #flags} indicating that, when the activity's task is 1659066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * relaunched from home, this activity should be finished. 1669066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Set from the 1679066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * {@link android.R.attr#finishOnTaskLaunch} attribute. 1689066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 1699066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public static final int FLAG_FINISH_ON_TASK_LAUNCH = 0x0002; 1709066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 1719066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Bit in {@link #flags} indicating that, when the activity is the root 1729066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * of a task, that task's stack should be cleared each time the user 1739066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * re-launches it from home. As a result, the user will always 1749066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * return to the original activity at the top of the task. 1759066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * This flag only applies to activities that 1769066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * are used to start the root of a new task. Set from the 1779066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * {@link android.R.attr#clearTaskOnLaunch} attribute. 1789066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 1799066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public static final int FLAG_CLEAR_TASK_ON_LAUNCH = 0x0004; 1809066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 1819066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Bit in {@link #flags} indicating that, when the activity is the root 1829066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * of a task, that task's stack should never be cleared when it is 1839066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * relaunched from home. Set from the 1849066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * {@link android.R.attr#alwaysRetainTaskState} attribute. 1859066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 1869066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public static final int FLAG_ALWAYS_RETAIN_TASK_STATE = 0x0008; 1879066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 1889066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Bit in {@link #flags} indicating that the activity's state 1899066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * is not required to be saved, so that if there is a failure the 1909066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * activity will not be removed from the activity stack. Set from the 1919066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * {@link android.R.attr#stateNotNeeded} attribute. 1929066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 1939066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public static final int FLAG_STATE_NOT_NEEDED = 0x0010; 1949066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 1959066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Bit in {@link #flags} that indicates that the activity should not 1969066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * appear in the list of recently launched activities. Set from the 1979066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * {@link android.R.attr#excludeFromRecents} attribute. 1989066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 1999066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public static final int FLAG_EXCLUDE_FROM_RECENTS = 0x0020; 2009066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 2019066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Bit in {@link #flags} that indicates that the activity can be moved 2029066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * between tasks based on its task affinity. Set from the 2039066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * {@link android.R.attr#allowTaskReparenting} attribute. 2049066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 2059066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public static final int FLAG_ALLOW_TASK_REPARENTING = 0x0040; 2069066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 2079066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Bit in {@link #flags} indicating that, when the user navigates away 2089066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * from an activity, it should be finished. 2099066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Set from the 2109066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * {@link android.R.attr#noHistory} attribute. 2119066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 2129066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public static final int FLAG_NO_HISTORY = 0x0080; 2139066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 214ffa424800d0338b8b894aef2ea1e3e3344cbda7aDianne Hackborn * Bit in {@link #flags} indicating that, when a request to close system 215ffa424800d0338b8b894aef2ea1e3e3344cbda7aDianne Hackborn * windows happens, this activity is finished. 216ffa424800d0338b8b894aef2ea1e3e3344cbda7aDianne Hackborn * Set from the 217ffa424800d0338b8b894aef2ea1e3e3344cbda7aDianne Hackborn * {@link android.R.attr#finishOnCloseSystemDialogs} attribute. 218ffa424800d0338b8b894aef2ea1e3e3344cbda7aDianne Hackborn */ 219ffa424800d0338b8b894aef2ea1e3e3344cbda7aDianne Hackborn public static final int FLAG_FINISH_ON_CLOSE_SYSTEM_DIALOGS = 0x0100; 220327fbd2c8fa294b919475feb4c74a74ee1981e02Dianne Hackborn /** 221327fbd2c8fa294b919475feb4c74a74ee1981e02Dianne Hackborn * Value for {@link #flags}: true when the application's rendering should 222327fbd2c8fa294b919475feb4c74a74ee1981e02Dianne Hackborn * be hardware accelerated. 223327fbd2c8fa294b919475feb4c74a74ee1981e02Dianne Hackborn */ 224327fbd2c8fa294b919475feb4c74a74ee1981e02Dianne Hackborn public static final int FLAG_HARDWARE_ACCELERATED = 0x0200; 225327fbd2c8fa294b919475feb4c74a74ee1981e02Dianne Hackborn /** 2265962b12bedc4a1d0354816c1cd6b06ba04f6d807Craig Mautner * Value for {@link #flags}: true when the application can be displayed over the lockscreen 2275962b12bedc4a1d0354816c1cd6b06ba04f6d807Craig Mautner * and consequently over all users' windows. 2285962b12bedc4a1d0354816c1cd6b06ba04f6d807Craig Mautner * @hide 2295962b12bedc4a1d0354816c1cd6b06ba04f6d807Craig Mautner */ 2305962b12bedc4a1d0354816c1cd6b06ba04f6d807Craig Mautner public static final int FLAG_SHOW_ON_LOCK_SCREEN = 0x0400; 2315962b12bedc4a1d0354816c1cd6b06ba04f6d807Craig Mautner /** 232322d77185d6e8fe79642f27b653bb51677873cbaJohn Spurlock * Bit in {@link #flags} corresponding to an immersive activity 233613dde4aa651e11dac3db859723cc6faf8fc0a82Daniel Sandler * that wishes not to be interrupted by notifications. 234613dde4aa651e11dac3db859723cc6faf8fc0a82Daniel Sandler * Applications that hide the system notification bar with 235613dde4aa651e11dac3db859723cc6faf8fc0a82Daniel Sandler * {@link android.view.WindowManager.LayoutParams#FLAG_FULLSCREEN} 236613dde4aa651e11dac3db859723cc6faf8fc0a82Daniel Sandler * may still be interrupted by high-priority notifications; for example, an 237613dde4aa651e11dac3db859723cc6faf8fc0a82Daniel Sandler * incoming phone call may use 2388091ca5015b2a9f591ad7d3ee5ec832c16cf5548Daniel Sandler * {@link android.app.Notification#fullScreenIntent fullScreenIntent} 239613dde4aa651e11dac3db859723cc6faf8fc0a82Daniel Sandler * to present a full-screen in-call activity to the user, pausing the 240613dde4aa651e11dac3db859723cc6faf8fc0a82Daniel Sandler * current activity as a side-effect. An activity with 241613dde4aa651e11dac3db859723cc6faf8fc0a82Daniel Sandler * {@link #FLAG_IMMERSIVE} set, however, will not be interrupted; the 242613dde4aa651e11dac3db859723cc6faf8fc0a82Daniel Sandler * notification may be shown in some other way (such as a small floating 243613dde4aa651e11dac3db859723cc6faf8fc0a82Daniel Sandler * "toast" window). 24473c2aee40a0e0ab2e8bd2bbbc560aa31c38eaac2Christopher Tate * 24573c2aee40a0e0ab2e8bd2bbbc560aa31c38eaac2Christopher Tate * Note that this flag will always reflect the Activity's 24673c2aee40a0e0ab2e8bd2bbbc560aa31c38eaac2Christopher Tate * <code>android:immersive</code> manifest definition, even if the Activity's 24773c2aee40a0e0ab2e8bd2bbbc560aa31c38eaac2Christopher Tate * immersive state is changed at runtime via 24873c2aee40a0e0ab2e8bd2bbbc560aa31c38eaac2Christopher Tate * {@link android.app.Activity#setImmersive(boolean)}. 24973c2aee40a0e0ab2e8bd2bbbc560aa31c38eaac2Christopher Tate * 25073c2aee40a0e0ab2e8bd2bbbc560aa31c38eaac2Christopher Tate * @see android.app.Notification#FLAG_HIGH_PRIORITY 25173c2aee40a0e0ab2e8bd2bbbc560aa31c38eaac2Christopher Tate * @see android.app.Activity#setImmersive(boolean) 252613dde4aa651e11dac3db859723cc6faf8fc0a82Daniel Sandler */ 2535962b12bedc4a1d0354816c1cd6b06ba04f6d807Craig Mautner public static final int FLAG_IMMERSIVE = 0x0800; 254529b60a3b16ac3dff24f2403d760ab8ebc9670ffRomain Guy /** 2559d4e9bcebbd97ad51daa0ef15cfba5aabb399bbbCraig Mautner * Bit in {@link #flags}: If set, a task rooted at this activity will have its 2569d4e9bcebbd97ad51daa0ef15cfba5aabb399bbbCraig Mautner * baseIntent replaced by the activity immediately above this. Each activity may further 2579d4e9bcebbd97ad51daa0ef15cfba5aabb399bbbCraig Mautner * relinquish its identity to the activity above it using this flag. Set from the 2589d4e9bcebbd97ad51daa0ef15cfba5aabb399bbbCraig Mautner * android.R.attr#relinquishTaskIdentity attribute. 2599d4e9bcebbd97ad51daa0ef15cfba5aabb399bbbCraig Mautner */ 2609d4e9bcebbd97ad51daa0ef15cfba5aabb399bbbCraig Mautner public static final int FLAG_RELINQUISH_TASK_IDENTITY = 0x1000; 2619d4e9bcebbd97ad51daa0ef15cfba5aabb399bbbCraig Mautner /** 2622dac05617952e1341f9c522e4c05936d7ef07399Craig Mautner * Bit in {@link #flags} indicating that tasks started with this activity are to be 2632dac05617952e1341f9c522e4c05936d7ef07399Craig Mautner * removed from the recent list of tasks when the last activity in the task is finished. 2642dac05617952e1341f9c522e4c05936d7ef07399Craig Mautner * {@link android.R.attr#autoRemoveFromRecents} 2652dac05617952e1341f9c522e4c05936d7ef07399Craig Mautner */ 2662dac05617952e1341f9c522e4c05936d7ef07399Craig Mautner public static final int FLAG_AUTO_REMOVE_FROM_RECENTS = 0x2000; 2672dac05617952e1341f9c522e4c05936d7ef07399Craig Mautner /** 268d4ac8d7b3de27a9f0e4c6af2496ca71d794e42d1Dianne Hackborn * @hide Bit in {@link #flags}: If set, this component will only be seen 269d4ac8d7b3de27a9f0e4c6af2496ca71d794e42d1Dianne Hackborn * by the primary user. Only works with broadcast receivers. Set from the 270ffd14a13ce7425562777152256ea7760d95f254dCraig Mautner * android.R.attr#primaryUserOnly attribute. 271d4ac8d7b3de27a9f0e4c6af2496ca71d794e42d1Dianne Hackborn */ 272d4ac8d7b3de27a9f0e4c6af2496ca71d794e42d1Dianne Hackborn public static final int FLAG_PRIMARY_USER_ONLY = 0x20000000; 273d4ac8d7b3de27a9f0e4c6af2496ca71d794e42d1Dianne Hackborn /** 2747d19e0242faac8017033dabb872cdf1542fa184cDianne Hackborn * Bit in {@link #flags}: If set, a single instance of the receiver will 2757d19e0242faac8017033dabb872cdf1542fa184cDianne Hackborn * run for all users on the device. Set from the 2767d19e0242faac8017033dabb872cdf1542fa184cDianne Hackborn * {@link android.R.attr#singleUser} attribute. Note that this flag is 277d4ac8d7b3de27a9f0e4c6af2496ca71d794e42d1Dianne Hackborn * only relevant for ActivityInfo structures that are describing receiver 2787d19e0242faac8017033dabb872cdf1542fa184cDianne Hackborn * components; it is not applied to activities. 2797d19e0242faac8017033dabb872cdf1542fa184cDianne Hackborn */ 2807d19e0242faac8017033dabb872cdf1542fa184cDianne Hackborn public static final int FLAG_SINGLE_USER = 0x40000000; 2817d19e0242faac8017033dabb872cdf1542fa184cDianne Hackborn /** 282ffd14a13ce7425562777152256ea7760d95f254dCraig Mautner * @hide Bit in {@link #flags}: If set, this activity may be launched into an 283ffd14a13ce7425562777152256ea7760d95f254dCraig Mautner * owned ActivityContainer such as that within an ActivityView. If not set and 284ffd14a13ce7425562777152256ea7760d95f254dCraig Mautner * this activity is launched into such a container a SecurityExcception will be 285ffd14a13ce7425562777152256ea7760d95f254dCraig Mautner * thrown. Set from the {@link android.R.attr#allowEmbedded} attribute. 286ffd14a13ce7425562777152256ea7760d95f254dCraig Mautner */ 287ffd14a13ce7425562777152256ea7760d95f254dCraig Mautner public static final int FLAG_ALLOW_EMBEDDED = 0x80000000; 288ffd14a13ce7425562777152256ea7760d95f254dCraig Mautner /** 2899066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Options that have been set in the activity declaration in the 290613dde4aa651e11dac3db859723cc6faf8fc0a82Daniel Sandler * manifest. 291613dde4aa651e11dac3db859723cc6faf8fc0a82Daniel Sandler * These include: 292613dde4aa651e11dac3db859723cc6faf8fc0a82Daniel Sandler * {@link #FLAG_MULTIPROCESS}, 2939066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * {@link #FLAG_FINISH_ON_TASK_LAUNCH}, {@link #FLAG_CLEAR_TASK_ON_LAUNCH}, 2949066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * {@link #FLAG_ALWAYS_RETAIN_TASK_STATE}, 2959066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * {@link #FLAG_STATE_NOT_NEEDED}, {@link #FLAG_EXCLUDE_FROM_RECENTS}, 296ffa424800d0338b8b894aef2ea1e3e3344cbda7aDianne Hackborn * {@link #FLAG_ALLOW_TASK_REPARENTING}, {@link #FLAG_NO_HISTORY}, 297613dde4aa651e11dac3db859723cc6faf8fc0a82Daniel Sandler * {@link #FLAG_FINISH_ON_CLOSE_SYSTEM_DIALOGS}, 2987d19e0242faac8017033dabb872cdf1542fa184cDianne Hackborn * {@link #FLAG_HARDWARE_ACCELERATED}, {@link #FLAG_SINGLE_USER}. 2999066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 3009066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public int flags; 3019066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 302d9273d6f289d9b55da3fd0db2f659fdfb48106a8Tor Norbye /** @hide */ 303d9273d6f289d9b55da3fd0db2f659fdfb48106a8Tor Norbye @IntDef({ 304d9273d6f289d9b55da3fd0db2f659fdfb48106a8Tor Norbye SCREEN_ORIENTATION_UNSPECIFIED, 305d9273d6f289d9b55da3fd0db2f659fdfb48106a8Tor Norbye SCREEN_ORIENTATION_LANDSCAPE, 306d9273d6f289d9b55da3fd0db2f659fdfb48106a8Tor Norbye SCREEN_ORIENTATION_PORTRAIT, 307d9273d6f289d9b55da3fd0db2f659fdfb48106a8Tor Norbye SCREEN_ORIENTATION_USER, 308d9273d6f289d9b55da3fd0db2f659fdfb48106a8Tor Norbye SCREEN_ORIENTATION_BEHIND, 309d9273d6f289d9b55da3fd0db2f659fdfb48106a8Tor Norbye SCREEN_ORIENTATION_SENSOR, 310d9273d6f289d9b55da3fd0db2f659fdfb48106a8Tor Norbye SCREEN_ORIENTATION_NOSENSOR, 311d9273d6f289d9b55da3fd0db2f659fdfb48106a8Tor Norbye SCREEN_ORIENTATION_SENSOR_LANDSCAPE, 312d9273d6f289d9b55da3fd0db2f659fdfb48106a8Tor Norbye SCREEN_ORIENTATION_SENSOR_PORTRAIT, 313d9273d6f289d9b55da3fd0db2f659fdfb48106a8Tor Norbye SCREEN_ORIENTATION_REVERSE_LANDSCAPE, 314d9273d6f289d9b55da3fd0db2f659fdfb48106a8Tor Norbye SCREEN_ORIENTATION_REVERSE_PORTRAIT, 315d9273d6f289d9b55da3fd0db2f659fdfb48106a8Tor Norbye SCREEN_ORIENTATION_FULL_SENSOR, 316d9273d6f289d9b55da3fd0db2f659fdfb48106a8Tor Norbye SCREEN_ORIENTATION_USER_LANDSCAPE, 317d9273d6f289d9b55da3fd0db2f659fdfb48106a8Tor Norbye SCREEN_ORIENTATION_USER_PORTRAIT, 318d9273d6f289d9b55da3fd0db2f659fdfb48106a8Tor Norbye SCREEN_ORIENTATION_FULL_USER, 319d9273d6f289d9b55da3fd0db2f659fdfb48106a8Tor Norbye SCREEN_ORIENTATION_LOCKED 320d9273d6f289d9b55da3fd0db2f659fdfb48106a8Tor Norbye }) 321d9273d6f289d9b55da3fd0db2f659fdfb48106a8Tor Norbye @Retention(RetentionPolicy.SOURCE) 322d9273d6f289d9b55da3fd0db2f659fdfb48106a8Tor Norbye public @interface ScreenOrientation {} 323d9273d6f289d9b55da3fd0db2f659fdfb48106a8Tor Norbye 3249066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 3259066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Constant corresponding to <code>unspecified</code> in 3269066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * the {@link android.R.attr#screenOrientation} attribute. 3279066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 3289066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public static final int SCREEN_ORIENTATION_UNSPECIFIED = -1; 3299066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 3309066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Constant corresponding to <code>landscape</code> in 3319066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * the {@link android.R.attr#screenOrientation} attribute. 3329066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 3339066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public static final int SCREEN_ORIENTATION_LANDSCAPE = 0; 3349066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 3359066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Constant corresponding to <code>portrait</code> in 3369066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * the {@link android.R.attr#screenOrientation} attribute. 3379066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 3389066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public static final int SCREEN_ORIENTATION_PORTRAIT = 1; 3399066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 3409066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Constant corresponding to <code>user</code> in 3419066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * the {@link android.R.attr#screenOrientation} attribute. 3429066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 3439066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public static final int SCREEN_ORIENTATION_USER = 2; 3449066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 3459066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Constant corresponding to <code>behind</code> in 3469066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * the {@link android.R.attr#screenOrientation} attribute. 3479066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 3489066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public static final int SCREEN_ORIENTATION_BEHIND = 3; 3499066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 3509066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Constant corresponding to <code>sensor</code> in 3519066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * the {@link android.R.attr#screenOrientation} attribute. 3529066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 3539066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public static final int SCREEN_ORIENTATION_SENSOR = 4; 3549066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 3559066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 356e5439f228f603f60febe058f633d91d5af2fff76Dianne Hackborn * Constant corresponding to <code>nosensor</code> in 3579066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * the {@link android.R.attr#screenOrientation} attribute. 3589066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 3599066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public static final int SCREEN_ORIENTATION_NOSENSOR = 5; 360e5439f228f603f60febe058f633d91d5af2fff76Dianne Hackborn 361e5439f228f603f60febe058f633d91d5af2fff76Dianne Hackborn /** 362e5439f228f603f60febe058f633d91d5af2fff76Dianne Hackborn * Constant corresponding to <code>sensorLandscape</code> in 363e5439f228f603f60febe058f633d91d5af2fff76Dianne Hackborn * the {@link android.R.attr#screenOrientation} attribute. 364e5439f228f603f60febe058f633d91d5af2fff76Dianne Hackborn */ 365e5439f228f603f60febe058f633d91d5af2fff76Dianne Hackborn public static final int SCREEN_ORIENTATION_SENSOR_LANDSCAPE = 6; 366e5439f228f603f60febe058f633d91d5af2fff76Dianne Hackborn 367e5439f228f603f60febe058f633d91d5af2fff76Dianne Hackborn /** 368e5439f228f603f60febe058f633d91d5af2fff76Dianne Hackborn * Constant corresponding to <code>sensorPortrait</code> in 369e5439f228f603f60febe058f633d91d5af2fff76Dianne Hackborn * the {@link android.R.attr#screenOrientation} attribute. 370e5439f228f603f60febe058f633d91d5af2fff76Dianne Hackborn */ 371e5439f228f603f60febe058f633d91d5af2fff76Dianne Hackborn public static final int SCREEN_ORIENTATION_SENSOR_PORTRAIT = 7; 372e5439f228f603f60febe058f633d91d5af2fff76Dianne Hackborn 373e5439f228f603f60febe058f633d91d5af2fff76Dianne Hackborn /** 374e5439f228f603f60febe058f633d91d5af2fff76Dianne Hackborn * Constant corresponding to <code>reverseLandscape</code> in 375e5439f228f603f60febe058f633d91d5af2fff76Dianne Hackborn * the {@link android.R.attr#screenOrientation} attribute. 376e5439f228f603f60febe058f633d91d5af2fff76Dianne Hackborn */ 377e5439f228f603f60febe058f633d91d5af2fff76Dianne Hackborn public static final int SCREEN_ORIENTATION_REVERSE_LANDSCAPE = 8; 378e5439f228f603f60febe058f633d91d5af2fff76Dianne Hackborn 379e5439f228f603f60febe058f633d91d5af2fff76Dianne Hackborn /** 380e5439f228f603f60febe058f633d91d5af2fff76Dianne Hackborn * Constant corresponding to <code>reversePortrait</code> in 381e5439f228f603f60febe058f633d91d5af2fff76Dianne Hackborn * the {@link android.R.attr#screenOrientation} attribute. 382e5439f228f603f60febe058f633d91d5af2fff76Dianne Hackborn */ 383e5439f228f603f60febe058f633d91d5af2fff76Dianne Hackborn public static final int SCREEN_ORIENTATION_REVERSE_PORTRAIT = 9; 384e5439f228f603f60febe058f633d91d5af2fff76Dianne Hackborn 385e5439f228f603f60febe058f633d91d5af2fff76Dianne Hackborn /** 386e5439f228f603f60febe058f633d91d5af2fff76Dianne Hackborn * Constant corresponding to <code>fullSensor</code> in 387e5439f228f603f60febe058f633d91d5af2fff76Dianne Hackborn * the {@link android.R.attr#screenOrientation} attribute. 388e5439f228f603f60febe058f633d91d5af2fff76Dianne Hackborn */ 389e5439f228f603f60febe058f633d91d5af2fff76Dianne Hackborn public static final int SCREEN_ORIENTATION_FULL_SENSOR = 10; 390e5439f228f603f60febe058f633d91d5af2fff76Dianne Hackborn 3919066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 392b9ec1ac51b631c4efc9b7a7e7a2b28882105ffa3Dianne Hackborn * Constant corresponding to <code>userLandscape</code> in 393b9ec1ac51b631c4efc9b7a7e7a2b28882105ffa3Dianne Hackborn * the {@link android.R.attr#screenOrientation} attribute. 394b9ec1ac51b631c4efc9b7a7e7a2b28882105ffa3Dianne Hackborn */ 395b9ec1ac51b631c4efc9b7a7e7a2b28882105ffa3Dianne Hackborn public static final int SCREEN_ORIENTATION_USER_LANDSCAPE = 11; 396b9ec1ac51b631c4efc9b7a7e7a2b28882105ffa3Dianne Hackborn 397b9ec1ac51b631c4efc9b7a7e7a2b28882105ffa3Dianne Hackborn /** 398b9ec1ac51b631c4efc9b7a7e7a2b28882105ffa3Dianne Hackborn * Constant corresponding to <code>userPortrait</code> in 399b9ec1ac51b631c4efc9b7a7e7a2b28882105ffa3Dianne Hackborn * the {@link android.R.attr#screenOrientation} attribute. 400b9ec1ac51b631c4efc9b7a7e7a2b28882105ffa3Dianne Hackborn */ 401b9ec1ac51b631c4efc9b7a7e7a2b28882105ffa3Dianne Hackborn public static final int SCREEN_ORIENTATION_USER_PORTRAIT = 12; 402b9ec1ac51b631c4efc9b7a7e7a2b28882105ffa3Dianne Hackborn 403b9ec1ac51b631c4efc9b7a7e7a2b28882105ffa3Dianne Hackborn /** 404b9ec1ac51b631c4efc9b7a7e7a2b28882105ffa3Dianne Hackborn * Constant corresponding to <code>fullUser</code> in 405b9ec1ac51b631c4efc9b7a7e7a2b28882105ffa3Dianne Hackborn * the {@link android.R.attr#screenOrientation} attribute. 406b9ec1ac51b631c4efc9b7a7e7a2b28882105ffa3Dianne Hackborn */ 407b9ec1ac51b631c4efc9b7a7e7a2b28882105ffa3Dianne Hackborn public static final int SCREEN_ORIENTATION_FULL_USER = 13; 408b9ec1ac51b631c4efc9b7a7e7a2b28882105ffa3Dianne Hackborn 409b9ec1ac51b631c4efc9b7a7e7a2b28882105ffa3Dianne Hackborn /** 410b9ec1ac51b631c4efc9b7a7e7a2b28882105ffa3Dianne Hackborn * Constant corresponding to <code>locked</code> in 411b9ec1ac51b631c4efc9b7a7e7a2b28882105ffa3Dianne Hackborn * the {@link android.R.attr#screenOrientation} attribute. 412b9ec1ac51b631c4efc9b7a7e7a2b28882105ffa3Dianne Hackborn */ 413b9ec1ac51b631c4efc9b7a7e7a2b28882105ffa3Dianne Hackborn public static final int SCREEN_ORIENTATION_LOCKED = 14; 414b9ec1ac51b631c4efc9b7a7e7a2b28882105ffa3Dianne Hackborn 415b9ec1ac51b631c4efc9b7a7e7a2b28882105ffa3Dianne Hackborn /** 4169066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * The preferred screen orientation this activity would like to run in. 4179066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * From the {@link android.R.attr#screenOrientation} attribute, one of 4189066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * {@link #SCREEN_ORIENTATION_UNSPECIFIED}, 4199066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * {@link #SCREEN_ORIENTATION_LANDSCAPE}, 4209066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * {@link #SCREEN_ORIENTATION_PORTRAIT}, 4219066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * {@link #SCREEN_ORIENTATION_USER}, 4229066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * {@link #SCREEN_ORIENTATION_BEHIND}, 4239066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * {@link #SCREEN_ORIENTATION_SENSOR}, 424e5439f228f603f60febe058f633d91d5af2fff76Dianne Hackborn * {@link #SCREEN_ORIENTATION_NOSENSOR}, 425e5439f228f603f60febe058f633d91d5af2fff76Dianne Hackborn * {@link #SCREEN_ORIENTATION_SENSOR_LANDSCAPE}, 426e5439f228f603f60febe058f633d91d5af2fff76Dianne Hackborn * {@link #SCREEN_ORIENTATION_SENSOR_PORTRAIT}, 427e5439f228f603f60febe058f633d91d5af2fff76Dianne Hackborn * {@link #SCREEN_ORIENTATION_REVERSE_LANDSCAPE}, 428e5439f228f603f60febe058f633d91d5af2fff76Dianne Hackborn * {@link #SCREEN_ORIENTATION_REVERSE_PORTRAIT}, 429b9ec1ac51b631c4efc9b7a7e7a2b28882105ffa3Dianne Hackborn * {@link #SCREEN_ORIENTATION_FULL_SENSOR}, 430b9ec1ac51b631c4efc9b7a7e7a2b28882105ffa3Dianne Hackborn * {@link #SCREEN_ORIENTATION_USER_LANDSCAPE}, 431b9ec1ac51b631c4efc9b7a7e7a2b28882105ffa3Dianne Hackborn * {@link #SCREEN_ORIENTATION_USER_PORTRAIT}, 432b9ec1ac51b631c4efc9b7a7e7a2b28882105ffa3Dianne Hackborn * {@link #SCREEN_ORIENTATION_FULL_USER}, 433b9ec1ac51b631c4efc9b7a7e7a2b28882105ffa3Dianne Hackborn * {@link #SCREEN_ORIENTATION_LOCKED}, 4349066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 435d9273d6f289d9b55da3fd0db2f659fdfb48106a8Tor Norbye @ScreenOrientation 4369066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public int screenOrientation = SCREEN_ORIENTATION_UNSPECIFIED; 4379066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 4389066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 4399066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Bit in {@link #configChanges} that indicates that the activity 4409066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * can itself handle changes to the IMSI MCC. Set from the 4419066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * {@link android.R.attr#configChanges} attribute. 4429066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 4439066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public static final int CONFIG_MCC = 0x0001; 4449066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 4459066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Bit in {@link #configChanges} that indicates that the activity 4469066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * can itself handle changes to the IMSI MNC. Set from the 4479066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * {@link android.R.attr#configChanges} attribute. 4489066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 4499066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public static final int CONFIG_MNC = 0x0002; 4509066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 4519066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Bit in {@link #configChanges} that indicates that the activity 4529066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * can itself handle changes to the locale. Set from the 4539066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * {@link android.R.attr#configChanges} attribute. 4549066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 4559066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public static final int CONFIG_LOCALE = 0x0004; 4569066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 4579066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Bit in {@link #configChanges} that indicates that the activity 4589066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * can itself handle changes to the touchscreen type. Set from the 4599066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * {@link android.R.attr#configChanges} attribute. 4609066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 4619066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public static final int CONFIG_TOUCHSCREEN = 0x0008; 4629066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 4639066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Bit in {@link #configChanges} that indicates that the activity 4649066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * can itself handle changes to the keyboard type. Set from the 4659066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * {@link android.R.attr#configChanges} attribute. 4669066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 4679066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public static final int CONFIG_KEYBOARD = 0x0010; 4689066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 4699066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Bit in {@link #configChanges} that indicates that the activity 47093e462b79d6896da10e15e74c5aec6beb098dddfDianne Hackborn * can itself handle changes to the keyboard or navigation being hidden/exposed. 47193e462b79d6896da10e15e74c5aec6beb098dddfDianne Hackborn * Note that inspite of the name, this applies to the changes to any 47293e462b79d6896da10e15e74c5aec6beb098dddfDianne Hackborn * hidden states: keyboard or navigation. 4739066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Set from the {@link android.R.attr#configChanges} attribute. 4749066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 4759066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public static final int CONFIG_KEYBOARD_HIDDEN = 0x0020; 4769066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 4779066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Bit in {@link #configChanges} that indicates that the activity 4789066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * can itself handle changes to the navigation type. Set from the 4799066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * {@link android.R.attr#configChanges} attribute. 4809066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 4819066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public static final int CONFIG_NAVIGATION = 0x0040; 4829066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 4839066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Bit in {@link #configChanges} that indicates that the activity 4849066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * can itself handle changes to the screen orientation. Set from the 4859066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * {@link android.R.attr#configChanges} attribute. 4869066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 4879066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public static final int CONFIG_ORIENTATION = 0x0080; 4889066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 4899066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Bit in {@link #configChanges} that indicates that the activity 490723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn * can itself handle changes to the screen layout. Set from the 491723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn * {@link android.R.attr#configChanges} attribute. 492723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn */ 493723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn public static final int CONFIG_SCREEN_LAYOUT = 0x0100; 494723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn /** 495723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn * Bit in {@link #configChanges} that indicates that the activity 49627b28b3f62bd3b54fa13acd5d035940b9be464f3Tobias Haamel * can itself handle the ui mode. Set from the 49727b28b3f62bd3b54fa13acd5d035940b9be464f3Tobias Haamel * {@link android.R.attr#configChanges} attribute. 49827b28b3f62bd3b54fa13acd5d035940b9be464f3Tobias Haamel */ 49927b28b3f62bd3b54fa13acd5d035940b9be464f3Tobias Haamel public static final int CONFIG_UI_MODE = 0x0200; 50027b28b3f62bd3b54fa13acd5d035940b9be464f3Tobias Haamel /** 50127b28b3f62bd3b54fa13acd5d035940b9be464f3Tobias Haamel * Bit in {@link #configChanges} that indicates that the activity 502ebff8f92f13513ce37bd74759eb1db63f2220590Dianne Hackborn * can itself handle the screen size. Set from the 503e66763516a9c27c192adaba417616371a1c3c9bfDianne Hackborn * {@link android.R.attr#configChanges} attribute. This will be 504e66763516a9c27c192adaba417616371a1c3c9bfDianne Hackborn * set by default for applications that target an earlier version 505e66763516a9c27c192adaba417616371a1c3c9bfDianne Hackborn * than {@link android.os.Build.VERSION_CODES#HONEYCOMB_MR2}... 506e66763516a9c27c192adaba417616371a1c3c9bfDianne Hackborn * <b>however</b>, you will not see the bit set here becomes some 507e66763516a9c27c192adaba417616371a1c3c9bfDianne Hackborn * applications incorrectly compare {@link #configChanges} against 508e66763516a9c27c192adaba417616371a1c3c9bfDianne Hackborn * an absolute value rather than correctly masking out the bits 509e66763516a9c27c192adaba417616371a1c3c9bfDianne Hackborn * they are interested in. Please don't do that, thanks. 510ebff8f92f13513ce37bd74759eb1db63f2220590Dianne Hackborn */ 511ebff8f92f13513ce37bd74759eb1db63f2220590Dianne Hackborn public static final int CONFIG_SCREEN_SIZE = 0x0400; 512ebff8f92f13513ce37bd74759eb1db63f2220590Dianne Hackborn /** 513ebff8f92f13513ce37bd74759eb1db63f2220590Dianne Hackborn * Bit in {@link #configChanges} that indicates that the activity 51469cb87576ba163b61bb0e6477a3b7c57a9b11d40Dianne Hackborn * can itself handle the smallest screen size. Set from the 515e66763516a9c27c192adaba417616371a1c3c9bfDianne Hackborn * {@link android.R.attr#configChanges} attribute. This will be 516e66763516a9c27c192adaba417616371a1c3c9bfDianne Hackborn * set by default for applications that target an earlier version 517e66763516a9c27c192adaba417616371a1c3c9bfDianne Hackborn * than {@link android.os.Build.VERSION_CODES#HONEYCOMB_MR2}... 518e66763516a9c27c192adaba417616371a1c3c9bfDianne Hackborn * <b>however</b>, you will not see the bit set here becomes some 519e66763516a9c27c192adaba417616371a1c3c9bfDianne Hackborn * applications incorrectly compare {@link #configChanges} against 520e66763516a9c27c192adaba417616371a1c3c9bfDianne Hackborn * an absolute value rather than correctly masking out the bits 521e66763516a9c27c192adaba417616371a1c3c9bfDianne Hackborn * they are interested in. Please don't do that, thanks. 52269cb87576ba163b61bb0e6477a3b7c57a9b11d40Dianne Hackborn */ 52369cb87576ba163b61bb0e6477a3b7c57a9b11d40Dianne Hackborn public static final int CONFIG_SMALLEST_SCREEN_SIZE = 0x0800; 52469cb87576ba163b61bb0e6477a3b7c57a9b11d40Dianne Hackborn /** 52569cb87576ba163b61bb0e6477a3b7c57a9b11d40Dianne Hackborn * Bit in {@link #configChanges} that indicates that the activity 526908aecc3a63c5520d5b11da14a9383f885b7d126Dianne Hackborn * can itself handle density changes. Set from the 527908aecc3a63c5520d5b11da14a9383f885b7d126Dianne Hackborn * {@link android.R.attr#configChanges} attribute. 528908aecc3a63c5520d5b11da14a9383f885b7d126Dianne Hackborn */ 529908aecc3a63c5520d5b11da14a9383f885b7d126Dianne Hackborn public static final int CONFIG_DENSITY = 0x1000; 530908aecc3a63c5520d5b11da14a9383f885b7d126Dianne Hackborn /** 531908aecc3a63c5520d5b11da14a9383f885b7d126Dianne Hackborn * Bit in {@link #configChanges} that indicates that the activity 5325f7979993979466c79ab4f38d83c6f2aca361662Fabrice Di Meglio * can itself handle the change to layout direction. Set from the 5335f7979993979466c79ab4f38d83c6f2aca361662Fabrice Di Meglio * {@link android.R.attr#configChanges} attribute. 5345f7979993979466c79ab4f38d83c6f2aca361662Fabrice Di Meglio */ 5355f7979993979466c79ab4f38d83c6f2aca361662Fabrice Di Meglio public static final int CONFIG_LAYOUT_DIRECTION = 0x2000; 5365f7979993979466c79ab4f38d83c6f2aca361662Fabrice Di Meglio /** 5375f7979993979466c79ab4f38d83c6f2aca361662Fabrice Di Meglio * Bit in {@link #configChanges} that indicates that the activity 5389066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * can itself handle changes to the font scaling factor. Set from the 5399066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * {@link android.R.attr#configChanges} attribute. This is 540dc25d25333d3fac96dccfb9bd31d2474d6bc2d78Fabrice Di Meglio * not a core resource configuration, but a higher-level value, so its 5419066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * constant starts at the high bits. 5429066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 5439066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public static final int CONFIG_FONT_SCALE = 0x40000000; 5449066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 545ebff8f92f13513ce37bd74759eb1db63f2220590Dianne Hackborn /** @hide 546ebff8f92f13513ce37bd74759eb1db63f2220590Dianne Hackborn * Unfortunately the constants for config changes in native code are 547ebff8f92f13513ce37bd74759eb1db63f2220590Dianne Hackborn * different from ActivityInfo. :( Here are the values we should use for the 548ebff8f92f13513ce37bd74759eb1db63f2220590Dianne Hackborn * native side given the bit we have assigned in ActivityInfo. 549ebff8f92f13513ce37bd74759eb1db63f2220590Dianne Hackborn */ 550ebff8f92f13513ce37bd74759eb1db63f2220590Dianne Hackborn public static int[] CONFIG_NATIVE_BITS = new int[] { 5511d0b177754c81a20e272b91c6f703a634fe5c856Dianne Hackborn Configuration.NATIVE_CONFIG_MNC, // MNC 5521d0b177754c81a20e272b91c6f703a634fe5c856Dianne Hackborn Configuration.NATIVE_CONFIG_MCC, // MCC 5531d0b177754c81a20e272b91c6f703a634fe5c856Dianne Hackborn Configuration.NATIVE_CONFIG_LOCALE, // LOCALE 5541d0b177754c81a20e272b91c6f703a634fe5c856Dianne Hackborn Configuration.NATIVE_CONFIG_TOUCHSCREEN, // TOUCH SCREEN 5551d0b177754c81a20e272b91c6f703a634fe5c856Dianne Hackborn Configuration.NATIVE_CONFIG_KEYBOARD, // KEYBOARD 5561d0b177754c81a20e272b91c6f703a634fe5c856Dianne Hackborn Configuration.NATIVE_CONFIG_KEYBOARD_HIDDEN, // KEYBOARD HIDDEN 5571d0b177754c81a20e272b91c6f703a634fe5c856Dianne Hackborn Configuration.NATIVE_CONFIG_NAVIGATION, // NAVIGATION 5581d0b177754c81a20e272b91c6f703a634fe5c856Dianne Hackborn Configuration.NATIVE_CONFIG_ORIENTATION, // ORIENTATION 5591d0b177754c81a20e272b91c6f703a634fe5c856Dianne Hackborn Configuration.NATIVE_CONFIG_SCREEN_LAYOUT, // SCREEN LAYOUT 5601d0b177754c81a20e272b91c6f703a634fe5c856Dianne Hackborn Configuration.NATIVE_CONFIG_UI_MODE, // UI MODE 5611d0b177754c81a20e272b91c6f703a634fe5c856Dianne Hackborn Configuration.NATIVE_CONFIG_SCREEN_SIZE, // SCREEN SIZE 5621d0b177754c81a20e272b91c6f703a634fe5c856Dianne Hackborn Configuration.NATIVE_CONFIG_SMALLEST_SCREEN_SIZE, // SMALLEST SCREEN SIZE 5631d0b177754c81a20e272b91c6f703a634fe5c856Dianne Hackborn Configuration.NATIVE_CONFIG_DENSITY, // DENSITY 5641d0b177754c81a20e272b91c6f703a634fe5c856Dianne Hackborn Configuration.NATIVE_CONFIG_LAYOUTDIR, // LAYOUT DIRECTION 565ebff8f92f13513ce37bd74759eb1db63f2220590Dianne Hackborn }; 566ebff8f92f13513ce37bd74759eb1db63f2220590Dianne Hackborn /** @hide 567ebff8f92f13513ce37bd74759eb1db63f2220590Dianne Hackborn * Convert Java change bits to native. 568ebff8f92f13513ce37bd74759eb1db63f2220590Dianne Hackborn */ 569ebff8f92f13513ce37bd74759eb1db63f2220590Dianne Hackborn public static int activityInfoConfigToNative(int input) { 570ebff8f92f13513ce37bd74759eb1db63f2220590Dianne Hackborn int output = 0; 571ebff8f92f13513ce37bd74759eb1db63f2220590Dianne Hackborn for (int i=0; i<CONFIG_NATIVE_BITS.length; i++) { 572ebff8f92f13513ce37bd74759eb1db63f2220590Dianne Hackborn if ((input&(1<<i)) != 0) { 573ebff8f92f13513ce37bd74759eb1db63f2220590Dianne Hackborn output |= CONFIG_NATIVE_BITS[i]; 574ebff8f92f13513ce37bd74759eb1db63f2220590Dianne Hackborn } 575ebff8f92f13513ce37bd74759eb1db63f2220590Dianne Hackborn } 576ebff8f92f13513ce37bd74759eb1db63f2220590Dianne Hackborn return output; 577ebff8f92f13513ce37bd74759eb1db63f2220590Dianne Hackborn } 578ebff8f92f13513ce37bd74759eb1db63f2220590Dianne Hackborn 5799066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 580e66763516a9c27c192adaba417616371a1c3c9bfDianne Hackborn * @hide 581e66763516a9c27c192adaba417616371a1c3c9bfDianne Hackborn * Unfortunately some developers (OpenFeint I am looking at you) have 582e66763516a9c27c192adaba417616371a1c3c9bfDianne Hackborn * compared the configChanges bit field against absolute values, so if we 583e66763516a9c27c192adaba417616371a1c3c9bfDianne Hackborn * introduce a new bit they break. To deal with that, we will make sure 584e66763516a9c27c192adaba417616371a1c3c9bfDianne Hackborn * the public field will not have a value that breaks them, and let the 585e66763516a9c27c192adaba417616371a1c3c9bfDianne Hackborn * framework call here to get the real value. 586e66763516a9c27c192adaba417616371a1c3c9bfDianne Hackborn */ 587e66763516a9c27c192adaba417616371a1c3c9bfDianne Hackborn public int getRealConfigChanged() { 588e66763516a9c27c192adaba417616371a1c3c9bfDianne Hackborn return applicationInfo.targetSdkVersion < android.os.Build.VERSION_CODES.HONEYCOMB_MR2 589e66763516a9c27c192adaba417616371a1c3c9bfDianne Hackborn ? (configChanges | ActivityInfo.CONFIG_SCREEN_SIZE 590e66763516a9c27c192adaba417616371a1c3c9bfDianne Hackborn | ActivityInfo.CONFIG_SMALLEST_SCREEN_SIZE) 591e66763516a9c27c192adaba417616371a1c3c9bfDianne Hackborn : configChanges; 592e66763516a9c27c192adaba417616371a1c3c9bfDianne Hackborn } 593e66763516a9c27c192adaba417616371a1c3c9bfDianne Hackborn 594e66763516a9c27c192adaba417616371a1c3c9bfDianne Hackborn /** 5959066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Bit mask of kinds of configuration changes that this activity 5969066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * can handle itself (without being restarted by the system). 5979066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Contains any combination of {@link #CONFIG_FONT_SCALE}, 5989066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * {@link #CONFIG_MCC}, {@link #CONFIG_MNC}, 5999066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * {@link #CONFIG_LOCALE}, {@link #CONFIG_TOUCHSCREEN}, 600723738cfaec3dd7b0fe152c872c41bebf94074c4Dianne Hackborn * {@link #CONFIG_KEYBOARD}, {@link #CONFIG_NAVIGATION}, 6015f7979993979466c79ab4f38d83c6f2aca361662Fabrice Di Meglio * {@link #CONFIG_ORIENTATION}, {@link #CONFIG_SCREEN_LAYOUT} and 6025f7979993979466c79ab4f38d83c6f2aca361662Fabrice Di Meglio * {@link #CONFIG_LAYOUT_DIRECTION}. Set from the {@link android.R.attr#configChanges} 6035f7979993979466c79ab4f38d83c6f2aca361662Fabrice Di Meglio * attribute. 6049066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 6059066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public int configChanges; 6069066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 6079066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 6089066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * The desired soft input mode for this activity's main window. 6099066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Set from the {@link android.R.attr#windowSoftInputMode} attribute 6109066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * in the activity's manifest. May be any of the same values allowed 6119066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * for {@link android.view.WindowManager.LayoutParams#softInputMode 6129066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * WindowManager.LayoutParams.softInputMode}. If 0 (unspecified), 6139066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * the mode from the theme will be used. 6149066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 6159066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public int softInputMode; 616269248d112e35fe8e9f0d5d11c96dcb2ac1118b0Adam Powell 617269248d112e35fe8e9f0d5d11c96dcb2ac1118b0Adam Powell /** 618269248d112e35fe8e9f0d5d11c96dcb2ac1118b0Adam Powell * The desired extra UI options for this activity and its main window. 619269248d112e35fe8e9f0d5d11c96dcb2ac1118b0Adam Powell * Set from the {@link android.R.attr#uiOptions} attribute in the 620269248d112e35fe8e9f0d5d11c96dcb2ac1118b0Adam Powell * activity's manifest. 621269248d112e35fe8e9f0d5d11c96dcb2ac1118b0Adam Powell */ 622269248d112e35fe8e9f0d5d11c96dcb2ac1118b0Adam Powell public int uiOptions = 0; 623269248d112e35fe8e9f0d5d11c96dcb2ac1118b0Adam Powell 624269248d112e35fe8e9f0d5d11c96dcb2ac1118b0Adam Powell /** 625e797ed6a74593630219faf7f0ba5dc8235586bceScott Main * Flag for use with {@link #uiOptions}. 626e797ed6a74593630219faf7f0ba5dc8235586bceScott Main * Indicates that the action bar should put all action items in a separate bar when 627e797ed6a74593630219faf7f0ba5dc8235586bceScott Main * the screen is narrow. 628e797ed6a74593630219faf7f0ba5dc8235586bceScott Main * <p>This value corresponds to "splitActionBarWhenNarrow" for the {@link #uiOptions} XML 629e797ed6a74593630219faf7f0ba5dc8235586bceScott Main * attribute. 630269248d112e35fe8e9f0d5d11c96dcb2ac1118b0Adam Powell */ 631269248d112e35fe8e9f0d5d11c96dcb2ac1118b0Adam Powell public static final int UIOPTION_SPLIT_ACTION_BAR_WHEN_NARROW = 1; 632269248d112e35fe8e9f0d5d11c96dcb2ac1118b0Adam Powell 633dd8fab2629131b09367df747afd9a61e42dd1992Adam Powell /** 634dd8fab2629131b09367df747afd9a61e42dd1992Adam Powell * If defined, the activity named here is the logical parent of this activity. 635dd8fab2629131b09367df747afd9a61e42dd1992Adam Powell */ 636dd8fab2629131b09367df747afd9a61e42dd1992Adam Powell public String parentActivityName; 637dd8fab2629131b09367df747afd9a61e42dd1992Adam Powell 6389066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public ActivityInfo() { 6399066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project } 6409066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 6419066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public ActivityInfo(ActivityInfo orig) { 6429066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project super(orig); 6439066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project theme = orig.theme; 6449066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project launchMode = orig.launchMode; 6459066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project permission = orig.permission; 6469066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project taskAffinity = orig.taskAffinity; 6479066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project targetActivity = orig.targetActivity; 6489066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project flags = orig.flags; 6499066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project screenOrientation = orig.screenOrientation; 6509066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project configChanges = orig.configChanges; 6519066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project softInputMode = orig.softInputMode; 652269248d112e35fe8e9f0d5d11c96dcb2ac1118b0Adam Powell uiOptions = orig.uiOptions; 653dd8fab2629131b09367df747afd9a61e42dd1992Adam Powell parentActivityName = orig.parentActivityName; 6549066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project } 6559066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 6569066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project /** 6579066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * Return the theme resource identifier to use for this activity. If 6589066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * the activity defines a theme, that is used; else, the application 6599066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * theme is used. 6609066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * 6619066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project * @return The theme associated with this activity. 6629066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project */ 6639066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public final int getThemeResource() { 6649066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project return theme != 0 ? theme : applicationInfo.theme; 6659066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project } 6669066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 66743e52ed32e2d55ef4aee18c4b4bc13b7fdef9cc4Craig Mautner private String persistableModeToString() { 66843e52ed32e2d55ef4aee18c4b4bc13b7fdef9cc4Craig Mautner switch(persistableMode) { 66943e52ed32e2d55ef4aee18c4b4bc13b7fdef9cc4Craig Mautner case PERSIST_ROOT_ONLY: return "PERSIST_ROOT_ONLY"; 67043e52ed32e2d55ef4aee18c4b4bc13b7fdef9cc4Craig Mautner case DO_NOT_PERSIST: return "DO_NOT_PERSIST"; 67143e52ed32e2d55ef4aee18c4b4bc13b7fdef9cc4Craig Mautner case PERSIST_ACROSS_REBOOTS: return "PERSIST_ACROSS_REBOOTS"; 67243e52ed32e2d55ef4aee18c4b4bc13b7fdef9cc4Craig Mautner default: return "UNKNOWN=" + persistableMode; 67343e52ed32e2d55ef4aee18c4b4bc13b7fdef9cc4Craig Mautner } 67443e52ed32e2d55ef4aee18c4b4bc13b7fdef9cc4Craig Mautner } 67543e52ed32e2d55ef4aee18c4b4bc13b7fdef9cc4Craig Mautner 6769066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public void dump(Printer pw, String prefix) { 6779066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project super.dumpFront(pw, prefix); 67812527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn if (permission != null) { 67912527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn pw.println(prefix + "permission=" + permission); 68012527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn } 6819066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project pw.println(prefix + "taskAffinity=" + taskAffinity 68243e52ed32e2d55ef4aee18c4b4bc13b7fdef9cc4Craig Mautner + " targetActivity=" + targetActivity 68343e52ed32e2d55ef4aee18c4b4bc13b7fdef9cc4Craig Mautner + " persistableMode=" + persistableModeToString()); 68412527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn if (launchMode != 0 || flags != 0 || theme != 0) { 68512527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn pw.println(prefix + "launchMode=" + launchMode 68612527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn + " flags=0x" + Integer.toHexString(flags) 68712527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn + " theme=0x" + Integer.toHexString(theme)); 68812527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn } 68912527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn if (screenOrientation != SCREEN_ORIENTATION_UNSPECIFIED 69012527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn || configChanges != 0 || softInputMode != 0) { 69112527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn pw.println(prefix + "screenOrientation=" + screenOrientation 69212527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn + " configChanges=0x" + Integer.toHexString(configChanges) 69312527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn + " softInputMode=0x" + Integer.toHexString(softInputMode)); 69412527f9fb1cb0a1ad3be8149c1c88a0e731cb4d6Dianne Hackborn } 695269248d112e35fe8e9f0d5d11c96dcb2ac1118b0Adam Powell if (uiOptions != 0) { 696269248d112e35fe8e9f0d5d11c96dcb2ac1118b0Adam Powell pw.println(prefix + " uiOptions=0x" + Integer.toHexString(uiOptions)); 697269248d112e35fe8e9f0d5d11c96dcb2ac1118b0Adam Powell } 6989066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project super.dumpBack(pw, prefix); 6999066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project } 7009066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 7019066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public String toString() { 7029066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project return "ActivityInfo{" 7039066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project + Integer.toHexString(System.identityHashCode(this)) 7049066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project + " " + name + "}"; 7059066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project } 7069066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 7079066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public int describeContents() { 7089066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project return 0; 7099066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project } 7109066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 7119066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public void writeToParcel(Parcel dest, int parcelableFlags) { 7129066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project super.writeToParcel(dest, parcelableFlags); 7139066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project dest.writeInt(theme); 7149066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project dest.writeInt(launchMode); 7159066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project dest.writeString(permission); 7169066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project dest.writeString(taskAffinity); 7179066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project dest.writeString(targetActivity); 7189066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project dest.writeInt(flags); 7199066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project dest.writeInt(screenOrientation); 7209066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project dest.writeInt(configChanges); 7219066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project dest.writeInt(softInputMode); 722269248d112e35fe8e9f0d5d11c96dcb2ac1118b0Adam Powell dest.writeInt(uiOptions); 723dd8fab2629131b09367df747afd9a61e42dd1992Adam Powell dest.writeString(parentActivityName); 72443e52ed32e2d55ef4aee18c4b4bc13b7fdef9cc4Craig Mautner dest.writeInt(persistableMode); 7259066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project } 7269066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 7279066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public static final Parcelable.Creator<ActivityInfo> CREATOR 7289066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project = new Parcelable.Creator<ActivityInfo>() { 7299066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public ActivityInfo createFromParcel(Parcel source) { 7309066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project return new ActivityInfo(source); 7319066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project } 7329066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project public ActivityInfo[] newArray(int size) { 7339066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project return new ActivityInfo[size]; 7349066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project } 7359066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project }; 7369066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 7379066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project private ActivityInfo(Parcel source) { 7389066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project super(source); 7399066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project theme = source.readInt(); 7409066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project launchMode = source.readInt(); 7419066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project permission = source.readString(); 7429066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project taskAffinity = source.readString(); 7439066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project targetActivity = source.readString(); 7449066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project flags = source.readInt(); 7459066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project screenOrientation = source.readInt(); 7469066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project configChanges = source.readInt(); 7479066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project softInputMode = source.readInt(); 748269248d112e35fe8e9f0d5d11c96dcb2ac1118b0Adam Powell uiOptions = source.readInt(); 749dd8fab2629131b09367df747afd9a61e42dd1992Adam Powell parentActivityName = source.readString(); 75043e52ed32e2d55ef4aee18c4b4bc13b7fdef9cc4Craig Mautner persistableMode = source.readInt(); 7519066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project } 7529066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project} 753