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 | |
| 19 | import android.os.Parcel; |
| 20 | import android.os.Parcelable; |
| 21 | import android.util.Printer; |
| 22 | |
| 23 | /** |
| 24 | * Information you can retrieve about a particular application |
| 25 | * activity or receiver. This corresponds to information collected |
| 26 | * from the AndroidManifest.xml's <activity> and |
| 27 | * <receiver> tags. |
| 28 | */ |
| 29 | public class ActivityInfo extends ComponentInfo |
| 30 | implements Parcelable { |
| 31 | /** |
| 32 | * A style resource identifier (in the package's resources) of this |
| 33 | * activity's theme. From the "theme" attribute or, if not set, 0. |
| 34 | */ |
| 35 | public int theme; |
| 36 | |
| 37 | /** |
| 38 | * Constant corresponding to <code>standard</code> in |
| 39 | * the {@link android.R.attr#launchMode} attribute. |
| 40 | */ |
| 41 | public static final int LAUNCH_MULTIPLE = 0; |
| 42 | /** |
| 43 | * Constant corresponding to <code>singleTop</code> in |
| 44 | * the {@link android.R.attr#launchMode} attribute. |
| 45 | */ |
| 46 | public static final int LAUNCH_SINGLE_TOP = 1; |
| 47 | /** |
| 48 | * Constant corresponding to <code>singleTask</code> in |
| 49 | * the {@link android.R.attr#launchMode} attribute. |
| 50 | */ |
| 51 | public static final int LAUNCH_SINGLE_TASK = 2; |
| 52 | /** |
| 53 | * Constant corresponding to <code>singleInstance</code> in |
| 54 | * the {@link android.R.attr#launchMode} attribute. |
| 55 | */ |
| 56 | public static final int LAUNCH_SINGLE_INSTANCE = 3; |
| 57 | /** |
| 58 | * The launch mode style requested by the activity. From the |
| 59 | * {@link android.R.attr#launchMode} attribute, one of |
| 60 | * {@link #LAUNCH_MULTIPLE}, |
| 61 | * {@link #LAUNCH_SINGLE_TOP}, {@link #LAUNCH_SINGLE_TASK}, or |
| 62 | * {@link #LAUNCH_SINGLE_INSTANCE}. |
| 63 | */ |
| 64 | public int launchMode; |
| 65 | |
| 66 | /** |
| 67 | * Optional name of a permission required to be able to access this |
| 68 | * Activity. From the "permission" attribute. |
| 69 | */ |
| 70 | public String permission; |
| 71 | |
| 72 | /** |
| 73 | * The affinity this activity has for another task in the system. The |
| 74 | * string here is the name of the task, often the package name of the |
| 75 | * overall package. If null, the activity has no affinity. Set from the |
| 76 | * {@link android.R.attr#taskAffinity} attribute. |
| 77 | */ |
| 78 | public String taskAffinity; |
| 79 | |
| 80 | /** |
| 81 | * If this is an activity alias, this is the real activity class to run |
| 82 | * for it. Otherwise, this is null. |
| 83 | */ |
| 84 | public String targetActivity; |
| 85 | |
| 86 | /** |
| 87 | * Bit in {@link #flags} indicating whether this activity is able to |
| 88 | * run in multiple processes. If |
| 89 | * true, the system may instantiate it in the some process as the |
| 90 | * process starting it in order to conserve resources. If false, the |
| 91 | * default, it always runs in {@link #processName}. Set from the |
| 92 | * {@link android.R.attr#multiprocess} attribute. |
| 93 | */ |
| 94 | public static final int FLAG_MULTIPROCESS = 0x0001; |
| 95 | /** |
| 96 | * Bit in {@link #flags} indicating that, when the activity's task is |
| 97 | * relaunched from home, this activity should be finished. |
| 98 | * Set from the |
| 99 | * {@link android.R.attr#finishOnTaskLaunch} attribute. |
| 100 | */ |
| 101 | public static final int FLAG_FINISH_ON_TASK_LAUNCH = 0x0002; |
| 102 | /** |
| 103 | * Bit in {@link #flags} indicating that, when the activity is the root |
| 104 | * of a task, that task's stack should be cleared each time the user |
| 105 | * re-launches it from home. As a result, the user will always |
| 106 | * return to the original activity at the top of the task. |
| 107 | * This flag only applies to activities that |
| 108 | * are used to start the root of a new task. Set from the |
| 109 | * {@link android.R.attr#clearTaskOnLaunch} attribute. |
| 110 | */ |
| 111 | public static final int FLAG_CLEAR_TASK_ON_LAUNCH = 0x0004; |
| 112 | /** |
| 113 | * Bit in {@link #flags} indicating that, when the activity is the root |
| 114 | * of a task, that task's stack should never be cleared when it is |
| 115 | * relaunched from home. Set from the |
| 116 | * {@link android.R.attr#alwaysRetainTaskState} attribute. |
| 117 | */ |
| 118 | public static final int FLAG_ALWAYS_RETAIN_TASK_STATE = 0x0008; |
| 119 | /** |
| 120 | * Bit in {@link #flags} indicating that the activity's state |
| 121 | * is not required to be saved, so that if there is a failure the |
| 122 | * activity will not be removed from the activity stack. Set from the |
| 123 | * {@link android.R.attr#stateNotNeeded} attribute. |
| 124 | */ |
| 125 | public static final int FLAG_STATE_NOT_NEEDED = 0x0010; |
| 126 | /** |
| 127 | * Bit in {@link #flags} that indicates that the activity should not |
| 128 | * appear in the list of recently launched activities. Set from the |
| 129 | * {@link android.R.attr#excludeFromRecents} attribute. |
| 130 | */ |
| 131 | public static final int FLAG_EXCLUDE_FROM_RECENTS = 0x0020; |
| 132 | /** |
| 133 | * Bit in {@link #flags} that indicates that the activity can be moved |
| 134 | * between tasks based on its task affinity. Set from the |
| 135 | * {@link android.R.attr#allowTaskReparenting} attribute. |
| 136 | */ |
| 137 | public static final int FLAG_ALLOW_TASK_REPARENTING = 0x0040; |
| 138 | /** |
| 139 | * Bit in {@link #flags} indicating that, when the user navigates away |
| 140 | * from an activity, it should be finished. |
| 141 | * Set from the |
| 142 | * {@link android.R.attr#noHistory} attribute. |
| 143 | */ |
| 144 | public static final int FLAG_NO_HISTORY = 0x0080; |
| 145 | /** |
Dianne Hackborn | ffa4248 | 2009-09-23 22:20:11 -0700 | [diff] [blame] | 146 | * Bit in {@link #flags} indicating that, when a request to close system |
| 147 | * windows happens, this activity is finished. |
| 148 | * Set from the |
| 149 | * {@link android.R.attr#finishOnCloseSystemDialogs} attribute. |
| 150 | */ |
| 151 | public static final int FLAG_FINISH_ON_CLOSE_SYSTEM_DIALOGS = 0x0100; |
Dianne Hackborn | 327fbd2 | 2011-01-17 14:38:50 -0800 | [diff] [blame] | 152 | /** |
| 153 | * Value for {@link #flags}: true when the application's rendering should |
| 154 | * be hardware accelerated. |
| 155 | */ |
| 156 | public static final int FLAG_HARDWARE_ACCELERATED = 0x0200; |
| 157 | /** |
| 158 | * @hide |
Daniel Sandler | 613dde4 | 2010-06-21 13:46:39 -0400 | [diff] [blame] | 159 | * Bit in {@link #flags} corresponding to an immersive activity |
| 160 | * that wishes not to be interrupted by notifications. |
| 161 | * Applications that hide the system notification bar with |
| 162 | * {@link android.view.WindowManager.LayoutParams#FLAG_FULLSCREEN} |
| 163 | * may still be interrupted by high-priority notifications; for example, an |
| 164 | * incoming phone call may use |
Daniel Sandler | 8091ca5 | 2010-06-22 13:58:46 -0400 | [diff] [blame] | 165 | * {@link android.app.Notification#fullScreenIntent fullScreenIntent} |
Daniel Sandler | 613dde4 | 2010-06-21 13:46:39 -0400 | [diff] [blame] | 166 | * to present a full-screen in-call activity to the user, pausing the |
| 167 | * current activity as a side-effect. An activity with |
| 168 | * {@link #FLAG_IMMERSIVE} set, however, will not be interrupted; the |
| 169 | * notification may be shown in some other way (such as a small floating |
| 170 | * "toast" window). |
| 171 | * {@see android.app.Notification#FLAG_HIGH_PRIORITY} |
| 172 | */ |
Dianne Hackborn | 327fbd2 | 2011-01-17 14:38:50 -0800 | [diff] [blame] | 173 | public static final int FLAG_IMMERSIVE = 0x0400; |
Romain Guy | 529b60a | 2010-08-03 18:05:47 -0700 | [diff] [blame] | 174 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 175 | * Options that have been set in the activity declaration in the |
Daniel Sandler | 613dde4 | 2010-06-21 13:46:39 -0400 | [diff] [blame] | 176 | * manifest. |
| 177 | * These include: |
| 178 | * {@link #FLAG_MULTIPROCESS}, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 179 | * {@link #FLAG_FINISH_ON_TASK_LAUNCH}, {@link #FLAG_CLEAR_TASK_ON_LAUNCH}, |
| 180 | * {@link #FLAG_ALWAYS_RETAIN_TASK_STATE}, |
| 181 | * {@link #FLAG_STATE_NOT_NEEDED}, {@link #FLAG_EXCLUDE_FROM_RECENTS}, |
Dianne Hackborn | ffa4248 | 2009-09-23 22:20:11 -0700 | [diff] [blame] | 182 | * {@link #FLAG_ALLOW_TASK_REPARENTING}, {@link #FLAG_NO_HISTORY}, |
Daniel Sandler | 613dde4 | 2010-06-21 13:46:39 -0400 | [diff] [blame] | 183 | * {@link #FLAG_FINISH_ON_CLOSE_SYSTEM_DIALOGS}, |
Dianne Hackborn | 327fbd2 | 2011-01-17 14:38:50 -0800 | [diff] [blame] | 184 | * {@link #FLAG_HARDWARE_ACCELERATED} |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 185 | */ |
| 186 | public int flags; |
| 187 | |
| 188 | /** |
| 189 | * Constant corresponding to <code>unspecified</code> in |
| 190 | * the {@link android.R.attr#screenOrientation} attribute. |
| 191 | */ |
| 192 | public static final int SCREEN_ORIENTATION_UNSPECIFIED = -1; |
| 193 | /** |
| 194 | * Constant corresponding to <code>landscape</code> in |
| 195 | * the {@link android.R.attr#screenOrientation} attribute. |
| 196 | */ |
| 197 | public static final int SCREEN_ORIENTATION_LANDSCAPE = 0; |
| 198 | /** |
| 199 | * Constant corresponding to <code>portrait</code> in |
| 200 | * the {@link android.R.attr#screenOrientation} attribute. |
| 201 | */ |
| 202 | public static final int SCREEN_ORIENTATION_PORTRAIT = 1; |
| 203 | /** |
| 204 | * Constant corresponding to <code>user</code> in |
| 205 | * the {@link android.R.attr#screenOrientation} attribute. |
| 206 | */ |
| 207 | public static final int SCREEN_ORIENTATION_USER = 2; |
| 208 | /** |
| 209 | * Constant corresponding to <code>behind</code> in |
| 210 | * the {@link android.R.attr#screenOrientation} attribute. |
| 211 | */ |
| 212 | public static final int SCREEN_ORIENTATION_BEHIND = 3; |
| 213 | /** |
| 214 | * Constant corresponding to <code>sensor</code> in |
| 215 | * the {@link android.R.attr#screenOrientation} attribute. |
| 216 | */ |
| 217 | public static final int SCREEN_ORIENTATION_SENSOR = 4; |
| 218 | |
| 219 | /** |
Dianne Hackborn | e5439f2 | 2010-10-02 16:53:50 -0700 | [diff] [blame] | 220 | * Constant corresponding to <code>nosensor</code> in |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 221 | * the {@link android.R.attr#screenOrientation} attribute. |
| 222 | */ |
| 223 | public static final int SCREEN_ORIENTATION_NOSENSOR = 5; |
Dianne Hackborn | e5439f2 | 2010-10-02 16:53:50 -0700 | [diff] [blame] | 224 | |
| 225 | /** |
| 226 | * Constant corresponding to <code>sensorLandscape</code> in |
| 227 | * the {@link android.R.attr#screenOrientation} attribute. |
| 228 | */ |
| 229 | public static final int SCREEN_ORIENTATION_SENSOR_LANDSCAPE = 6; |
| 230 | |
| 231 | /** |
| 232 | * Constant corresponding to <code>sensorPortrait</code> in |
| 233 | * the {@link android.R.attr#screenOrientation} attribute. |
| 234 | */ |
| 235 | public static final int SCREEN_ORIENTATION_SENSOR_PORTRAIT = 7; |
| 236 | |
| 237 | /** |
| 238 | * Constant corresponding to <code>reverseLandscape</code> in |
| 239 | * the {@link android.R.attr#screenOrientation} attribute. |
| 240 | */ |
| 241 | public static final int SCREEN_ORIENTATION_REVERSE_LANDSCAPE = 8; |
| 242 | |
| 243 | /** |
| 244 | * Constant corresponding to <code>reversePortrait</code> in |
| 245 | * the {@link android.R.attr#screenOrientation} attribute. |
| 246 | */ |
| 247 | public static final int SCREEN_ORIENTATION_REVERSE_PORTRAIT = 9; |
| 248 | |
| 249 | /** |
| 250 | * Constant corresponding to <code>fullSensor</code> in |
| 251 | * the {@link android.R.attr#screenOrientation} attribute. |
| 252 | */ |
| 253 | public static final int SCREEN_ORIENTATION_FULL_SENSOR = 10; |
| 254 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 255 | /** |
| 256 | * The preferred screen orientation this activity would like to run in. |
| 257 | * From the {@link android.R.attr#screenOrientation} attribute, one of |
| 258 | * {@link #SCREEN_ORIENTATION_UNSPECIFIED}, |
| 259 | * {@link #SCREEN_ORIENTATION_LANDSCAPE}, |
| 260 | * {@link #SCREEN_ORIENTATION_PORTRAIT}, |
| 261 | * {@link #SCREEN_ORIENTATION_USER}, |
| 262 | * {@link #SCREEN_ORIENTATION_BEHIND}, |
| 263 | * {@link #SCREEN_ORIENTATION_SENSOR}, |
Dianne Hackborn | e5439f2 | 2010-10-02 16:53:50 -0700 | [diff] [blame] | 264 | * {@link #SCREEN_ORIENTATION_NOSENSOR}, |
| 265 | * {@link #SCREEN_ORIENTATION_SENSOR_LANDSCAPE}, |
| 266 | * {@link #SCREEN_ORIENTATION_SENSOR_PORTRAIT}, |
| 267 | * {@link #SCREEN_ORIENTATION_REVERSE_LANDSCAPE}, |
| 268 | * {@link #SCREEN_ORIENTATION_REVERSE_PORTRAIT}, |
| 269 | * {@link #SCREEN_ORIENTATION_FULL_SENSOR}. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 270 | */ |
| 271 | public int screenOrientation = SCREEN_ORIENTATION_UNSPECIFIED; |
| 272 | |
| 273 | /** |
| 274 | * Bit in {@link #configChanges} that indicates that the activity |
| 275 | * can itself handle changes to the IMSI MCC. Set from the |
| 276 | * {@link android.R.attr#configChanges} attribute. |
| 277 | */ |
| 278 | public static final int CONFIG_MCC = 0x0001; |
| 279 | /** |
| 280 | * Bit in {@link #configChanges} that indicates that the activity |
| 281 | * can itself handle changes to the IMSI MNC. Set from the |
| 282 | * {@link android.R.attr#configChanges} attribute. |
| 283 | */ |
| 284 | public static final int CONFIG_MNC = 0x0002; |
| 285 | /** |
| 286 | * Bit in {@link #configChanges} that indicates that the activity |
| 287 | * can itself handle changes to the locale. Set from the |
| 288 | * {@link android.R.attr#configChanges} attribute. |
| 289 | */ |
| 290 | public static final int CONFIG_LOCALE = 0x0004; |
| 291 | /** |
| 292 | * Bit in {@link #configChanges} that indicates that the activity |
| 293 | * can itself handle changes to the touchscreen type. Set from the |
| 294 | * {@link android.R.attr#configChanges} attribute. |
| 295 | */ |
| 296 | public static final int CONFIG_TOUCHSCREEN = 0x0008; |
| 297 | /** |
| 298 | * Bit in {@link #configChanges} that indicates that the activity |
| 299 | * can itself handle changes to the keyboard type. Set from the |
| 300 | * {@link android.R.attr#configChanges} attribute. |
| 301 | */ |
| 302 | public static final int CONFIG_KEYBOARD = 0x0010; |
| 303 | /** |
| 304 | * Bit in {@link #configChanges} that indicates that the activity |
Dianne Hackborn | 93e462b | 2009-09-15 22:50:40 -0700 | [diff] [blame] | 305 | * can itself handle changes to the keyboard or navigation being hidden/exposed. |
| 306 | * Note that inspite of the name, this applies to the changes to any |
| 307 | * hidden states: keyboard or navigation. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 308 | * Set from the {@link android.R.attr#configChanges} attribute. |
| 309 | */ |
| 310 | public static final int CONFIG_KEYBOARD_HIDDEN = 0x0020; |
| 311 | /** |
| 312 | * Bit in {@link #configChanges} that indicates that the activity |
| 313 | * can itself handle changes to the navigation type. Set from the |
| 314 | * {@link android.R.attr#configChanges} attribute. |
| 315 | */ |
| 316 | public static final int CONFIG_NAVIGATION = 0x0040; |
| 317 | /** |
| 318 | * Bit in {@link #configChanges} that indicates that the activity |
| 319 | * can itself handle changes to the screen orientation. Set from the |
| 320 | * {@link android.R.attr#configChanges} attribute. |
| 321 | */ |
| 322 | public static final int CONFIG_ORIENTATION = 0x0080; |
| 323 | /** |
| 324 | * Bit in {@link #configChanges} that indicates that the activity |
Dianne Hackborn | 723738c | 2009-06-25 19:48:04 -0700 | [diff] [blame] | 325 | * can itself handle changes to the screen layout. Set from the |
| 326 | * {@link android.R.attr#configChanges} attribute. |
| 327 | */ |
| 328 | public static final int CONFIG_SCREEN_LAYOUT = 0x0100; |
| 329 | /** |
| 330 | * Bit in {@link #configChanges} that indicates that the activity |
Tobias Haamel | 27b28b3 | 2010-02-09 23:09:17 +0100 | [diff] [blame] | 331 | * can itself handle the ui mode. Set from the |
| 332 | * {@link android.R.attr#configChanges} attribute. |
Tobias Haamel | 27b28b3 | 2010-02-09 23:09:17 +0100 | [diff] [blame] | 333 | */ |
| 334 | public static final int CONFIG_UI_MODE = 0x0200; |
| 335 | /** |
| 336 | * Bit in {@link #configChanges} that indicates that the activity |
Dianne Hackborn | 3fc982f | 2011-03-30 16:20:26 -0700 | [diff] [blame] | 337 | * can itself handle the screen size. Set from the |
| 338 | * {@link android.R.attr#configChanges} attribute. |
| 339 | */ |
| 340 | public static final int CONFIG_SCREEN_SIZE = 0x0400; |
| 341 | /** |
| 342 | * Bit in {@link #configChanges} that indicates that the activity |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 343 | * can itself handle changes to the font scaling factor. Set from the |
| 344 | * {@link android.R.attr#configChanges} attribute. This is |
| 345 | * not a core resource configutation, but a higher-level value, so its |
| 346 | * constant starts at the high bits. |
| 347 | */ |
| 348 | public static final int CONFIG_FONT_SCALE = 0x40000000; |
| 349 | |
Dianne Hackborn | 3fc982f | 2011-03-30 16:20:26 -0700 | [diff] [blame] | 350 | /** @hide |
| 351 | * Unfortunately the constants for config changes in native code are |
| 352 | * different from ActivityInfo. :( Here are the values we should use for the |
| 353 | * native side given the bit we have assigned in ActivityInfo. |
| 354 | */ |
| 355 | public static int[] CONFIG_NATIVE_BITS = new int[] { |
| 356 | 0x0001, // MNC |
| 357 | 0x0002, // MCC |
| 358 | 0x0004, // LOCALE |
| 359 | 0x0008, // TOUCH SCREEN |
| 360 | 0x0010, // KEYBOARD |
| 361 | 0x0020, // KEYBOARD HIDDEN |
| 362 | 0x0040, // NAVIGATION |
| 363 | 0x0080, // ORIENTATION |
| 364 | 0x0800, // SCREEN LAYOUT |
| 365 | 0x1000, // UI MODE |
| 366 | 0x0200, // SCREEN SIZE |
| 367 | }; |
| 368 | /** @hide |
| 369 | * Convert Java change bits to native. |
| 370 | */ |
| 371 | public static int activityInfoConfigToNative(int input) { |
| 372 | int output = 0; |
| 373 | for (int i=0; i<CONFIG_NATIVE_BITS.length; i++) { |
| 374 | if ((input&(1<<i)) != 0) { |
| 375 | output |= CONFIG_NATIVE_BITS[i]; |
| 376 | } |
| 377 | } |
| 378 | return output; |
| 379 | } |
| 380 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 381 | /** |
| 382 | * Bit mask of kinds of configuration changes that this activity |
| 383 | * can handle itself (without being restarted by the system). |
| 384 | * Contains any combination of {@link #CONFIG_FONT_SCALE}, |
| 385 | * {@link #CONFIG_MCC}, {@link #CONFIG_MNC}, |
| 386 | * {@link #CONFIG_LOCALE}, {@link #CONFIG_TOUCHSCREEN}, |
Dianne Hackborn | 723738c | 2009-06-25 19:48:04 -0700 | [diff] [blame] | 387 | * {@link #CONFIG_KEYBOARD}, {@link #CONFIG_NAVIGATION}, |
| 388 | * {@link #CONFIG_ORIENTATION}, and {@link #CONFIG_SCREEN_LAYOUT}. Set from the |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 389 | * {@link android.R.attr#configChanges} attribute. |
| 390 | */ |
| 391 | public int configChanges; |
| 392 | |
| 393 | /** |
| 394 | * The desired soft input mode for this activity's main window. |
| 395 | * Set from the {@link android.R.attr#windowSoftInputMode} attribute |
| 396 | * in the activity's manifest. May be any of the same values allowed |
| 397 | * for {@link android.view.WindowManager.LayoutParams#softInputMode |
| 398 | * WindowManager.LayoutParams.softInputMode}. If 0 (unspecified), |
| 399 | * the mode from the theme will be used. |
| 400 | */ |
| 401 | public int softInputMode; |
| 402 | |
| 403 | public ActivityInfo() { |
| 404 | } |
| 405 | |
| 406 | public ActivityInfo(ActivityInfo orig) { |
| 407 | super(orig); |
| 408 | theme = orig.theme; |
| 409 | launchMode = orig.launchMode; |
| 410 | permission = orig.permission; |
| 411 | taskAffinity = orig.taskAffinity; |
| 412 | targetActivity = orig.targetActivity; |
| 413 | flags = orig.flags; |
| 414 | screenOrientation = orig.screenOrientation; |
| 415 | configChanges = orig.configChanges; |
| 416 | softInputMode = orig.softInputMode; |
| 417 | } |
| 418 | |
| 419 | /** |
| 420 | * Return the theme resource identifier to use for this activity. If |
| 421 | * the activity defines a theme, that is used; else, the application |
| 422 | * theme is used. |
| 423 | * |
| 424 | * @return The theme associated with this activity. |
| 425 | */ |
| 426 | public final int getThemeResource() { |
| 427 | return theme != 0 ? theme : applicationInfo.theme; |
| 428 | } |
| 429 | |
| 430 | public void dump(Printer pw, String prefix) { |
| 431 | super.dumpFront(pw, prefix); |
Dianne Hackborn | 12527f9 | 2009-11-11 17:39:50 -0800 | [diff] [blame] | 432 | if (permission != null) { |
| 433 | pw.println(prefix + "permission=" + permission); |
| 434 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 435 | pw.println(prefix + "taskAffinity=" + taskAffinity |
| 436 | + " targetActivity=" + targetActivity); |
Dianne Hackborn | 12527f9 | 2009-11-11 17:39:50 -0800 | [diff] [blame] | 437 | if (launchMode != 0 || flags != 0 || theme != 0) { |
| 438 | pw.println(prefix + "launchMode=" + launchMode |
| 439 | + " flags=0x" + Integer.toHexString(flags) |
| 440 | + " theme=0x" + Integer.toHexString(theme)); |
| 441 | } |
| 442 | if (screenOrientation != SCREEN_ORIENTATION_UNSPECIFIED |
| 443 | || configChanges != 0 || softInputMode != 0) { |
| 444 | pw.println(prefix + "screenOrientation=" + screenOrientation |
| 445 | + " configChanges=0x" + Integer.toHexString(configChanges) |
| 446 | + " softInputMode=0x" + Integer.toHexString(softInputMode)); |
| 447 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 448 | super.dumpBack(pw, prefix); |
| 449 | } |
| 450 | |
| 451 | public String toString() { |
| 452 | return "ActivityInfo{" |
| 453 | + Integer.toHexString(System.identityHashCode(this)) |
| 454 | + " " + name + "}"; |
| 455 | } |
| 456 | |
| 457 | public int describeContents() { |
| 458 | return 0; |
| 459 | } |
| 460 | |
| 461 | public void writeToParcel(Parcel dest, int parcelableFlags) { |
| 462 | super.writeToParcel(dest, parcelableFlags); |
| 463 | dest.writeInt(theme); |
| 464 | dest.writeInt(launchMode); |
| 465 | dest.writeString(permission); |
| 466 | dest.writeString(taskAffinity); |
| 467 | dest.writeString(targetActivity); |
| 468 | dest.writeInt(flags); |
| 469 | dest.writeInt(screenOrientation); |
| 470 | dest.writeInt(configChanges); |
| 471 | dest.writeInt(softInputMode); |
| 472 | } |
| 473 | |
| 474 | public static final Parcelable.Creator<ActivityInfo> CREATOR |
| 475 | = new Parcelable.Creator<ActivityInfo>() { |
| 476 | public ActivityInfo createFromParcel(Parcel source) { |
| 477 | return new ActivityInfo(source); |
| 478 | } |
| 479 | public ActivityInfo[] newArray(int size) { |
| 480 | return new ActivityInfo[size]; |
| 481 | } |
| 482 | }; |
| 483 | |
| 484 | private ActivityInfo(Parcel source) { |
| 485 | super(source); |
| 486 | theme = source.readInt(); |
| 487 | launchMode = source.readInt(); |
| 488 | permission = source.readString(); |
| 489 | taskAffinity = source.readString(); |
| 490 | targetActivity = source.readString(); |
| 491 | flags = source.readInt(); |
| 492 | screenOrientation = source.readInt(); |
| 493 | configChanges = source.readInt(); |
| 494 | softInputMode = source.readInt(); |
| 495 | } |
| 496 | } |