Kenny Root | 15a4d2f | 2010-03-11 18:20:12 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2007 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 17 | package android.content.pm; |
| 18 | |
Tor Norbye | d9273d6 | 2013-05-30 15:59:53 -0700 | [diff] [blame] | 19 | import android.annotation.IntDef; |
Dianne Hackborn | 1d0b177 | 2013-09-06 14:02:54 -0700 | [diff] [blame] | 20 | import android.content.res.Configuration; |
Alan Viverette | ac85f90 | 2016-03-11 15:15:51 -0500 | [diff] [blame] | 21 | import android.content.res.Configuration.NativeConfig; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 22 | import android.os.Parcel; |
| 23 | import android.os.Parcelable; |
| 24 | import android.util.Printer; |
| 25 | |
Tor Norbye | d9273d6 | 2013-05-30 15:59:53 -0700 | [diff] [blame] | 26 | import java.lang.annotation.Retention; |
| 27 | import java.lang.annotation.RetentionPolicy; |
| 28 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 29 | /** |
| 30 | * Information you can retrieve about a particular application |
| 31 | * activity or receiver. This corresponds to information collected |
| 32 | * from the AndroidManifest.xml's <activity> and |
| 33 | * <receiver> tags. |
| 34 | */ |
| 35 | public class ActivityInfo extends ComponentInfo |
| 36 | implements Parcelable { |
Robert Carr | 3e2e011 | 2015-09-15 12:30:42 -0700 | [diff] [blame] | 37 | |
| 38 | // NOTE: When adding new data members be sure to update the copy-constructor, Parcel |
| 39 | // constructor, and writeToParcel. |
| 40 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 41 | /** |
| 42 | * A style resource identifier (in the package's resources) of this |
| 43 | * activity's theme. From the "theme" attribute or, if not set, 0. |
| 44 | */ |
| 45 | public int theme; |
Robert Carr | 3e2e011 | 2015-09-15 12:30:42 -0700 | [diff] [blame] | 46 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 47 | /** |
| 48 | * Constant corresponding to <code>standard</code> in |
| 49 | * the {@link android.R.attr#launchMode} attribute. |
| 50 | */ |
| 51 | public static final int LAUNCH_MULTIPLE = 0; |
| 52 | /** |
| 53 | * Constant corresponding to <code>singleTop</code> in |
| 54 | * the {@link android.R.attr#launchMode} attribute. |
| 55 | */ |
| 56 | public static final int LAUNCH_SINGLE_TOP = 1; |
| 57 | /** |
| 58 | * Constant corresponding to <code>singleTask</code> in |
| 59 | * the {@link android.R.attr#launchMode} attribute. |
| 60 | */ |
| 61 | public static final int LAUNCH_SINGLE_TASK = 2; |
| 62 | /** |
| 63 | * Constant corresponding to <code>singleInstance</code> in |
| 64 | * the {@link android.R.attr#launchMode} attribute. |
| 65 | */ |
| 66 | public static final int LAUNCH_SINGLE_INSTANCE = 3; |
| 67 | /** |
| 68 | * The launch mode style requested by the activity. From the |
| 69 | * {@link android.R.attr#launchMode} attribute, one of |
| 70 | * {@link #LAUNCH_MULTIPLE}, |
Filip Gruszczynski | d2f1d94 | 2015-10-14 15:10:12 -0700 | [diff] [blame] | 71 | * {@link #LAUNCH_SINGLE_TOP}, {@link #LAUNCH_SINGLE_TASK}, or |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 72 | * {@link #LAUNCH_SINGLE_INSTANCE}. |
| 73 | */ |
| 74 | public int launchMode; |
Craig Mautner | 2dac056 | 2014-05-06 09:06:44 -0700 | [diff] [blame] | 75 | |
| 76 | /** |
| 77 | * Constant corresponding to <code>none</code> in |
| 78 | * the {@link android.R.attr#documentLaunchMode} attribute. |
| 79 | */ |
| 80 | public static final int DOCUMENT_LAUNCH_NONE = 0; |
| 81 | /** |
| 82 | * Constant corresponding to <code>intoExisting</code> in |
| 83 | * the {@link android.R.attr#documentLaunchMode} attribute. |
| 84 | */ |
| 85 | public static final int DOCUMENT_LAUNCH_INTO_EXISTING = 1; |
| 86 | /** |
| 87 | * Constant corresponding to <code>always</code> in |
| 88 | * the {@link android.R.attr#documentLaunchMode} attribute. |
| 89 | */ |
| 90 | public static final int DOCUMENT_LAUNCH_ALWAYS = 2; |
| 91 | /** |
Craig Mautner | f357c0c | 2014-06-09 09:23:27 -0700 | [diff] [blame] | 92 | * Constant corresponding to <code>never</code> in |
| 93 | * the {@link android.R.attr#documentLaunchMode} attribute. |
| 94 | */ |
| 95 | public static final int DOCUMENT_LAUNCH_NEVER = 3; |
| 96 | /** |
Craig Mautner | 2dac056 | 2014-05-06 09:06:44 -0700 | [diff] [blame] | 97 | * The document launch mode style requested by the activity. From the |
| 98 | * {@link android.R.attr#documentLaunchMode} attribute, one of |
| 99 | * {@link #DOCUMENT_LAUNCH_NONE}, {@link #DOCUMENT_LAUNCH_INTO_EXISTING}, |
| 100 | * {@link #DOCUMENT_LAUNCH_ALWAYS}. |
| 101 | * |
| 102 | * <p>Modes DOCUMENT_LAUNCH_ALWAYS |
| 103 | * and DOCUMENT_LAUNCH_INTO_EXISTING are equivalent to {@link |
| 104 | * android.content.Intent#FLAG_ACTIVITY_NEW_DOCUMENT |
| 105 | * Intent.FLAG_ACTIVITY_NEW_DOCUMENT} with and without {@link |
| 106 | * android.content.Intent#FLAG_ACTIVITY_MULTIPLE_TASK |
| 107 | * Intent.FLAG_ACTIVITY_MULTIPLE_TASK} respectively. |
| 108 | */ |
| 109 | public int documentLaunchMode; |
| 110 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 111 | /** |
Craig Mautner | 43e52ed | 2014-06-16 17:18:52 -0700 | [diff] [blame] | 112 | * Constant corresponding to <code>persistRootOnly</code> in |
| 113 | * the {@link android.R.attr#persistableMode} attribute. |
| 114 | */ |
| 115 | public static final int PERSIST_ROOT_ONLY = 0; |
| 116 | /** |
| 117 | * Constant corresponding to <code>doNotPersist</code> in |
| 118 | * the {@link android.R.attr#persistableMode} attribute. |
| 119 | */ |
Craig Mautner | 7f72f53 | 2014-07-21 10:07:12 -0700 | [diff] [blame] | 120 | public static final int PERSIST_NEVER = 1; |
Craig Mautner | 43e52ed | 2014-06-16 17:18:52 -0700 | [diff] [blame] | 121 | /** |
| 122 | * Constant corresponding to <code>persistAcrossReboots</code> in |
| 123 | * the {@link android.R.attr#persistableMode} attribute. |
| 124 | */ |
| 125 | public static final int PERSIST_ACROSS_REBOOTS = 2; |
| 126 | /** |
| 127 | * Value indicating how this activity is to be persisted across |
| 128 | * reboots for restoring in the Recents list. |
| 129 | * {@link android.R.attr#persistableMode} |
| 130 | */ |
| 131 | public int persistableMode; |
| 132 | |
| 133 | /** |
Craig Mautner | ffcfcaa | 2014-06-05 09:54:38 -0700 | [diff] [blame] | 134 | * The maximum number of tasks rooted at this activity that can be in the recent task list. |
| 135 | * Refer to {@link android.R.attr#maxRecents}. |
| 136 | */ |
| 137 | public int maxRecents; |
| 138 | |
| 139 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 140 | * Optional name of a permission required to be able to access this |
| 141 | * Activity. From the "permission" attribute. |
| 142 | */ |
| 143 | public String permission; |
Filip Gruszczynski | d2f1d94 | 2015-10-14 15:10:12 -0700 | [diff] [blame] | 144 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 145 | /** |
| 146 | * The affinity this activity has for another task in the system. The |
| 147 | * string here is the name of the task, often the package name of the |
| 148 | * overall package. If null, the activity has no affinity. Set from the |
| 149 | * {@link android.R.attr#taskAffinity} attribute. |
| 150 | */ |
| 151 | public String taskAffinity; |
Filip Gruszczynski | d2f1d94 | 2015-10-14 15:10:12 -0700 | [diff] [blame] | 152 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 153 | /** |
| 154 | * If this is an activity alias, this is the real activity class to run |
| 155 | * for it. Otherwise, this is null. |
| 156 | */ |
| 157 | public String targetActivity; |
Filip Gruszczynski | d2f1d94 | 2015-10-14 15:10:12 -0700 | [diff] [blame] | 158 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 159 | /** |
Wale Ogunwale | d26176f | 2016-01-25 20:04:04 -0800 | [diff] [blame] | 160 | * Activity can not be resized and always occupies the fullscreen area with all windows fully |
| 161 | * visible. |
| 162 | * @hide |
| 163 | */ |
| 164 | public static final int RESIZE_MODE_UNRESIZEABLE = 0; |
| 165 | /** |
| 166 | * Activity can not be resized and always occupies the fullscreen area with all windows cropped |
| 167 | * to either the task or stack bounds. |
| 168 | * @hide |
| 169 | */ |
| 170 | public static final int RESIZE_MODE_CROP_WINDOWS = 1; |
| 171 | /** |
| 172 | * Activity is resizeable. |
| 173 | * @hide |
| 174 | */ |
| 175 | public static final int RESIZE_MODE_RESIZEABLE = 2; |
| 176 | /** |
| 177 | * Activity is resizeable and supported picture-in-picture mode. |
| 178 | * @hide |
| 179 | */ |
| 180 | public static final int RESIZE_MODE_RESIZEABLE_AND_PIPABLE = 3; |
| 181 | /** |
Wale Ogunwale | d829d36 | 2016-02-10 19:24:49 -0800 | [diff] [blame] | 182 | * Activity is does not support resizing, but we are forcing it to be resizeable. |
| 183 | * @hide |
| 184 | */ |
| 185 | public static final int RESIZE_MODE_FORCE_RESIZEABLE = 4; |
| 186 | /** |
Wale Ogunwale | d26176f | 2016-01-25 20:04:04 -0800 | [diff] [blame] | 187 | * Value indicating if the resizing mode the activity supports. |
| 188 | * See {@link android.R.attr#resizeableActivity}. |
| 189 | * @hide |
| 190 | */ |
| 191 | public int resizeMode; |
| 192 | |
| 193 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 194 | * Bit in {@link #flags} indicating whether this activity is able to |
| 195 | * run in multiple processes. If |
| 196 | * true, the system may instantiate it in the some process as the |
| 197 | * process starting it in order to conserve resources. If false, the |
| 198 | * default, it always runs in {@link #processName}. Set from the |
| 199 | * {@link android.R.attr#multiprocess} attribute. |
| 200 | */ |
| 201 | public static final int FLAG_MULTIPROCESS = 0x0001; |
| 202 | /** |
| 203 | * Bit in {@link #flags} indicating that, when the activity's task is |
| 204 | * relaunched from home, this activity should be finished. |
| 205 | * Set from the |
| 206 | * {@link android.R.attr#finishOnTaskLaunch} attribute. |
| 207 | */ |
| 208 | public static final int FLAG_FINISH_ON_TASK_LAUNCH = 0x0002; |
| 209 | /** |
| 210 | * Bit in {@link #flags} indicating that, when the activity is the root |
| 211 | * of a task, that task's stack should be cleared each time the user |
| 212 | * re-launches it from home. As a result, the user will always |
| 213 | * return to the original activity at the top of the task. |
| 214 | * This flag only applies to activities that |
| 215 | * are used to start the root of a new task. Set from the |
| 216 | * {@link android.R.attr#clearTaskOnLaunch} attribute. |
| 217 | */ |
| 218 | public static final int FLAG_CLEAR_TASK_ON_LAUNCH = 0x0004; |
| 219 | /** |
| 220 | * Bit in {@link #flags} indicating that, when the activity is the root |
| 221 | * of a task, that task's stack should never be cleared when it is |
| 222 | * relaunched from home. Set from the |
| 223 | * {@link android.R.attr#alwaysRetainTaskState} attribute. |
| 224 | */ |
| 225 | public static final int FLAG_ALWAYS_RETAIN_TASK_STATE = 0x0008; |
| 226 | /** |
| 227 | * Bit in {@link #flags} indicating that the activity's state |
| 228 | * is not required to be saved, so that if there is a failure the |
| 229 | * activity will not be removed from the activity stack. Set from the |
| 230 | * {@link android.R.attr#stateNotNeeded} attribute. |
| 231 | */ |
| 232 | public static final int FLAG_STATE_NOT_NEEDED = 0x0010; |
| 233 | /** |
| 234 | * Bit in {@link #flags} that indicates that the activity should not |
| 235 | * appear in the list of recently launched activities. Set from the |
| 236 | * {@link android.R.attr#excludeFromRecents} attribute. |
| 237 | */ |
| 238 | public static final int FLAG_EXCLUDE_FROM_RECENTS = 0x0020; |
| 239 | /** |
| 240 | * Bit in {@link #flags} that indicates that the activity can be moved |
| 241 | * between tasks based on its task affinity. Set from the |
| 242 | * {@link android.R.attr#allowTaskReparenting} attribute. |
| 243 | */ |
| 244 | public static final int FLAG_ALLOW_TASK_REPARENTING = 0x0040; |
| 245 | /** |
| 246 | * Bit in {@link #flags} indicating that, when the user navigates away |
| 247 | * from an activity, it should be finished. |
| 248 | * Set from the |
| 249 | * {@link android.R.attr#noHistory} attribute. |
| 250 | */ |
| 251 | public static final int FLAG_NO_HISTORY = 0x0080; |
| 252 | /** |
Dianne Hackborn | ffa4248 | 2009-09-23 22:20:11 -0700 | [diff] [blame] | 253 | * Bit in {@link #flags} indicating that, when a request to close system |
| 254 | * windows happens, this activity is finished. |
| 255 | * Set from the |
| 256 | * {@link android.R.attr#finishOnCloseSystemDialogs} attribute. |
| 257 | */ |
| 258 | public static final int FLAG_FINISH_ON_CLOSE_SYSTEM_DIALOGS = 0x0100; |
Dianne Hackborn | 327fbd2 | 2011-01-17 14:38:50 -0800 | [diff] [blame] | 259 | /** |
| 260 | * Value for {@link #flags}: true when the application's rendering should |
| 261 | * be hardware accelerated. |
| 262 | */ |
| 263 | public static final int FLAG_HARDWARE_ACCELERATED = 0x0200; |
| 264 | /** |
Wale Ogunwale | 6dfdfd6 | 2015-04-15 12:01:38 -0700 | [diff] [blame] | 265 | * Value for {@link #flags}: true when the application can be displayed for all users |
| 266 | * regardless of if the user of the application is the current user. Set from the |
| 267 | * {@link android.R.attr#showForAllUsers} attribute. |
Craig Mautner | 5962b12 | 2012-10-05 14:45:52 -0700 | [diff] [blame] | 268 | * @hide |
| 269 | */ |
Wale Ogunwale | 6dfdfd6 | 2015-04-15 12:01:38 -0700 | [diff] [blame] | 270 | public static final int FLAG_SHOW_FOR_ALL_USERS = 0x0400; |
Craig Mautner | 5962b12 | 2012-10-05 14:45:52 -0700 | [diff] [blame] | 271 | /** |
John Spurlock | 322d771 | 2013-09-05 02:39:46 +0000 | [diff] [blame] | 272 | * Bit in {@link #flags} corresponding to an immersive activity |
Daniel Sandler | 613dde4 | 2010-06-21 13:46:39 -0400 | [diff] [blame] | 273 | * that wishes not to be interrupted by notifications. |
| 274 | * Applications that hide the system notification bar with |
| 275 | * {@link android.view.WindowManager.LayoutParams#FLAG_FULLSCREEN} |
| 276 | * may still be interrupted by high-priority notifications; for example, an |
| 277 | * incoming phone call may use |
Daniel Sandler | 8091ca5 | 2010-06-22 13:58:46 -0400 | [diff] [blame] | 278 | * {@link android.app.Notification#fullScreenIntent fullScreenIntent} |
Daniel Sandler | 613dde4 | 2010-06-21 13:46:39 -0400 | [diff] [blame] | 279 | * to present a full-screen in-call activity to the user, pausing the |
| 280 | * current activity as a side-effect. An activity with |
| 281 | * {@link #FLAG_IMMERSIVE} set, however, will not be interrupted; the |
| 282 | * notification may be shown in some other way (such as a small floating |
| 283 | * "toast" window). |
Christopher Tate | 73c2aee | 2012-03-15 16:27:14 -0700 | [diff] [blame] | 284 | * |
| 285 | * Note that this flag will always reflect the Activity's |
| 286 | * <code>android:immersive</code> manifest definition, even if the Activity's |
| 287 | * immersive state is changed at runtime via |
| 288 | * {@link android.app.Activity#setImmersive(boolean)}. |
| 289 | * |
| 290 | * @see android.app.Notification#FLAG_HIGH_PRIORITY |
| 291 | * @see android.app.Activity#setImmersive(boolean) |
Daniel Sandler | 613dde4 | 2010-06-21 13:46:39 -0400 | [diff] [blame] | 292 | */ |
Craig Mautner | 5962b12 | 2012-10-05 14:45:52 -0700 | [diff] [blame] | 293 | public static final int FLAG_IMMERSIVE = 0x0800; |
Romain Guy | 529b60a | 2010-08-03 18:05:47 -0700 | [diff] [blame] | 294 | /** |
Craig Mautner | 9d4e9bc | 2014-06-18 18:34:56 -0700 | [diff] [blame] | 295 | * Bit in {@link #flags}: If set, a task rooted at this activity will have its |
| 296 | * baseIntent replaced by the activity immediately above this. Each activity may further |
| 297 | * relinquish its identity to the activity above it using this flag. Set from the |
Dianne Hackborn | a4e102e | 2014-09-04 22:52:27 -0700 | [diff] [blame] | 298 | * {@link android.R.attr#relinquishTaskIdentity} attribute. |
Craig Mautner | 9d4e9bc | 2014-06-18 18:34:56 -0700 | [diff] [blame] | 299 | */ |
| 300 | public static final int FLAG_RELINQUISH_TASK_IDENTITY = 0x1000; |
| 301 | /** |
Craig Mautner | 2dac056 | 2014-05-06 09:06:44 -0700 | [diff] [blame] | 302 | * Bit in {@link #flags} indicating that tasks started with this activity are to be |
| 303 | * removed from the recent list of tasks when the last activity in the task is finished. |
Dianne Hackborn | a4e102e | 2014-09-04 22:52:27 -0700 | [diff] [blame] | 304 | * Corresponds to {@link android.R.attr#autoRemoveFromRecents} |
Craig Mautner | 2dac056 | 2014-05-06 09:06:44 -0700 | [diff] [blame] | 305 | */ |
| 306 | public static final int FLAG_AUTO_REMOVE_FROM_RECENTS = 0x2000; |
| 307 | /** |
Dianne Hackborn | a4e102e | 2014-09-04 22:52:27 -0700 | [diff] [blame] | 308 | * Bit in {@link #flags} indicating that this activity can start is creation/resume |
| 309 | * while the previous activity is still pausing. Corresponds to |
| 310 | * {@link android.R.attr#resumeWhilePausing} |
| 311 | */ |
| 312 | public static final int FLAG_RESUME_WHILE_PAUSING = 0x4000; |
| 313 | /** |
Ruben Brunk | dd18a0b | 2015-12-04 16:16:31 -0800 | [diff] [blame] | 314 | * Bit in {@link #flags} indicating that this activity should be run with VR mode enabled. |
| 315 | * |
| 316 | * {@see android.app.Activity#setVrMode(boolean)}. |
| 317 | */ |
| 318 | public static final int FLAG_ENABLE_VR_MODE = 0x8000; |
Wale Ogunwale | 6cae765 | 2015-12-26 07:36:26 -0800 | [diff] [blame] | 319 | |
| 320 | /** |
Wale Ogunwale | 6cae765 | 2015-12-26 07:36:26 -0800 | [diff] [blame] | 321 | * Bit in {@link #flags} indicating if the activity is always focusable regardless of if it is |
| 322 | * in a task/stack whose activities are normally not focusable. |
| 323 | * See android.R.attr#alwaysFocusable. |
| 324 | * @hide |
| 325 | */ |
| 326 | public static final int FLAG_ALWAYS_FOCUSABLE = 0x40000; |
| 327 | |
Ruben Brunk | dd18a0b | 2015-12-04 16:16:31 -0800 | [diff] [blame] | 328 | /** |
Dianne Hackborn | d4ac8d7 | 2012-09-27 23:20:10 -0700 | [diff] [blame] | 329 | * @hide Bit in {@link #flags}: If set, this component will only be seen |
Fyodor Kupolov | 4f5de34 | 2015-08-25 10:08:45 -0700 | [diff] [blame] | 330 | * by the system user. Only works with broadcast receivers. Set from the |
| 331 | * android.R.attr#systemUserOnly attribute. |
Dianne Hackborn | d4ac8d7 | 2012-09-27 23:20:10 -0700 | [diff] [blame] | 332 | */ |
Fyodor Kupolov | 4f5de34 | 2015-08-25 10:08:45 -0700 | [diff] [blame] | 333 | public static final int FLAG_SYSTEM_USER_ONLY = 0x20000000; |
Dianne Hackborn | d4ac8d7 | 2012-09-27 23:20:10 -0700 | [diff] [blame] | 334 | /** |
Dianne Hackborn | 7d19e02 | 2012-08-07 19:12:33 -0700 | [diff] [blame] | 335 | * Bit in {@link #flags}: If set, a single instance of the receiver will |
| 336 | * run for all users on the device. Set from the |
| 337 | * {@link android.R.attr#singleUser} attribute. Note that this flag is |
Dianne Hackborn | d4ac8d7 | 2012-09-27 23:20:10 -0700 | [diff] [blame] | 338 | * only relevant for ActivityInfo structures that are describing receiver |
Dianne Hackborn | 7d19e02 | 2012-08-07 19:12:33 -0700 | [diff] [blame] | 339 | * components; it is not applied to activities. |
| 340 | */ |
| 341 | public static final int FLAG_SINGLE_USER = 0x40000000; |
| 342 | /** |
Craig Mautner | ffd14a1 | 2014-04-23 21:38:50 -0700 | [diff] [blame] | 343 | * @hide Bit in {@link #flags}: If set, this activity may be launched into an |
| 344 | * owned ActivityContainer such as that within an ActivityView. If not set and |
Svet Ganov | f2acc54 | 2015-11-06 09:02:00 -0800 | [diff] [blame] | 345 | * this activity is launched into such a container a SecurityException will be |
Craig Mautner | ffd14a1 | 2014-04-23 21:38:50 -0700 | [diff] [blame] | 346 | * thrown. Set from the {@link android.R.attr#allowEmbedded} attribute. |
| 347 | */ |
| 348 | public static final int FLAG_ALLOW_EMBEDDED = 0x80000000; |
| 349 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 350 | * Options that have been set in the activity declaration in the |
Daniel Sandler | 613dde4 | 2010-06-21 13:46:39 -0400 | [diff] [blame] | 351 | * manifest. |
| 352 | * These include: |
| 353 | * {@link #FLAG_MULTIPROCESS}, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 354 | * {@link #FLAG_FINISH_ON_TASK_LAUNCH}, {@link #FLAG_CLEAR_TASK_ON_LAUNCH}, |
| 355 | * {@link #FLAG_ALWAYS_RETAIN_TASK_STATE}, |
| 356 | * {@link #FLAG_STATE_NOT_NEEDED}, {@link #FLAG_EXCLUDE_FROM_RECENTS}, |
Dianne Hackborn | ffa4248 | 2009-09-23 22:20:11 -0700 | [diff] [blame] | 357 | * {@link #FLAG_ALLOW_TASK_REPARENTING}, {@link #FLAG_NO_HISTORY}, |
Daniel Sandler | 613dde4 | 2010-06-21 13:46:39 -0400 | [diff] [blame] | 358 | * {@link #FLAG_FINISH_ON_CLOSE_SYSTEM_DIALOGS}, |
Dianne Hackborn | 7d19e02 | 2012-08-07 19:12:33 -0700 | [diff] [blame] | 359 | * {@link #FLAG_HARDWARE_ACCELERATED}, {@link #FLAG_SINGLE_USER}. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 360 | */ |
| 361 | public int flags; |
| 362 | |
Tor Norbye | d9273d6 | 2013-05-30 15:59:53 -0700 | [diff] [blame] | 363 | /** @hide */ |
| 364 | @IntDef({ |
| 365 | SCREEN_ORIENTATION_UNSPECIFIED, |
| 366 | SCREEN_ORIENTATION_LANDSCAPE, |
| 367 | SCREEN_ORIENTATION_PORTRAIT, |
| 368 | SCREEN_ORIENTATION_USER, |
| 369 | SCREEN_ORIENTATION_BEHIND, |
| 370 | SCREEN_ORIENTATION_SENSOR, |
| 371 | SCREEN_ORIENTATION_NOSENSOR, |
| 372 | SCREEN_ORIENTATION_SENSOR_LANDSCAPE, |
| 373 | SCREEN_ORIENTATION_SENSOR_PORTRAIT, |
| 374 | SCREEN_ORIENTATION_REVERSE_LANDSCAPE, |
| 375 | SCREEN_ORIENTATION_REVERSE_PORTRAIT, |
| 376 | SCREEN_ORIENTATION_FULL_SENSOR, |
| 377 | SCREEN_ORIENTATION_USER_LANDSCAPE, |
| 378 | SCREEN_ORIENTATION_USER_PORTRAIT, |
| 379 | SCREEN_ORIENTATION_FULL_USER, |
| 380 | SCREEN_ORIENTATION_LOCKED |
| 381 | }) |
| 382 | @Retention(RetentionPolicy.SOURCE) |
| 383 | public @interface ScreenOrientation {} |
| 384 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 385 | /** |
| 386 | * Constant corresponding to <code>unspecified</code> in |
| 387 | * the {@link android.R.attr#screenOrientation} attribute. |
| 388 | */ |
| 389 | public static final int SCREEN_ORIENTATION_UNSPECIFIED = -1; |
| 390 | /** |
| 391 | * Constant corresponding to <code>landscape</code> in |
| 392 | * the {@link android.R.attr#screenOrientation} attribute. |
| 393 | */ |
| 394 | public static final int SCREEN_ORIENTATION_LANDSCAPE = 0; |
| 395 | /** |
| 396 | * Constant corresponding to <code>portrait</code> in |
| 397 | * the {@link android.R.attr#screenOrientation} attribute. |
| 398 | */ |
| 399 | public static final int SCREEN_ORIENTATION_PORTRAIT = 1; |
| 400 | /** |
| 401 | * Constant corresponding to <code>user</code> in |
| 402 | * the {@link android.R.attr#screenOrientation} attribute. |
| 403 | */ |
| 404 | public static final int SCREEN_ORIENTATION_USER = 2; |
| 405 | /** |
| 406 | * Constant corresponding to <code>behind</code> in |
| 407 | * the {@link android.R.attr#screenOrientation} attribute. |
| 408 | */ |
| 409 | public static final int SCREEN_ORIENTATION_BEHIND = 3; |
| 410 | /** |
| 411 | * Constant corresponding to <code>sensor</code> in |
| 412 | * the {@link android.R.attr#screenOrientation} attribute. |
| 413 | */ |
| 414 | public static final int SCREEN_ORIENTATION_SENSOR = 4; |
Filip Gruszczynski | d2f1d94 | 2015-10-14 15:10:12 -0700 | [diff] [blame] | 415 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 416 | /** |
Dianne Hackborn | e5439f2 | 2010-10-02 16:53:50 -0700 | [diff] [blame] | 417 | * Constant corresponding to <code>nosensor</code> in |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 418 | * the {@link android.R.attr#screenOrientation} attribute. |
| 419 | */ |
| 420 | public static final int SCREEN_ORIENTATION_NOSENSOR = 5; |
Dianne Hackborn | e5439f2 | 2010-10-02 16:53:50 -0700 | [diff] [blame] | 421 | |
| 422 | /** |
| 423 | * Constant corresponding to <code>sensorLandscape</code> in |
| 424 | * the {@link android.R.attr#screenOrientation} attribute. |
| 425 | */ |
| 426 | public static final int SCREEN_ORIENTATION_SENSOR_LANDSCAPE = 6; |
| 427 | |
| 428 | /** |
| 429 | * Constant corresponding to <code>sensorPortrait</code> in |
| 430 | * the {@link android.R.attr#screenOrientation} attribute. |
| 431 | */ |
| 432 | public static final int SCREEN_ORIENTATION_SENSOR_PORTRAIT = 7; |
| 433 | |
| 434 | /** |
| 435 | * Constant corresponding to <code>reverseLandscape</code> in |
| 436 | * the {@link android.R.attr#screenOrientation} attribute. |
| 437 | */ |
| 438 | public static final int SCREEN_ORIENTATION_REVERSE_LANDSCAPE = 8; |
| 439 | |
| 440 | /** |
| 441 | * Constant corresponding to <code>reversePortrait</code> in |
| 442 | * the {@link android.R.attr#screenOrientation} attribute. |
| 443 | */ |
| 444 | public static final int SCREEN_ORIENTATION_REVERSE_PORTRAIT = 9; |
| 445 | |
| 446 | /** |
| 447 | * Constant corresponding to <code>fullSensor</code> in |
| 448 | * the {@link android.R.attr#screenOrientation} attribute. |
| 449 | */ |
| 450 | public static final int SCREEN_ORIENTATION_FULL_SENSOR = 10; |
| 451 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 452 | /** |
Dianne Hackborn | b9ec1ac | 2013-04-10 17:34:25 -0700 | [diff] [blame] | 453 | * Constant corresponding to <code>userLandscape</code> in |
| 454 | * the {@link android.R.attr#screenOrientation} attribute. |
| 455 | */ |
| 456 | public static final int SCREEN_ORIENTATION_USER_LANDSCAPE = 11; |
| 457 | |
| 458 | /** |
| 459 | * Constant corresponding to <code>userPortrait</code> in |
| 460 | * the {@link android.R.attr#screenOrientation} attribute. |
| 461 | */ |
| 462 | public static final int SCREEN_ORIENTATION_USER_PORTRAIT = 12; |
| 463 | |
| 464 | /** |
| 465 | * Constant corresponding to <code>fullUser</code> in |
| 466 | * the {@link android.R.attr#screenOrientation} attribute. |
| 467 | */ |
| 468 | public static final int SCREEN_ORIENTATION_FULL_USER = 13; |
| 469 | |
| 470 | /** |
| 471 | * Constant corresponding to <code>locked</code> in |
| 472 | * the {@link android.R.attr#screenOrientation} attribute. |
| 473 | */ |
| 474 | public static final int SCREEN_ORIENTATION_LOCKED = 14; |
| 475 | |
| 476 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 477 | * The preferred screen orientation this activity would like to run in. |
| 478 | * From the {@link android.R.attr#screenOrientation} attribute, one of |
| 479 | * {@link #SCREEN_ORIENTATION_UNSPECIFIED}, |
Filip Gruszczynski | d2f1d94 | 2015-10-14 15:10:12 -0700 | [diff] [blame] | 480 | * {@link #SCREEN_ORIENTATION_LANDSCAPE}, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 481 | * {@link #SCREEN_ORIENTATION_PORTRAIT}, |
| 482 | * {@link #SCREEN_ORIENTATION_USER}, |
| 483 | * {@link #SCREEN_ORIENTATION_BEHIND}, |
| 484 | * {@link #SCREEN_ORIENTATION_SENSOR}, |
Dianne Hackborn | e5439f2 | 2010-10-02 16:53:50 -0700 | [diff] [blame] | 485 | * {@link #SCREEN_ORIENTATION_NOSENSOR}, |
| 486 | * {@link #SCREEN_ORIENTATION_SENSOR_LANDSCAPE}, |
| 487 | * {@link #SCREEN_ORIENTATION_SENSOR_PORTRAIT}, |
| 488 | * {@link #SCREEN_ORIENTATION_REVERSE_LANDSCAPE}, |
| 489 | * {@link #SCREEN_ORIENTATION_REVERSE_PORTRAIT}, |
Dianne Hackborn | b9ec1ac | 2013-04-10 17:34:25 -0700 | [diff] [blame] | 490 | * {@link #SCREEN_ORIENTATION_FULL_SENSOR}, |
| 491 | * {@link #SCREEN_ORIENTATION_USER_LANDSCAPE}, |
| 492 | * {@link #SCREEN_ORIENTATION_USER_PORTRAIT}, |
| 493 | * {@link #SCREEN_ORIENTATION_FULL_USER}, |
| 494 | * {@link #SCREEN_ORIENTATION_LOCKED}, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 495 | */ |
Tor Norbye | d9273d6 | 2013-05-30 15:59:53 -0700 | [diff] [blame] | 496 | @ScreenOrientation |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 497 | public int screenOrientation = SCREEN_ORIENTATION_UNSPECIFIED; |
Filip Gruszczynski | d2f1d94 | 2015-10-14 15:10:12 -0700 | [diff] [blame] | 498 | |
Alan Viverette | ac85f90 | 2016-03-11 15:15:51 -0500 | [diff] [blame] | 499 | /** @hide */ |
| 500 | @IntDef(flag = true, |
| 501 | value = { |
| 502 | CONFIG_MCC, |
| 503 | CONFIG_MNC, |
| 504 | CONFIG_LOCALE, |
| 505 | CONFIG_TOUCHSCREEN, |
| 506 | CONFIG_KEYBOARD, |
| 507 | CONFIG_KEYBOARD_HIDDEN, |
| 508 | CONFIG_NAVIGATION, |
| 509 | CONFIG_ORIENTATION, |
| 510 | CONFIG_SCREEN_LAYOUT, |
| 511 | CONFIG_UI_MODE, |
| 512 | CONFIG_SCREEN_SIZE, |
| 513 | CONFIG_SMALLEST_SCREEN_SIZE, |
| 514 | CONFIG_DENSITY, |
| 515 | CONFIG_LAYOUT_DIRECTION, |
| 516 | CONFIG_FONT_SCALE, |
| 517 | }) |
| 518 | @Retention(RetentionPolicy.SOURCE) |
| 519 | public @interface Config {} |
| 520 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 521 | /** |
| 522 | * Bit in {@link #configChanges} that indicates that the activity |
| 523 | * can itself handle changes to the IMSI MCC. Set from the |
| 524 | * {@link android.R.attr#configChanges} attribute. |
| 525 | */ |
| 526 | public static final int CONFIG_MCC = 0x0001; |
| 527 | /** |
| 528 | * Bit in {@link #configChanges} that indicates that the activity |
| 529 | * can itself handle changes to the IMSI MNC. Set from the |
| 530 | * {@link android.R.attr#configChanges} attribute. |
| 531 | */ |
| 532 | public static final int CONFIG_MNC = 0x0002; |
| 533 | /** |
| 534 | * Bit in {@link #configChanges} that indicates that the activity |
| 535 | * can itself handle changes to the locale. Set from the |
| 536 | * {@link android.R.attr#configChanges} attribute. |
| 537 | */ |
| 538 | public static final int CONFIG_LOCALE = 0x0004; |
| 539 | /** |
| 540 | * Bit in {@link #configChanges} that indicates that the activity |
| 541 | * can itself handle changes to the touchscreen type. Set from the |
| 542 | * {@link android.R.attr#configChanges} attribute. |
| 543 | */ |
| 544 | public static final int CONFIG_TOUCHSCREEN = 0x0008; |
| 545 | /** |
| 546 | * Bit in {@link #configChanges} that indicates that the activity |
| 547 | * can itself handle changes to the keyboard type. Set from the |
| 548 | * {@link android.R.attr#configChanges} attribute. |
| 549 | */ |
| 550 | public static final int CONFIG_KEYBOARD = 0x0010; |
| 551 | /** |
| 552 | * Bit in {@link #configChanges} that indicates that the activity |
Dianne Hackborn | 93e462b | 2009-09-15 22:50:40 -0700 | [diff] [blame] | 553 | * can itself handle changes to the keyboard or navigation being hidden/exposed. |
| 554 | * Note that inspite of the name, this applies to the changes to any |
| 555 | * hidden states: keyboard or navigation. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 556 | * Set from the {@link android.R.attr#configChanges} attribute. |
| 557 | */ |
| 558 | public static final int CONFIG_KEYBOARD_HIDDEN = 0x0020; |
| 559 | /** |
| 560 | * Bit in {@link #configChanges} that indicates that the activity |
| 561 | * can itself handle changes to the navigation type. Set from the |
| 562 | * {@link android.R.attr#configChanges} attribute. |
| 563 | */ |
| 564 | public static final int CONFIG_NAVIGATION = 0x0040; |
| 565 | /** |
| 566 | * Bit in {@link #configChanges} that indicates that the activity |
| 567 | * can itself handle changes to the screen orientation. Set from the |
| 568 | * {@link android.R.attr#configChanges} attribute. |
| 569 | */ |
| 570 | public static final int CONFIG_ORIENTATION = 0x0080; |
| 571 | /** |
| 572 | * Bit in {@link #configChanges} that indicates that the activity |
Dianne Hackborn | 723738c | 2009-06-25 19:48:04 -0700 | [diff] [blame] | 573 | * can itself handle changes to the screen layout. Set from the |
| 574 | * {@link android.R.attr#configChanges} attribute. |
| 575 | */ |
| 576 | public static final int CONFIG_SCREEN_LAYOUT = 0x0100; |
| 577 | /** |
| 578 | * Bit in {@link #configChanges} that indicates that the activity |
Tobias Haamel | 27b28b3 | 2010-02-09 23:09:17 +0100 | [diff] [blame] | 579 | * can itself handle the ui mode. Set from the |
| 580 | * {@link android.R.attr#configChanges} attribute. |
Tobias Haamel | 27b28b3 | 2010-02-09 23:09:17 +0100 | [diff] [blame] | 581 | */ |
| 582 | public static final int CONFIG_UI_MODE = 0x0200; |
| 583 | /** |
| 584 | * Bit in {@link #configChanges} that indicates that the activity |
Dianne Hackborn | ebff8f9 | 2011-05-12 18:07:47 -0700 | [diff] [blame] | 585 | * can itself handle the screen size. Set from the |
Dianne Hackborn | e667635 | 2011-06-01 16:51:20 -0700 | [diff] [blame] | 586 | * {@link android.R.attr#configChanges} attribute. This will be |
| 587 | * set by default for applications that target an earlier version |
| 588 | * than {@link android.os.Build.VERSION_CODES#HONEYCOMB_MR2}... |
| 589 | * <b>however</b>, you will not see the bit set here becomes some |
| 590 | * applications incorrectly compare {@link #configChanges} against |
| 591 | * an absolute value rather than correctly masking out the bits |
| 592 | * they are interested in. Please don't do that, thanks. |
Dianne Hackborn | ebff8f9 | 2011-05-12 18:07:47 -0700 | [diff] [blame] | 593 | */ |
| 594 | public static final int CONFIG_SCREEN_SIZE = 0x0400; |
| 595 | /** |
| 596 | * Bit in {@link #configChanges} that indicates that the activity |
Dianne Hackborn | 69cb875 | 2011-05-19 18:13:32 -0700 | [diff] [blame] | 597 | * can itself handle the smallest screen size. Set from the |
Dianne Hackborn | e667635 | 2011-06-01 16:51:20 -0700 | [diff] [blame] | 598 | * {@link android.R.attr#configChanges} attribute. This will be |
| 599 | * set by default for applications that target an earlier version |
| 600 | * than {@link android.os.Build.VERSION_CODES#HONEYCOMB_MR2}... |
| 601 | * <b>however</b>, you will not see the bit set here becomes some |
| 602 | * applications incorrectly compare {@link #configChanges} against |
| 603 | * an absolute value rather than correctly masking out the bits |
| 604 | * they are interested in. Please don't do that, thanks. |
Dianne Hackborn | 69cb875 | 2011-05-19 18:13:32 -0700 | [diff] [blame] | 605 | */ |
| 606 | public static final int CONFIG_SMALLEST_SCREEN_SIZE = 0x0800; |
| 607 | /** |
| 608 | * Bit in {@link #configChanges} that indicates that the activity |
Dianne Hackborn | 908aecc | 2012-07-31 16:37:34 -0700 | [diff] [blame] | 609 | * can itself handle density changes. Set from the |
| 610 | * {@link android.R.attr#configChanges} attribute. |
| 611 | */ |
| 612 | public static final int CONFIG_DENSITY = 0x1000; |
| 613 | /** |
| 614 | * Bit in {@link #configChanges} that indicates that the activity |
Fabrice Di Meglio | 5f79799 | 2012-06-15 20:16:41 -0700 | [diff] [blame] | 615 | * can itself handle the change to layout direction. Set from the |
| 616 | * {@link android.R.attr#configChanges} attribute. |
| 617 | */ |
| 618 | public static final int CONFIG_LAYOUT_DIRECTION = 0x2000; |
| 619 | /** |
| 620 | * Bit in {@link #configChanges} that indicates that the activity |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 621 | * can itself handle changes to the font scaling factor. Set from the |
| 622 | * {@link android.R.attr#configChanges} attribute. This is |
Fabrice Di Meglio | dc25d25 | 2013-04-09 18:04:29 -0700 | [diff] [blame] | 623 | * not a core resource configuration, but a higher-level value, so its |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 624 | * constant starts at the high bits. |
| 625 | */ |
| 626 | public static final int CONFIG_FONT_SCALE = 0x40000000; |
Filip Gruszczynski | d2f1d94 | 2015-10-14 15:10:12 -0700 | [diff] [blame] | 627 | |
Dianne Hackborn | ebff8f9 | 2011-05-12 18:07:47 -0700 | [diff] [blame] | 628 | /** @hide |
| 629 | * Unfortunately the constants for config changes in native code are |
| 630 | * different from ActivityInfo. :( Here are the values we should use for the |
| 631 | * native side given the bit we have assigned in ActivityInfo. |
| 632 | */ |
| 633 | public static int[] CONFIG_NATIVE_BITS = new int[] { |
Dianne Hackborn | 1d0b177 | 2013-09-06 14:02:54 -0700 | [diff] [blame] | 634 | Configuration.NATIVE_CONFIG_MNC, // MNC |
| 635 | Configuration.NATIVE_CONFIG_MCC, // MCC |
| 636 | Configuration.NATIVE_CONFIG_LOCALE, // LOCALE |
| 637 | Configuration.NATIVE_CONFIG_TOUCHSCREEN, // TOUCH SCREEN |
| 638 | Configuration.NATIVE_CONFIG_KEYBOARD, // KEYBOARD |
| 639 | Configuration.NATIVE_CONFIG_KEYBOARD_HIDDEN, // KEYBOARD HIDDEN |
| 640 | Configuration.NATIVE_CONFIG_NAVIGATION, // NAVIGATION |
| 641 | Configuration.NATIVE_CONFIG_ORIENTATION, // ORIENTATION |
| 642 | Configuration.NATIVE_CONFIG_SCREEN_LAYOUT, // SCREEN LAYOUT |
| 643 | Configuration.NATIVE_CONFIG_UI_MODE, // UI MODE |
| 644 | Configuration.NATIVE_CONFIG_SCREEN_SIZE, // SCREEN SIZE |
| 645 | Configuration.NATIVE_CONFIG_SMALLEST_SCREEN_SIZE, // SMALLEST SCREEN SIZE |
| 646 | Configuration.NATIVE_CONFIG_DENSITY, // DENSITY |
| 647 | Configuration.NATIVE_CONFIG_LAYOUTDIR, // LAYOUT DIRECTION |
Dianne Hackborn | ebff8f9 | 2011-05-12 18:07:47 -0700 | [diff] [blame] | 648 | }; |
Alan Viverette | c1d5279 | 2015-05-05 09:49:03 -0700 | [diff] [blame] | 649 | |
| 650 | /** |
Dianne Hackborn | ebff8f9 | 2011-05-12 18:07:47 -0700 | [diff] [blame] | 651 | * Convert Java change bits to native. |
Alan Viverette | c1d5279 | 2015-05-05 09:49:03 -0700 | [diff] [blame] | 652 | * |
| 653 | * @hide |
Dianne Hackborn | ebff8f9 | 2011-05-12 18:07:47 -0700 | [diff] [blame] | 654 | */ |
Alan Viverette | ac85f90 | 2016-03-11 15:15:51 -0500 | [diff] [blame] | 655 | public static @NativeConfig int activityInfoConfigJavaToNative(@Config int input) { |
Dianne Hackborn | ebff8f9 | 2011-05-12 18:07:47 -0700 | [diff] [blame] | 656 | int output = 0; |
Alan Viverette | c1d5279 | 2015-05-05 09:49:03 -0700 | [diff] [blame] | 657 | for (int i = 0; i < CONFIG_NATIVE_BITS.length; i++) { |
| 658 | if ((input & (1 << i)) != 0) { |
Dianne Hackborn | ebff8f9 | 2011-05-12 18:07:47 -0700 | [diff] [blame] | 659 | output |= CONFIG_NATIVE_BITS[i]; |
| 660 | } |
| 661 | } |
| 662 | return output; |
| 663 | } |
| 664 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 665 | /** |
Alan Viverette | c1d5279 | 2015-05-05 09:49:03 -0700 | [diff] [blame] | 666 | * Convert native change bits to Java. |
| 667 | * |
| 668 | * @hide |
| 669 | */ |
Alan Viverette | ac85f90 | 2016-03-11 15:15:51 -0500 | [diff] [blame] | 670 | public static @Config int activityInfoConfigNativeToJava(@NativeConfig int input) { |
Alan Viverette | c1d5279 | 2015-05-05 09:49:03 -0700 | [diff] [blame] | 671 | int output = 0; |
| 672 | for (int i = 0; i < CONFIG_NATIVE_BITS.length; i++) { |
| 673 | if ((input & CONFIG_NATIVE_BITS[i]) != 0) { |
| 674 | output |= (1 << i); |
| 675 | } |
| 676 | } |
| 677 | return output; |
| 678 | } |
| 679 | |
| 680 | /** |
Dianne Hackborn | e667635 | 2011-06-01 16:51:20 -0700 | [diff] [blame] | 681 | * @hide |
| 682 | * Unfortunately some developers (OpenFeint I am looking at you) have |
| 683 | * compared the configChanges bit field against absolute values, so if we |
| 684 | * introduce a new bit they break. To deal with that, we will make sure |
| 685 | * the public field will not have a value that breaks them, and let the |
| 686 | * framework call here to get the real value. |
| 687 | */ |
| 688 | public int getRealConfigChanged() { |
| 689 | return applicationInfo.targetSdkVersion < android.os.Build.VERSION_CODES.HONEYCOMB_MR2 |
| 690 | ? (configChanges | ActivityInfo.CONFIG_SCREEN_SIZE |
| 691 | | ActivityInfo.CONFIG_SMALLEST_SCREEN_SIZE) |
| 692 | : configChanges; |
| 693 | } |
| 694 | |
| 695 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 696 | * Bit mask of kinds of configuration changes that this activity |
| 697 | * can handle itself (without being restarted by the system). |
| 698 | * Contains any combination of {@link #CONFIG_FONT_SCALE}, |
| 699 | * {@link #CONFIG_MCC}, {@link #CONFIG_MNC}, |
| 700 | * {@link #CONFIG_LOCALE}, {@link #CONFIG_TOUCHSCREEN}, |
Dianne Hackborn | 723738c | 2009-06-25 19:48:04 -0700 | [diff] [blame] | 701 | * {@link #CONFIG_KEYBOARD}, {@link #CONFIG_NAVIGATION}, |
Alan Viverette | 28c4a0b | 2015-11-20 17:23:46 -0500 | [diff] [blame] | 702 | * {@link #CONFIG_ORIENTATION}, {@link #CONFIG_SCREEN_LAYOUT}, |
| 703 | * {@link #CONFIG_DENSITY}, and {@link #CONFIG_LAYOUT_DIRECTION}. |
| 704 | * Set from the {@link android.R.attr#configChanges} attribute. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 705 | */ |
| 706 | public int configChanges; |
Craig Mautner | 15df08a | 2015-04-01 12:17:18 -0700 | [diff] [blame] | 707 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 708 | /** |
| 709 | * The desired soft input mode for this activity's main window. |
| 710 | * Set from the {@link android.R.attr#windowSoftInputMode} attribute |
| 711 | * in the activity's manifest. May be any of the same values allowed |
| 712 | * for {@link android.view.WindowManager.LayoutParams#softInputMode |
| 713 | * WindowManager.LayoutParams.softInputMode}. If 0 (unspecified), |
| 714 | * the mode from the theme will be used. |
| 715 | */ |
| 716 | public int softInputMode; |
Adam Powell | 269248d | 2011-08-02 10:26:54 -0700 | [diff] [blame] | 717 | |
| 718 | /** |
| 719 | * The desired extra UI options for this activity and its main window. |
| 720 | * Set from the {@link android.R.attr#uiOptions} attribute in the |
| 721 | * activity's manifest. |
| 722 | */ |
| 723 | public int uiOptions = 0; |
| 724 | |
| 725 | /** |
Scott Main | e797ed6 | 2011-09-22 16:17:45 -0700 | [diff] [blame] | 726 | * Flag for use with {@link #uiOptions}. |
| 727 | * Indicates that the action bar should put all action items in a separate bar when |
| 728 | * the screen is narrow. |
| 729 | * <p>This value corresponds to "splitActionBarWhenNarrow" for the {@link #uiOptions} XML |
| 730 | * attribute. |
Adam Powell | 269248d | 2011-08-02 10:26:54 -0700 | [diff] [blame] | 731 | */ |
| 732 | public static final int UIOPTION_SPLIT_ACTION_BAR_WHEN_NARROW = 1; |
| 733 | |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 734 | /** |
| 735 | * If defined, the activity named here is the logical parent of this activity. |
| 736 | */ |
| 737 | public String parentActivityName; |
| 738 | |
Craig Mautner | 15df08a | 2015-04-01 12:17:18 -0700 | [diff] [blame] | 739 | /** @hide */ |
| 740 | public static final int LOCK_TASK_LAUNCH_MODE_DEFAULT = 0; |
| 741 | /** @hide */ |
| 742 | public static final int LOCK_TASK_LAUNCH_MODE_NEVER = 1; |
| 743 | /** @hide */ |
| 744 | public static final int LOCK_TASK_LAUNCH_MODE_ALWAYS = 2; |
| 745 | /** @hide */ |
| 746 | public static final int LOCK_TASK_LAUNCH_MODE_IF_WHITELISTED = 3; |
| 747 | |
| 748 | /** @hide */ |
| 749 | public static final String lockTaskLaunchModeToString(int lockTaskLaunchMode) { |
| 750 | switch (lockTaskLaunchMode) { |
| 751 | case LOCK_TASK_LAUNCH_MODE_DEFAULT: |
| 752 | return "LOCK_TASK_LAUNCH_MODE_DEFAULT"; |
| 753 | case LOCK_TASK_LAUNCH_MODE_NEVER: |
| 754 | return "LOCK_TASK_LAUNCH_MODE_NEVER"; |
| 755 | case LOCK_TASK_LAUNCH_MODE_ALWAYS: |
| 756 | return "LOCK_TASK_LAUNCH_MODE_ALWAYS"; |
| 757 | case LOCK_TASK_LAUNCH_MODE_IF_WHITELISTED: |
| 758 | return "LOCK_TASK_LAUNCH_MODE_IF_WHITELISTED"; |
| 759 | default: |
| 760 | return "unknown=" + lockTaskLaunchMode; |
| 761 | } |
| 762 | } |
| 763 | /** |
| 764 | * Value indicating if the activity is to be locked at startup. Takes on the values from |
| 765 | * {@link android.R.attr#lockTaskMode}. |
| 766 | * @hide |
| 767 | */ |
| 768 | public int lockTaskLaunchMode; |
| 769 | |
Filip Gruszczynski | d2f1d94 | 2015-10-14 15:10:12 -0700 | [diff] [blame] | 770 | public Layout layout; |
Filip Gruszczynski | 848fe6b | 2015-08-19 13:32:41 -0700 | [diff] [blame] | 771 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 772 | public ActivityInfo() { |
| 773 | } |
| 774 | |
| 775 | public ActivityInfo(ActivityInfo orig) { |
| 776 | super(orig); |
| 777 | theme = orig.theme; |
| 778 | launchMode = orig.launchMode; |
Robert Carr | 3e2e011 | 2015-09-15 12:30:42 -0700 | [diff] [blame] | 779 | documentLaunchMode = orig.documentLaunchMode; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 780 | permission = orig.permission; |
| 781 | taskAffinity = orig.taskAffinity; |
| 782 | targetActivity = orig.targetActivity; |
| 783 | flags = orig.flags; |
| 784 | screenOrientation = orig.screenOrientation; |
| 785 | configChanges = orig.configChanges; |
| 786 | softInputMode = orig.softInputMode; |
Adam Powell | 269248d | 2011-08-02 10:26:54 -0700 | [diff] [blame] | 787 | uiOptions = orig.uiOptions; |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 788 | parentActivityName = orig.parentActivityName; |
Craig Mautner | 8307ea7 | 2014-09-11 15:03:53 -0700 | [diff] [blame] | 789 | maxRecents = orig.maxRecents; |
Craig Mautner | 15df08a | 2015-04-01 12:17:18 -0700 | [diff] [blame] | 790 | lockTaskLaunchMode = orig.lockTaskLaunchMode; |
Filip Gruszczynski | d2f1d94 | 2015-10-14 15:10:12 -0700 | [diff] [blame] | 791 | layout = orig.layout; |
Wale Ogunwale | d26176f | 2016-01-25 20:04:04 -0800 | [diff] [blame] | 792 | resizeMode = orig.resizeMode; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 793 | } |
Craig Mautner | 15df08a | 2015-04-01 12:17:18 -0700 | [diff] [blame] | 794 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 795 | /** |
| 796 | * Return the theme resource identifier to use for this activity. If |
| 797 | * the activity defines a theme, that is used; else, the application |
| 798 | * theme is used. |
Craig Mautner | 15df08a | 2015-04-01 12:17:18 -0700 | [diff] [blame] | 799 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 800 | * @return The theme associated with this activity. |
| 801 | */ |
| 802 | public final int getThemeResource() { |
| 803 | return theme != 0 ? theme : applicationInfo.theme; |
| 804 | } |
| 805 | |
Craig Mautner | 43e52ed | 2014-06-16 17:18:52 -0700 | [diff] [blame] | 806 | private String persistableModeToString() { |
| 807 | switch(persistableMode) { |
| 808 | case PERSIST_ROOT_ONLY: return "PERSIST_ROOT_ONLY"; |
Craig Mautner | 7f72f53 | 2014-07-21 10:07:12 -0700 | [diff] [blame] | 809 | case PERSIST_NEVER: return "PERSIST_NEVER"; |
Craig Mautner | 43e52ed | 2014-06-16 17:18:52 -0700 | [diff] [blame] | 810 | case PERSIST_ACROSS_REBOOTS: return "PERSIST_ACROSS_REBOOTS"; |
| 811 | default: return "UNKNOWN=" + persistableMode; |
| 812 | } |
| 813 | } |
| 814 | |
Wale Ogunwale | 508ff55 | 2016-02-15 19:31:50 -0800 | [diff] [blame] | 815 | /** |
| 816 | * Returns true if the activity's orientation is fixed. |
| 817 | * @hide |
| 818 | */ |
| 819 | boolean isFixedOrientation() { |
| 820 | return screenOrientation == SCREEN_ORIENTATION_LANDSCAPE |
| 821 | || screenOrientation == SCREEN_ORIENTATION_PORTRAIT |
| 822 | || screenOrientation == SCREEN_ORIENTATION_SENSOR_LANDSCAPE |
| 823 | || screenOrientation == SCREEN_ORIENTATION_SENSOR_PORTRAIT |
| 824 | || screenOrientation == SCREEN_ORIENTATION_REVERSE_LANDSCAPE |
| 825 | || screenOrientation == SCREEN_ORIENTATION_REVERSE_PORTRAIT |
| 826 | || screenOrientation == SCREEN_ORIENTATION_USER_LANDSCAPE |
| 827 | || screenOrientation == SCREEN_ORIENTATION_USER_PORTRAIT |
| 828 | || screenOrientation == SCREEN_ORIENTATION_LOCKED; |
| 829 | } |
| 830 | |
Wale Ogunwale | d26176f | 2016-01-25 20:04:04 -0800 | [diff] [blame] | 831 | /** @hide */ |
Wale Ogunwale | b1faf60 | 2016-01-27 09:12:31 -0800 | [diff] [blame] | 832 | public static boolean isResizeableMode(int mode) { |
Wale Ogunwale | d829d36 | 2016-02-10 19:24:49 -0800 | [diff] [blame] | 833 | return mode == RESIZE_MODE_RESIZEABLE |
| 834 | || mode == RESIZE_MODE_RESIZEABLE_AND_PIPABLE |
| 835 | || mode == RESIZE_MODE_FORCE_RESIZEABLE; |
Wale Ogunwale | b1faf60 | 2016-01-27 09:12:31 -0800 | [diff] [blame] | 836 | } |
| 837 | |
| 838 | /** @hide */ |
| 839 | public static String resizeModeToString(int mode) { |
Wale Ogunwale | d26176f | 2016-01-25 20:04:04 -0800 | [diff] [blame] | 840 | switch (mode) { |
| 841 | case RESIZE_MODE_UNRESIZEABLE: |
| 842 | return "RESIZE_MODE_UNRESIZEABLE"; |
| 843 | case RESIZE_MODE_CROP_WINDOWS: |
| 844 | return "RESIZE_MODE_CROP_WINDOWS"; |
| 845 | case RESIZE_MODE_RESIZEABLE: |
| 846 | return "RESIZE_MODE_RESIZEABLE"; |
| 847 | case RESIZE_MODE_RESIZEABLE_AND_PIPABLE: |
| 848 | return "RESIZE_MODE_RESIZEABLE_AND_PIPABLE"; |
Wale Ogunwale | d829d36 | 2016-02-10 19:24:49 -0800 | [diff] [blame] | 849 | case RESIZE_MODE_FORCE_RESIZEABLE: |
| 850 | return "RESIZE_MODE_FORCE_RESIZEABLE"; |
Wale Ogunwale | d26176f | 2016-01-25 20:04:04 -0800 | [diff] [blame] | 851 | default: |
| 852 | return "unknown=" + mode; |
| 853 | } |
| 854 | } |
| 855 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 856 | public void dump(Printer pw, String prefix) { |
Dianne Hackborn | 6ac42ae | 2015-12-08 17:22:10 -0800 | [diff] [blame] | 857 | dump(pw, prefix, DUMP_FLAG_ALL); |
| 858 | } |
| 859 | |
| 860 | /** @hide */ |
| 861 | public void dump(Printer pw, String prefix, int flags) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 862 | super.dumpFront(pw, prefix); |
Dianne Hackborn | 12527f9 | 2009-11-11 17:39:50 -0800 | [diff] [blame] | 863 | if (permission != null) { |
| 864 | pw.println(prefix + "permission=" + permission); |
| 865 | } |
Dianne Hackborn | 6ac42ae | 2015-12-08 17:22:10 -0800 | [diff] [blame] | 866 | if ((flags&DUMP_FLAG_DETAILS) != 0) { |
| 867 | pw.println(prefix + "taskAffinity=" + taskAffinity |
| 868 | + " targetActivity=" + targetActivity |
| 869 | + " persistableMode=" + persistableModeToString()); |
| 870 | } |
Dianne Hackborn | 12527f9 | 2009-11-11 17:39:50 -0800 | [diff] [blame] | 871 | if (launchMode != 0 || flags != 0 || theme != 0) { |
| 872 | pw.println(prefix + "launchMode=" + launchMode |
| 873 | + " flags=0x" + Integer.toHexString(flags) |
| 874 | + " theme=0x" + Integer.toHexString(theme)); |
| 875 | } |
| 876 | if (screenOrientation != SCREEN_ORIENTATION_UNSPECIFIED |
| 877 | || configChanges != 0 || softInputMode != 0) { |
| 878 | pw.println(prefix + "screenOrientation=" + screenOrientation |
| 879 | + " configChanges=0x" + Integer.toHexString(configChanges) |
| 880 | + " softInputMode=0x" + Integer.toHexString(softInputMode)); |
| 881 | } |
Adam Powell | 269248d | 2011-08-02 10:26:54 -0700 | [diff] [blame] | 882 | if (uiOptions != 0) { |
| 883 | pw.println(prefix + " uiOptions=0x" + Integer.toHexString(uiOptions)); |
| 884 | } |
Dianne Hackborn | 6ac42ae | 2015-12-08 17:22:10 -0800 | [diff] [blame] | 885 | if ((flags&DUMP_FLAG_DETAILS) != 0) { |
Dianne Hackborn | 6ac42ae | 2015-12-08 17:22:10 -0800 | [diff] [blame] | 886 | pw.println(prefix + "lockTaskLaunchMode=" |
| 887 | + lockTaskLaunchModeToString(lockTaskLaunchMode)); |
| 888 | } |
Filip Gruszczynski | d2f1d94 | 2015-10-14 15:10:12 -0700 | [diff] [blame] | 889 | if (layout != null) { |
Wale Ogunwale | b12e109 | 2016-01-30 12:23:09 -0800 | [diff] [blame] | 890 | pw.println(prefix + "defaultLayout=" + layout.width + "|" |
Filip Gruszczynski | d2f1d94 | 2015-10-14 15:10:12 -0700 | [diff] [blame] | 891 | + layout.widthFraction + ", " + layout.height + "|" |
| 892 | + layout.heightFraction + ", " + layout.gravity); |
Filip Gruszczynski | 848fe6b | 2015-08-19 13:32:41 -0700 | [diff] [blame] | 893 | } |
Wale Ogunwale | d26176f | 2016-01-25 20:04:04 -0800 | [diff] [blame] | 894 | pw.println(prefix + "resizeMode=" + resizeModeToString(resizeMode)); |
Dianne Hackborn | 6ac42ae | 2015-12-08 17:22:10 -0800 | [diff] [blame] | 895 | super.dumpBack(pw, prefix, flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 896 | } |
Filip Gruszczynski | 848fe6b | 2015-08-19 13:32:41 -0700 | [diff] [blame] | 897 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 898 | public String toString() { |
| 899 | return "ActivityInfo{" |
| 900 | + Integer.toHexString(System.identityHashCode(this)) |
| 901 | + " " + name + "}"; |
| 902 | } |
| 903 | |
| 904 | public int describeContents() { |
| 905 | return 0; |
| 906 | } |
| 907 | |
| 908 | public void writeToParcel(Parcel dest, int parcelableFlags) { |
| 909 | super.writeToParcel(dest, parcelableFlags); |
| 910 | dest.writeInt(theme); |
| 911 | dest.writeInt(launchMode); |
Robert Carr | 3e2e011 | 2015-09-15 12:30:42 -0700 | [diff] [blame] | 912 | dest.writeInt(documentLaunchMode); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 913 | dest.writeString(permission); |
| 914 | dest.writeString(taskAffinity); |
| 915 | dest.writeString(targetActivity); |
| 916 | dest.writeInt(flags); |
| 917 | dest.writeInt(screenOrientation); |
| 918 | dest.writeInt(configChanges); |
| 919 | dest.writeInt(softInputMode); |
Adam Powell | 269248d | 2011-08-02 10:26:54 -0700 | [diff] [blame] | 920 | dest.writeInt(uiOptions); |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 921 | dest.writeString(parentActivityName); |
Craig Mautner | 43e52ed | 2014-06-16 17:18:52 -0700 | [diff] [blame] | 922 | dest.writeInt(persistableMode); |
Craig Mautner | 8307ea7 | 2014-09-11 15:03:53 -0700 | [diff] [blame] | 923 | dest.writeInt(maxRecents); |
Craig Mautner | 15df08a | 2015-04-01 12:17:18 -0700 | [diff] [blame] | 924 | dest.writeInt(lockTaskLaunchMode); |
Filip Gruszczynski | d2f1d94 | 2015-10-14 15:10:12 -0700 | [diff] [blame] | 925 | if (layout != null) { |
Filip Gruszczynski | 848fe6b | 2015-08-19 13:32:41 -0700 | [diff] [blame] | 926 | dest.writeInt(1); |
Filip Gruszczynski | d2f1d94 | 2015-10-14 15:10:12 -0700 | [diff] [blame] | 927 | dest.writeInt(layout.width); |
| 928 | dest.writeFloat(layout.widthFraction); |
| 929 | dest.writeInt(layout.height); |
| 930 | dest.writeFloat(layout.heightFraction); |
| 931 | dest.writeInt(layout.gravity); |
| 932 | dest.writeInt(layout.minimalSize); |
Filip Gruszczynski | 848fe6b | 2015-08-19 13:32:41 -0700 | [diff] [blame] | 933 | } else { |
| 934 | dest.writeInt(0); |
| 935 | } |
Wale Ogunwale | d26176f | 2016-01-25 20:04:04 -0800 | [diff] [blame] | 936 | dest.writeInt(resizeMode); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 937 | } |
| 938 | |
| 939 | public static final Parcelable.Creator<ActivityInfo> CREATOR |
| 940 | = new Parcelable.Creator<ActivityInfo>() { |
| 941 | public ActivityInfo createFromParcel(Parcel source) { |
| 942 | return new ActivityInfo(source); |
| 943 | } |
| 944 | public ActivityInfo[] newArray(int size) { |
| 945 | return new ActivityInfo[size]; |
| 946 | } |
| 947 | }; |
| 948 | |
| 949 | private ActivityInfo(Parcel source) { |
| 950 | super(source); |
| 951 | theme = source.readInt(); |
| 952 | launchMode = source.readInt(); |
Robert Carr | 3e2e011 | 2015-09-15 12:30:42 -0700 | [diff] [blame] | 953 | documentLaunchMode = source.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 954 | permission = source.readString(); |
| 955 | taskAffinity = source.readString(); |
| 956 | targetActivity = source.readString(); |
| 957 | flags = source.readInt(); |
| 958 | screenOrientation = source.readInt(); |
| 959 | configChanges = source.readInt(); |
| 960 | softInputMode = source.readInt(); |
Adam Powell | 269248d | 2011-08-02 10:26:54 -0700 | [diff] [blame] | 961 | uiOptions = source.readInt(); |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 962 | parentActivityName = source.readString(); |
Craig Mautner | 43e52ed | 2014-06-16 17:18:52 -0700 | [diff] [blame] | 963 | persistableMode = source.readInt(); |
Craig Mautner | 8307ea7 | 2014-09-11 15:03:53 -0700 | [diff] [blame] | 964 | maxRecents = source.readInt(); |
Craig Mautner | 15df08a | 2015-04-01 12:17:18 -0700 | [diff] [blame] | 965 | lockTaskLaunchMode = source.readInt(); |
Filip Gruszczynski | 848fe6b | 2015-08-19 13:32:41 -0700 | [diff] [blame] | 966 | if (source.readInt() == 1) { |
Filip Gruszczynski | d2f1d94 | 2015-10-14 15:10:12 -0700 | [diff] [blame] | 967 | layout = new Layout(source); |
Filip Gruszczynski | 848fe6b | 2015-08-19 13:32:41 -0700 | [diff] [blame] | 968 | } |
Wale Ogunwale | d26176f | 2016-01-25 20:04:04 -0800 | [diff] [blame] | 969 | resizeMode = source.readInt(); |
Filip Gruszczynski | 848fe6b | 2015-08-19 13:32:41 -0700 | [diff] [blame] | 970 | } |
| 971 | |
Filip Gruszczynski | d2f1d94 | 2015-10-14 15:10:12 -0700 | [diff] [blame] | 972 | public static final class Layout { |
| 973 | public Layout(int width, float widthFraction, int height, float heightFraction, int gravity, |
| 974 | int minimalSize) { |
Filip Gruszczynski | 848fe6b | 2015-08-19 13:32:41 -0700 | [diff] [blame] | 975 | this.width = width; |
| 976 | this.widthFraction = widthFraction; |
| 977 | this.height = height; |
| 978 | this.heightFraction = heightFraction; |
| 979 | this.gravity = gravity; |
Filip Gruszczynski | d2f1d94 | 2015-10-14 15:10:12 -0700 | [diff] [blame] | 980 | this.minimalSize = minimalSize; |
Filip Gruszczynski | 848fe6b | 2015-08-19 13:32:41 -0700 | [diff] [blame] | 981 | } |
| 982 | |
Filip Gruszczynski | d2f1d94 | 2015-10-14 15:10:12 -0700 | [diff] [blame] | 983 | Layout(Parcel source) { |
Filip Gruszczynski | 848fe6b | 2015-08-19 13:32:41 -0700 | [diff] [blame] | 984 | width = source.readInt(); |
| 985 | widthFraction = source.readFloat(); |
| 986 | height = source.readInt(); |
| 987 | heightFraction = source.readFloat(); |
| 988 | gravity = source.readInt(); |
Filip Gruszczynski | d2f1d94 | 2015-10-14 15:10:12 -0700 | [diff] [blame] | 989 | minimalSize = source.readInt(); |
Filip Gruszczynski | 848fe6b | 2015-08-19 13:32:41 -0700 | [diff] [blame] | 990 | } |
| 991 | |
| 992 | public final int width; |
| 993 | public final float widthFraction; |
| 994 | public final int height; |
| 995 | public final float heightFraction; |
| 996 | public final int gravity; |
Filip Gruszczynski | d2f1d94 | 2015-10-14 15:10:12 -0700 | [diff] [blame] | 997 | public final int minimalSize; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 998 | } |
| 999 | } |