summaryrefslogtreecommitdiff
path: root/core/java/android/app/ActivityManagerNative.java
Commit message (Collapse)AuthorAgeFilesLines
* 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 @UnsupportedAppUsage annotations for greylist.Artur Satayev2019-11-191-0/+5
| | | | | | | | | | | | | go/cleanup-greylist-txt These have already been greylisted, however due to bugs/omissions in the tooling have been kept in go/greylist-txt instead of being annotated in the code. This is partial merge of aosp/Id6c1f5e403a0e66edb1102ee45f3bf19f244fb09. Telephony greylist cleanup has been done separately. Note that annotations outside of frameworks/base/ have been merged from AOSP. Bug: 137350495 Test: m Exempt-From-Owner-Approval: merge Change-Id: I015c466e8b69cc0fed5e9d394ba865aad11d8ba6
* Add @UnsupportedAppUsage annotationsMathew Inwood2018-08-141-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* Support chained attribution for alarm related WorkSources.Narayan Kamath2018-01-031-3/+3
| | | | | | | | | | | | .. those passed down via the AlarmManager.set() variant that takes a WorkSource. This required a minor re-arrangement of code in the ActivityManager. We now treat WorkSources as opaque in the AlarmManager and simply push them down to the AM (and eventually to BatteryStats) where they are picked apart. Test: BatteryStatsNoteTest, AlarmManagerTest Bug: 62390666 Change-Id: I118f1a1d16aafa41b4f401f1a6a3ba4d2d5eca8f
* Update usage of ActivityManagerNative.Sudheer Shanka2016-11-141-19/+1
| | | | | | | | | | | - Remove references to ActivityManagerProxy. - Add isSystemReady to ActivityManager. Bug: 30977067 Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test android.server.cts adb shell am instrument -e class com.android.server.am.ActivityManagerTest,com.android.server.am.TaskStackChangedListenerTest \ -w com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner Change-Id: I07390b6124fb1515821f5c0b37baf6ae74adc8fa
* Added a callback for AutoFillService.Felipe Leme2016-11-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | So far AutoFillService only received the assist data from framework; in this CL, it also offers a method where the auto-fill provider can send the auto-fill data back to framework. The workflow is: - AFMSI calls a new AM method (requestAutoFillData(), instead of requestAssistContextExtras()). - The assist receiver is located in the app, not on system service. - AM uses a new request type (ASSIST_CONTEXT_AUTOFILL) to request the assist data to the activity. - ViewStructure has a new setAutoFillId() method which is used to set an unique id for the view. - View uses the accessibility id to implement the auto-fill id. - When the activity fullfills the request, it creates an IAutoFillCallback remote object - that will be used to set the auto-fill fields - and returns it in the assist bundle (using the VoiceInteractionSession.KEY_AUTO_FILL_CALLBACK key). - The app-visible AutoFillService class offers an onFillRequest() method, which contains the assist data and a FillCallback used to handle it. BUG: 31001899 Test: manually built and ran it Change-Id: I3d208c14e81022dc96dd03f38bbe25a778b24a67
* Don't call into ActivityManagerInternal outside system process.Sudheer Shanka2016-11-071-1/+13
| | | | | | | | | | | | If ActivityManagerNative.isSystemReady is being called in a non-system process, just return true instead of calling into ActivityManagerInternal since system should be ready by now and as ActivityManagerInternal is only available for system services. Fixes: 32700143 Test: Test referenced in the bug is passing. adb shell am instrument -e class com.android.androidbvt.SysUIGSATests -w com.android.androidbvt/android.support.test.runner.AndroidJUnitRunner Change-Id: Ibb594f887f7f5391c34c686f2667a6696e4268a2
* Move IActivityManager to aidl.Sudheer Shanka2016-11-041-7100/+36
| | | | | | Bug: 30977067 Test: Existing tests are passing, dump commands still working. Change-Id: I9cf81c4d381ebce14a6c701e409cbb269f2ff1fb
* Add shell command to move activity stacks between displaysAndrii Kulian2016-11-031-0/+22
| | | | | | | | Also rename "stack movetask" command to be consistent with other shell commands. Test: New CTS tests coming soon. Change-Id: I3d7e04e0ae8ea76c27c3e4c1e286d5cd4539870c
* The big keyguard transition refactor (1/n)Jorim Jaggi2016-11-011-21/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The heart of this change are two things: 1) Instead of using the force hide mechanism to hide windows behind Keyguard, we actually make the activities invisible in activity manager. 2) When Keyguard is going away, we change the visibilities in activity manager and run an app transition. At the very core we move the responsibility of hiding activities to ActivityStack, which checks whether Keyguard is showing, and then hides all non-show-when-locked activities. For that, we need to check whether any window of an activity has SHOW_WHEN_LOCKED set. We introduce a callback from WM -> AM in case these Keyguard flags have changed. Furthermore, we decide whether to occlude Keyguard in KeyguardController, which just checks whether the top activity has SHOW_WHEN_LOCKED set. When this state changes, we prepare an occlude/unocclude app transition, and in PWM we just inform the Keyguard about the animation so SysUI can play along this animations in a mostly synchronized manner. Since we now use an app transition when unlocking the phone, we get lockscreen launch animations for free - window manager automatically waits until the activity is drawn, or directly executes the transition if there is nothing to animate. Thus, we can remove all the infrastructure around "waitingForActivityDrawn". The logic to show/hide non-app windows is moved to policy, and we add the ability to run animations on non-app windows when executing an app transition. Test: 1) runtest frameworks-services -c com.android.server.wm.AppTransitionTests 2) Manually test unlocking Keyguard: 2a) Without security 2b) With security 2c) With security but trusted 2d) Portrait while activity behind is in landscape 3) Test launching things from Keyguard 3a) Without security 3b) With security 3c) Launch camera without security 3d) Launch camera with security 3e) Launch camera with securtiy and trusted 3f) Launch voice affordance 4) Set no notifications on lockscreen, drag down, make sure you get the correct animation 5) Test clicking "emergency" on bouncer 5b) Test "Emergency info" on emergency dialer 5c) Test clicking edit button on emergency info, should show pattern on Keyguard Bug: 32057734 Change-Id: Icada03cca74d6a612c1f988845f4d4f601087558
* Creating PinnedStackController.Winson Chung2016-10-311-46/+0
| | | | | | | | | | | | - Creating a PinnedStackController to keep track of the state of the PIP to prevent changes in the system (ie. IME showing) and user interaction from clobbering each other. - Refactoring calls in AM into WM/controller Test: android.server.cts.ActivityManagerPinnedStackTests Change-Id: Ie59dfd45d5c54764ba69a589b3b8148845e92cc3 Signed-off-by: Winson Chung <winsonc@google.com>
* Add new methods to ITaskStackListenerYorke Lee2016-10-281-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactor task change notification logic into a separate class TaskChangeNotificationController. Add ActivityManagerService.unregisterTaskStackChangedListener Add a no-op implementation that clients can subclass to avoid having to reimplement all new methods when they are added. Add new methods: onTaskAdded onTaskRemoved onTaskMovedToFront onTaskDescriptionChanged onActivityRequestedOrientationChanged onTaskFinishing Design doc: https://docs.google.com/document/d/1IgWZ44rKe9k1CzkjP2Mohv12OgRD1FxH8oLAyzhvCY4/edit#heading=h.yhzl6os0dbo5 Cherry-picked from I8302d6d3baf1ac1ca928765fe203091b9fab4070 Bug: 32277482 Test: Verify that callbacks are called in dummy implementations Change-Id: I2ac2b870147ef049f3ee05fc5916c99332334526
* Merge "Refactor stack removal methods"Andrii Kulian2016-10-271-21/+0
|\
| * Refactor stack removal methodsAndrii Kulian2016-10-261-21/+0
| | | | | | | | | | | | | | | | Refactor some parts of stack removal to make methods implementations correspond to their names. Change-Id: Ie686c463d67232d9d5fd96468fe3911003d22471 Test: Manual and existing tests still pass.
* | Fix wrong bounds being used in landscape.Winson Chung2016-10-261-4/+8
|/ | | | | | | | | | | - Ensure we use the right display size when calculating PIP bounds. - Also update interface to take the display id. Test: android.server.cts.ActivityManagerPinnedStackTests Test: #testPinnedStackDefaultBounds Test: #testPinnedStackMovementBounds Change-Id: I01fd8ba6dee212c29a9a092673ee8f7843e41af6
* Apply display override config for secondary displaysAndrii Kulian2016-10-251-2/+25
| | | | | | | | | | Now display-specific settings, such as dimensions and orientation, are stored in display override config. For default display it is mirroring the global config. Each time when global config is updated, override of the default display should be updated too and vice versa. Test: Existing and manual tests still pass. Change-Id: Ic6c2190092d328820f314a05bed43c875db18170
* Merge "Changing initial PIP bounds specifications."Winson Chung2016-10-201-0/+42
|\
| * Changing initial PIP bounds specifications.Winson2016-10-201-0/+42
| | | | | | | | | | | | | | | | | | | | - Change from a absolute bounds to a size, gravity and inset to allow easier tweaking of initial pinned stack bounds. Test: android.server.cts.ActivityManagerPinnedStackTests Test: #testPinnedStackDefaultBounds Test: #testPinnedStackMovementBounds Change-Id: I82a102bbd2d83259c6c84915071d1a16728e3aa7
* | Move ApplicationThread to aidl.Sudheer Shanka2016-10-191-21/+21
|/ | | | | | Bug: 30977067 Test: Existing tests are passing, dump commands still working. Change-Id: Iecb382e8720dfb1b6b707272497e3793e6995edb
* Fixed issue with screen rotation not working for landscape<->seascapeWale Ogunwale2016-10-051-2/+5
| | | | | | | | | | | | | | | | | | Problem as introduced in the refactor to change how configuration works in activity manager in ag/1460784. With the new change we don't call back into window manager to set new configuration if there are no changes. The new change is correct, however window manager was relying on this to unfreeze the display since the rotation changed. We now have activity manager return if it updated the configuration to window manager when the rotation changes do window manager can decide if it needs to perform additional actions like unfreezing the display. Bug: 31916697 Test: CTS and Manual testing. CTS: cts-tradefed run commandAndExit cts-dev --module CtsServicesHostTestCases --test android.server.cts.ActivityManagerDockedStackTests Manual: Launch an app that suports all orientations and rotate it from landscape to seascape. Change-Id: I36ddeff1ccc9f6089227147b117a865571b8571e
* Merge "Fix constant errors in ActivityManagerNative."Nicolas Prévot2016-09-151-3/+3
|\
| * Fix constant errors in ActivityManagerNative.Nicolas Prevot2016-09-141-3/+3
| | | | | | | | Change-Id: Ie68ea6fcfb95dfa44d29418f3fbc0f6dd7b241a8
* | resolve merge conflicts of 4daa1b7 to masterRubin Xu2016-09-151-0/+22
|\ \ | |/ |/| | | Change-Id: I5292c074234fccc26c7a843f56eb68edce26d678
| * Allow direct-boot aware activity to show before profile is unlockedRubin Xu2016-09-141-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Work profile challenge is shown by intercepting normal activity launching and replacing it with the confirm credential activity. For direct boot aware activities, they should be able to be displayed when the work profile is still locked, so add a conditional in the activity intercepting logic to bypass work challenge in this case. Also launching work profile activities from notification is handled specially in order to avoid dismissing the notification if the work challenge is canceled, so add similar logic there to allow direct boot aware activity to go through. Bug: 30296144 Change-Id: Ib6395271cee2d4781009bb08d50351d73824de0c
* | Put activity into stopped state if recreated while stoppedChong Zhang2016-08-091-0/+18
|/ | | | | | | | | Move handling of recreate from client side to AMS, so that relaunch happens at the right condition and activity goes to right state after it's relaunched. bug: 30060825 Change-Id: Ia475c26927b305eb25ae12be8640aab1fb7677a0
* Move SysUI to top app scheduling if panel expandedJorim Jaggi2016-07-231-0/+20
| | | | | | | | Also fixes a bug which didn't set the correct renderThreadTid when restarting an app (for example, when SystemUI gets killed). Bug: 30292998 Change-Id: I420bee8a11d430b1e52ded050536e56a85a48800
* Add new mode for SCHED_FIFO on UI and RenderThreads.Tim Murray2016-07-071-1/+21
| | | | | | | | | | | Add a new mode, controlled by sys.use_fifo_ui property, that enables the top app's UI and RenderThread to be SCHED_FIFO. This eliminates almost all jank due to scheduling competition with non-UI critical threads. This mode may not be suitable for all devices. bug 24503801 Change-Id: I7b8a31830ad80f7efa00236928d5476998ed4e00
* Merge "Add a new API to improve VR thread scheduling." into nyc-mr1-devTim Murray2016-06-301-0/+21
|\
| * Add a new API to improve VR thread scheduling.Srinath Sridharan2016-06-301-0/+21
| | | | | | | | | | | | | | | | Adds a new API that enables device-specific scheduler optimizations for latency-sensitive VR threads. BUG: 29163534 Change-Id: I58d7be0eb266eca452c804cd07004784fb7daf2b
* | Move getRecentTasks() to ParceledListSlice.Jeff Sharkey2016-06-291-5/+5
|\ \ | |/ |/| | | | | | | am: 479212cf50 Change-Id: Ic76f624396117d922aac60eac9c2caae4f1d7e27
| * Move getRecentTasks() to ParceledListSlice.Jeff Sharkey2016-06-291-5/+5
| | | | | | | | | | | | | | | | | | In extreme cases the list of recent tasks can grow beyond the size of a single Binder transaction. This change moves over to ParceledListSlice which handles chunking any large results. Bug: 29635557 Change-Id: Iaf1227234f5f8c9451f73a6a5c1dc89f2067f05f
* | Merge "Print names of observers causing timeout" into nyc-mr1-devFyodor Kupolov2016-06-231-2/+5
|\ \ | |/ |/|
| * Print names of observers causing timeoutFyodor Kupolov2016-06-231-2/+5
| | | | | | | | | | | | | | | | Pass and store name in registerUserSwitchObserver and later print names of observers causing timeout. Bug: 29039588 Change-Id: I09c4bcc986168a07f5e20ad0f38667b783332288
* | When uninstalling, only kill the requested user.Jeff Sharkey2016-06-231-6/+8
|/ | | | | | | | When an app is being uninstalled for a specific user, only kill the app under that user; leave the app running under other users. Bug: 28875343 Change-Id: Ie60753cfd22df10a2b17d8c3732b6f19d2fe1fb9
* resolve merge conflicts of cffb19c to mnc-dev am: 3f9ea2d386 am: d6c1126fab ↵Christopher Tate2016-06-171-4/+6
|\ | | | | | | | | | | | | | | am: e2c9b1af3e am: d2a4e1b39c Change-Id: I8e59a88278ba50ab7e3768031611065131ed6834
| * resolve merge conflicts of cffb19c to mnc-devChristopher Tate2016-06-161-4/+6
| |\ | | | | | | | | | Change-Id: I4dba574de2678d851e3d82961a07de27d61f5940
| | * Don\\\'t trust callers to supply app info to bindBackupAgent() am: ↵Christopher Tate2016-06-161-4/+6
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | c58054f25f am: cd777e95a7 am: ec6c3f7a32 Change-Id: Idc2b6c712078493b4186edad750d8d5beab58adf
| | | * Don\'t trust callers to supply app info to bindBackupAgent()Christopher Tate2016-06-161-4/+6
| | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | am: c58054f25f Change-Id: I3b0bd91c38b5f13770f09f39c2eea78b63c29d7c
| | | | * Don't trust callers to supply app info to bindBackupAgent()Christopher Tate2016-06-141-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Get the canonical identity and metadata about the package from the Package Manager at time of usage rather than rely on the caller to have gotten things right, even when the caller has the system uid. Bug 28795098 Change-Id: I215786bc894dedf7ca28e9c80cefabd0e40ca877
| | | | * Do not make ActivityContainer available to apps. DO NOT MERGECraig Mautner2015-02-191-20/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A security leak was discovered whereby a malicious app could get the IActivityContainer object from one app and use it to inject events into another app. This fix removes the availability of the IActivityContainer and replaces its one use with a method for returning the information the IActivityContainer was used for. Fixes bug 19394591. Change-Id: Ib3cec25b25130cd8e098892c057742cfd575cfdd
| | * | | am 28de8edb: am ab8f60e4: am a94e4297: Merge "Do not make ActivityContainer ↵Craig Mautner2015-02-171-20/+9
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | available to apps. DO NOT MERGE" into lmp-mr1-dev * commit '28de8edb7d72f938f47d7fdd8ce058c5c8933b8e': Do not make ActivityContainer available to apps. DO NOT MERGE
| | | * | Do not make ActivityContainer available to apps. DO NOT MERGECraig Mautner2015-02-171-20/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A security leak was discovered whereby a malicious app could get the IActivityContainer object from one app and use it to inject events into another app. This fix removes the availability of the IActivityContainer and replaces its one use with a method for returning the information the IActivityContainer was used for. Fixes bug 19394591. Change-Id: Ib3cec25b25130cd8e098892c057742cfd575cfdd
* | | | | Allow apps to bypass Power Save restrictions when launched from a ↵Felipe Leme2016-05-271-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Notification's PendingIntent. This scenario typically happens when the device is on Doze Mode and a notification action is triggered from a Wear device. In a nutshell, the workflow is: - ProcessRecord has a flag telling whether a process has "whitelist management" privileges. - When NotificationManager binds a new NotificationListenerService, it sets the BIND_ALLOW_WHITELIST_MANAGEMENT flag. - On bind(), ActiveService asserts that only system apps can set that flag. - On computeOomAdjLocked(), ActivityManagerService sets the ProcessRecord flag if necessary. - Upon creating a notification, NotificationManager calls AM to mark its PendingIntents as coming from a notification. - When PendingIntentRecord sends it to the target, it checks if it's from a notification and if so calls AM to do the temp whitelist. - On unbind(), ActiveService removes the ProcessRecord flag if necessary. Fixes: 28818704 Change-Id: I00d46036a2cbb73f7f733fd35bf0b743a02807a1
* | | | | Fix issue #28868955: CTS: PendingIntentTest failures; Regressed in NRD48xDianne Hackborn2016-05-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Uh, yeah. Change-Id: I452187fcdda634ebf00e5d6bcaa45433f348c17e
* | | | | Fix issue #27532364: Security Vulnerability in IIntentSender.sendDianne Hackborn2016-05-131-0/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need to make IIntentSender oneway... but when the system is calling that for itself, it needs to be able to return a result code. Solution: instead of directly calling the interface, we have a new IPC through the activity manager. If the thing being used is the activity manager impl, it can do the synchronous send and return the result directly in place. If not, you only get asynchronous sending and thus never a failure result back (too bad for you!). Change-Id: I4096e5b00063e8dba66230585a2dfe67e35e8092
* | | | | Fix multi-window assiststructure trashingAmith Yamasani2016-05-101-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When multiple activities within the same process try to handle requests for AssistStructure, the singleton mLastAssistStructure tends to trash the old structure when a second window's request comes in. This change passes in a sessionId so that the cache is only cleared if the session id changes. Bug: 28348867 Change-Id: I07efcd933db7e48aefd25a1c95493b71bbcffe4b
* | | | | Merge "Move the 'pretend idle jobs can run now' broadcast into AMS" into nyc-devChris Tate2016-05-061-0/+16
|\ \ \ \ \
| * | | | | Move the 'pretend idle jobs can run now' broadcast into AMSChristopher Tate2016-05-061-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's a protected broadcast, so sending it directly from 'am' is no longer an option. This is needed for CTS as well as being generally useful during app development. Bug 28406044 Change-Id: I101915a8c6f19454330a8db2079a75023c112582
* | | | | | Dismiss docked stack if an activity is shown on top of the lock screenWale Ogunwale2016-05-061-3/+6
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is risky/complicated to try to put the activity showing on-top of the lock screen in the right fullscreen configuration with the current architecture. So, we just dismiss for now. Bug: 28195260 Change-Id: I29a0350993ce8fe548d4a465b06d877cde151c78
* | | | | Don’t relaunch activity in fullscreen stack when entering split screen modeWale Ogunwale2016-05-011-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When entering split-screen mode by long pressing the recents button, the top task in the fullscreen stack is moved to the docked stack and the new top task is the fullscreen stack is considered visible for a short amount of time until sys-ui launches the recents activity. This causes the new top activity in the fullscreen stack to be relaunched due to configuration change. To fix this sys-ui now sends an hint to activity manager to move the home stack forward so that it can be on-top of the fullscreen stack and makes it invisible before recent is launched and animated in. Bug: 28470261 Change-Id: Icfd85e932fe913dfb498752b5878cc7c690fd559