summaryrefslogtreecommitdiff
path: root/core/java/android/app/LocalActivityManager.java
Commit message (Collapse)AuthorAgeFilesLines
* Update ContentCaptureContext to have a token informationJoanne Chung2021-03-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | In order to support auto translation, we need to give information to content capture service to let the app can use this information to find the Activity which needed to be translated. It's not safe to provide an activity token to the client app directly even if it is a privilege app. They can use this activity token to access many activity/windows related functions. We create a new token for use for content capture and translation. This token will be used get the target Activity for translation new APIs. This change focuses on the Content capture API change, the API change about translation will be done in the next change, Bug: 177789967 Test: manual. Make sure cc service can get the information. Test: atest android.view.contentcapture.ContentCaptureContextTest Test: atest CtsContentCaptureServiceTestCases Change-Id: Ife8096a8bd1e71ce4e686d95043e347222ad7ee6
* Send ActivityOptions to clientRiddle Hsu2021-01-051-1/+2
| | | | | | | | | | | | | | | | | | | | This removes getActivityOptions from server side. So 2 binder transactions from Activity#performCreate and performStart can be eliminated. The remote animation in ActivityOptions is also separated to another field of ActivityRecord, so when consuming the options, the remote animation won't be affected. Bug: 65202329 Bug: 132432864 Bug: 175409544 Test: WmTests:ActivityRecordTests#testTakeOptions ObjectPoolTests#testRecycleStartActivityItem CtsTransitionTestCases:ActivityTransitionTest CtsUsageStatsTestCases:ActivityTransitionTest Change-Id: I600a9a478a3e596e58b0a8120cfa8b9f32598b47
* Revert "Revert "Introduce ActivityTransactionItem and reduce null checks""Chilun Huang2020-09-181-12/+31
| | | | | | | | | | | | | | | | | | | | | | | | This reverts commit fd2be2c17882c7db2833ed35c2b4da975801e527. Reason for revert: Reland the CL This class is used for activity-targeting item to inherit, which encapsulate null checks of activity client record. This patch also change signature of ClientTransactionHandler#handle* and reduces null checks. In addition, add some null pointer checks after getActivityClient(). Also fix a typo in performStopActivityInner() and performDestroyActivity(). Bug: 127877792 Bug: 164982975 Test: atest frameworks/base/core/tests/coretests/src/android/app/servertransaction Test: atest ActivityThreadTest ActivityThreadClientTest Test: atest TransactionExecutorTests#testActivityItemNullRecordThrowsException Test: atest TransactionExecutorTests#testActivityItemExecute Test: atest CtsAppTestCases:LocalActivityManagerTest Change-Id: Ida612f1c8af7ecd7a04e69ade461403b8711508a
* Revert "Introduce ActivityTransactionItem and reduce null checks"David Srbecky2020-08-171-20/+11
| | | | | | | | | This reverts commit 9b1e955021ce4ce8c09b26c5fb38a2bb9c5a2d6d. Reason for revert: Breaks many tests Bug: 164982975 Change-Id: I86e7b158ae593aab6d73950bbb2b9dc6a7d5093c
* Introduce ActivityTransactionItem and reduce null checksCharles Chen2020-08-101-11/+20
| | | | | | | | | | | | | | | This class is used for activity-targeting item to inherit, which encapsulate null checks of activity client record. This patch also change signature of ClientTransactionHandler#handle* and reduces null checks. Bug: 127877792 Test: atest frameworks/base/core/tests/coretests/src/android/app/servertransaction Test: atest ActivityThreadTest ActivityThreadClientTest Test: atest TransactionExecutorTests#testActivityItemNullRecordThrowsException Test: atest TransactionExecutorTests#testActivityItemExecute Change-Id: Idc0e9f583fc04e3a9043c28e83475acc65710731
* Use START/STOP messages to update visibilityAndrii Kulian2020-01-081-1/+1
| | | | | | | | | | | | | | | | | | Activity visibility messages simply move the activity to STOPPED or STARTED state. We can use the lifecycle messages to do the same and simplify the logic/remove duplicated code. This CL also removes the option to send STOP message without making the client invisible and actually calling onStop(). This option caused a mismatch of the state between server (STOPPED) and client (PAUSED). Also, in cases when the device was going to sleep, STOP message was always followed by SLEEP message, which called onStop() anyway. Bug: 137329632 Bug: 129750406 Test: AM/WM CTS and unit tests Change-Id: I487575520ce301bb2f65519f0c0a30b6b9edac0c
* Use new UnsupportedAppUsage annotation.Artur Satayev2019-12-181-1/+1
| | | | | | | | Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library. Bug: 145132366 Test: m && diff unsupportedappusage_index.csv Change-Id: I8789f8499d4dca08580672e9e45ed9a7026dd686
* Add max target sdk for LocalActivityManagerCharles Chen2019-08-081-6/+19
| | | | | | Test: build and presubmit Bug: 137825207 Change-Id: I30ca8a966e26bd8394e4f9bb0374b360d064673c
* Adding API for defining and invoking DirectActionsSunny Goyal2019-04-261-1/+1
| | | | | | | | | | | | | | | | | | | DirectActions are abstract actions defined by an Activtiy. The actual definition of these actions will be available through the support lib. This API provides a secure channel for system or assistant to interact with a running app using these Actions. Test: atest CtsVoiceInteractionTestCases Test: added android.voiceinteraction.cts.DirectActionsTest Bug: 129705716 Exempt-From-Owner-Approval: Resolving merge conflict Change-Id: I0ce568e0d8f41e0fe46306052016a74c7b394efa (cherry picked from commit d40c345536c385ed511238deedc943644ef25100)
* Remove custom lifecycle transitions for onNewIntent callbackLouis Chang2019-04-081-1/+1
| | | | | | | | | | | Rebased from ag/3785659. This CL switches to using post-execution state resolution for new intent delivery. Also removes some unnecessary code needed for old logic. Bug: 65236456 Bug: 77974794 Test: atest ActivityLifecycleTests Change-Id: I734ad50de498cd2a6b9514c8ef6cb1eeb08e4ec5
* Add @UnsupportedAppUsage annotationsMathew Inwood2018-08-141-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | For packages: android.app.usage android.app.trust android.app.timezonedetector android.app.timezone android.app.timedetector android.app.job android.app.backup android.app.assist android.app.admin android.app This is an automatically generated CL. See go/UnsupportedAppUsage for more details. Exempted-From-Owner-Approval: Mechanical changes to the codebase which have been approved by Android API council and announced on android-eng@ Bug: 110868826 Test: m Change-Id: I618c5dc4462ae990d9df45c3e9ed3f092cc5138c
* Improve temporary logging around activity destruction.Bryce Lee2018-02-091-2/+2
| | | | | | | | | | This changelist improves logging for capture details around b/71506345. These modifications are intended to be reverted once the root cause has been found. Bug: 71506345 Test: manual Change-Id: I1dd5eba710e81bf78632359d4ee4c047fefa5da6
* Merge "Always execute onStop and onSaveInstanceState together"Andrii Kulian2018-01-311-2/+2
|\
| * Always execute onStop and onSaveInstanceState togetherAndrii Kulian2018-01-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because onStop is guaranteed to be called when activity goes away and onSaveInstanceState is always called before onStop (starting with Honeycomb), we can execute these two callbacks together. This CL consolidates all call points to stop the activity and moves them to callActivityOnStop, which will also take care of saving instance state. Bug: 68325009 Bug: 68763258 Test: Manual Change-Id: I1062c6be28581a7de7961babd55664640aaae359
* | Perform Activity#onStart when launching in LocalActivityManager.Bryce Lee2018-01-251-0/+17
|/ | | | | | | | | | | | | | We move to the start state when launching a tabbed activity through LocalActivityManager, but currently do not inform the activity thread due to changes in how ActivityThread is updated through the ActivityLifecycler. This changelist addresses this issue. Change-Id: Ibc2bda39617e1741bb3ee8637a182dc9f14dd61d Fixes: 70813462 Fixes: 70812753 Test: atest CtsAppTestCases:android.app.cts.LifecycleTest Test: atest LocalActivityManagerTest Test: atest ActivityGroupTest
* Add transaction executorAndrii Kulian2017-12-051-5/+8
| | | | | | | | | | | | | | | | | This adds TransactionExecutor class, that takes care of executing a multi-stage ActivityManager client transaction in correct order. First it executes all callbacks, while also making sure to transition to the right pre- and post-execution state if requested. In the end it cycles to the final requested lifecycle state. This also switches activity launch process to use lifecycler - it initializes activity launch and sets final desired state in the same transaction. Bug: 64797980 Test: android.app.servertransaction.TransactionExecutorTests Change-Id: I306f9396fab263682f580cc8c924a3cedb40ef89
* Immediately deliver new intent to paused activity in docked stackWale Ogunwale2016-09-131-1/+1
| | | | | | | | | | | | | | | | | When the docked stack is minimized and we are unminimizing it due to a request to start it's currently paused top activity, it is possible for the new intent not do be delivered immediately because it isn't resumed due to another activity been launched in the system (Recents) which is resumed instead. So, the user won't see the effect of the new intent until they touch the docked activity causing it to get the new intent and resume. We now deliver new intents to the top activity in the docked stack if it is in a minimized state. Then on the client side we temporarily resume the activity and pause it again to guarantee onResume is called after onNewIntent. Bug: 31371093 Change-Id: Ib1764ccf5efc9d6498ce6cc8a34236c79fc07dad
* Add activity onStop lifecycle to event logs.Wale Ogunwale2016-03-011-8/+8
| | | | | | | Also added reasons why onPause and onResume are called. Bug: 27384433 Change-Id: If6c304f577b601511f6d9b948061d2cfa0dcb970
* Add Activity API to get referrer information.Dianne Hackborn2014-11-111-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This expands the use of EXTRA_REFERRER to be relevant anywhere, allowing apps to supply referrer information if they want. However, if they don't explicitly supply it, then the platform now keeps track of package names that go with Intents when delivering them to apps, which it can be returned as the default value. The new method Activity.getReferrer() is used to retrieve this referrer information. It knows about EXTRA_REFERRER, it can return the default package name tracked internally, and it also can return a new EXTRA_REFERRER_NAME if that exists. The latter is needed because we can't use EXTRA_REFERRER in some cases since it is a Uri, and things like #Intent; URI extras can only generate primitive type extras. We really need to support this syntax for referrers, so we need to have this additional extra field as an option. When a referrer is to a native app, we are adopting the android-app scheme. Since we are doing this, Intent's URI creation and parsing now supports this scheme, and we improve its syntax to be able to build intents with custom actions and stuff, instead of being all hung up on custom schemes. While doing this, fixed a problem when parsing both intent: and new android-app: schemes with a selector portion, where we were not respecting any scheme that was specified. Change-Id: I06e55221e21a8156c1d6ac755a254fea386917a2
* New extended Intent protcols for installing/uninstalling apps.Dianne Hackborn2011-08-101-4/+4
| | | | Change-Id: I13be1cc58c91f51d521a1f0f734d2b2db7b2980b
* SDK only: integrate new sample code, deprecating along the way.Dianne Hackborn2011-06-161-1/+6
| | | | | | | | | | | | The new support library features and sample code for switching between fragments using a TabHost now eliminates the utility of the TabActivity class, so deprecate it. This also means there is no longer any use in ActivityGroup or LocalActivityManager. Yay. Also fix up things so the new support API demos are included in the documentation. Change-Id: I4f073b82787f32560ba1fa5b6a23746ecc8aecdc
* Correctly save Activity's state in saveInstanceStateMartin Hibdon2010-12-221-1/+1
| | | | | | | | | | | Prior to this change, saveInstanceState would call directly to Activity.onSaveInstanceState(), rather than performSaveInstanceState(). This meant that saveManagdDialogs() was not called, so Activities running under a LocalActivityManager do not get their dialogs restored on configuration changes. Change-Id: Id45110a8716a86958c14f4b1ea5a84c9cdf107f1
* Rework activity lifecycle so onSaveInstanceState() is after onPause().Dianne Hackborn2010-12-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | The goal is to fix a bunch of fragment-related bugs caused by various things trying to do fragment transactions after onPause()... which currently throws an exception, since this is after the activity's state has been saved so the new fragment state can be lost. The basic change is relatively simple -- we now consider processes hosting paused or stopping activities to be unkillable, and the client code now does the onSaveInstanceState() as part of stopping the activity. For compatibility, if an app's targetSdkVersion is < HONEYCOMB, the client side will still call onSaveInstanceState() prior to onPause() and just hold on to that state until it needs to report it in once being stopped. Also included here is a change to generate thumbnails by taking screenshots. The code for generating thumbnails by re-rendering the view hierarchy is thus removed. Change-Id: Iac1191646bd3cadbfe65779297795f22edf7e74a
* Fix memory leak in LocalActivityManager. Also properly removes embedded ↵Romain Guy2010-06-031-11/+6
| | | | | | | | activities. Bug #2738247 Change-Id: Ib75be22fde5f1408250947566c69174c6f248c98
* Further work on fragments:Dianne Hackborn2010-05-131-4/+9
| | | | | | | | | | - Implement all of the state saving and restoring machinery. This caused some flux in the API. - Add ability to have fragments that are retained across activity instances. - Fix some bugs. Change-Id: Ib6b5b0752d7f8d667cfdcd3e76d127cc9b6d901b
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-031-0/+627
|
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-031-627/+0
|
* Code drop from //branches/cupcake/...@124589The Android Open Source Project2008-12-171-5/+35
|
* Initial ContributionThe Android Open Source Project2008-10-211-0/+597