summaryrefslogtreecommitdiff
path: root/core/java/android/content/IntentSender.java
Commit message (Collapse)AuthorAgeFilesLines
* [RESTRICT AUTOMERGE] Fix bypass BG-FGS and BAL via package manager APIsRhed Jao2023-02-141-2/+39
| | | | | | | | | | | | | | | | | | | Opt-in for BAL of PendingIntent for following APIs: * PackageInstaller.uninstall() * PackageInstaller.installExistingPackage() * PackageInstaller.uninstallExistingPackage() * PackageInstaller.Session.commit() * PackageInstaller.Session.commitTransferred() * PackageManager.freeStorage() Bug: 230492955 Bug: 243377226 Test: atest android.security.cts.PackageInstallerTest Test: atest CtsStagedInstallHostTestCases Change-Id: I9b6f801d69ea6d2244a38dbe689e81afa4e798bf (cherry picked from commit 03b77aee350696781b4d7a61768a172bedc3ac73) Merged-In: I9b6f801d69ea6d2244a38dbe689e81afa4e798bf
* Proposal: Reduce the number of IPCs in PendingIntentSoonil Nagarkar2021-02-181-29/+21
| | | | | | | | | | | Several PendingIntent methods are named such that there is very little hint they involve any IPC, leading devs to overuse them, and thus adds substantial strain on the system. Caching some of the most used method results could remove 1000s of unnecessary IPCs. Bug: 180518680 Test: manual sanity check Change-Id: I7658251113ebb1e51280a4b8f3b49159d4f764f0
* Add @Nullable annotation to the parameter of Object.equals() methods.Roman Kalukiewicz2020-10-151-2/+2
| | | | | | | | | | | | | | | | | | Those annotations could be inferred by some tools (like Kotlin), but the https://checkerframework.org/ doesn't check inherited annotations complaining about all equals() invocations that get nullable argument. The change was generated by running find . -name \*.java | xargs sed -i 's/public boolean equals(Object /public boolean equals(@Nullable Object /' in the frameworks/base directory and by automatically adding and formatting required imports if needed. No manual edits. Bug: 170883422 Test: Annotation change only. Should have not impact. Exempt-From-Owner-Approval: Mechanical change not specific to any component. Change-Id: I5eedb571c9d78862115dfdc5dae1cf2a35343580
* Use new UnsupportedAppUsage annotation.Artur Satayev2019-12-181-2/+2
| | | | | | | | 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: I6ab53570aca580fbee1fcc927871caa09780f58f
* All Parcelable CREATOR fields are @NonNull.Jeff Sharkey2019-02-281-1/+1
| | | | | | | | | If they were null, then the Parcelable would fail to work. Bug: 126726802 Test: manual Change-Id: I7929ffa2f20e5de1c8e68e8263cca99496e9d014 Exempt-From-Owner-Approval: Trivial API annotations
* Add @UnsupportedAppUsage annotationsMathew Inwood2018-08-151-0/+4
| | | | | | | | | | | | | | | | | | | | | | For packages: android.content.res android.content.pm.split android.content.pm.permission android.content.pm.dex android.content.pm android.content.om android.content 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: Ia79256a3d04e16dd78331a61af0dcddc5fc1599b
* Fix issue #38393543: Not allowed to start service IntentDianne Hackborn2017-05-191-0/+5
| | | | | | | | | Turns out there was another path in to the activity manager to trigger a PendingIntent, which needs to be modified to now also pass in the whitelist token of that pending intent. Test: manual Change-Id: I755ff87db1b782fa6974d404dcb490786053c5e0
* Fix issue #37360626: Apps can schedule alarms (and other things) with temp ↵Dianne Hackborn2017-05-101-1/+8
| | | | | | | | | | | | | | | | | | | | | | whitelist There is now an IBinder "token" that must be specified when setting the whitelist duration for an Intent. To have the whitelist supplied, the caller to send a PendingIntent must pass in the same token. The PendingIntent and IntentSender classes now internally maintain this token to pass in when their send() is called. The big complexity for making this work is we now need to associate this whitelist token correctly with the actual PendingIntent objects that applications and other code is getting. To do this, we propagate the token in the Notification object, and have a new API on Parcel that allows us to make it available to PendingIntent when it is unmarshalled. And this allows to deal with PendingIntents appearing in nested bundles, as we can propagate that information from the original Parcel to the new Parcel that Bundle keeps to delay unmarshalling. Test: manual Change-Id: Idda00490ccfe2be37e4ab21354b9ab7528a52750
* Update usage of ActivityManagerNative.Sudheer Shanka2016-11-141-6/+6
| | | | | | | | | | | - 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
* Fix issue #27532364: Security Vulnerability in IIntentSender.sendDianne Hackborn2016-05-131-5/+2
| | | | | | | | | | | | | 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 issue #21814207 and issue #21814212 (alarm manager)Dianne Hackborn2015-06-171-1/+1
| | | | | | | | | | | | | | | | | Issue #21814207: AlarmManager.setAndAllowWhileIdle should also allow wake locks. Introduce a whole new infrastructure for providing options when sending broadcasts, much like ActivityOptions. There is a single option right now, asking the activity manager to apply a tempory whitelist to each receiver of the broadcast. Issue #21814212: Need to allow configuration of alarm manager parameters The various alarm manager timing configurations are not modifiable through settings, much like DeviceIdleController. Also did a few tweaks in the existing DeviceIdleController impl. Change-Id: Ifd01013185acc4de668617b1e46e78e30ebed041
* Fix API review bugs.Dianne Hackborn2012-09-171-3/+17
| | | | | | | | | 7173152 API REVIEW: android.content.pm.PackageUserState 7172969 API REVIEW: android.app.PendingIntent 7172730 API REVIEW: android.content.Context 7172726 API REVIEW: android.manifest.permission Change-Id: Iad470256d3b5ca5596487f6a699ec1871457c3b5
* Add registering for explicit users.Dianne Hackborn2012-09-041-2/+2
| | | | | | | | | | | | | New API to register as an explicit user, which allows you to also select ALL to see broadcasts for all users. New BroadcastReceiver API to find out which user the broadcast was sent to. Use this in app widget service to handle per-user package broadcasts and boot completed broadcasts correctly. Change-Id: Ibbe28993bd4aa93900c79e412026c27863019eb8
* Switch public APIs to use new UserHandle class for identifying users.Dianne Hackborn2012-08-171-5/+5
| | | | | | Gets rid of "yet another integer" confusion. Change-Id: Id07ea7307aea7c62f0087c6663a1f1c08e2e5dee
* Rename UserId to UserHandle.Dianne Hackborn2012-08-161-2/+2
| | | | | | This is the start of turning this into a formal public API. Change-Id: I5786d2c320f1de41a06ed5d0f65adb68967287a0
* Add PendingIntent and IntentSender APIs to get user handle.Dianne Hackborn2012-08-141-0/+42
| | | | | | Also uid. Change-Id: I0a328d0cc2bbc17dc0a49b7b8b8d515af80f1e15
* Fix issue #4902856: Don't let apps register non-explicit PendingIntentsDianne Hackborn2011-06-301-2/+35
| | | | | | | | | | | | | | Location manager now checks for such intents, and logs a warning when they are given to it. Nothing thrown yet, it needs to check the targetSdkVersion of the caller somehow. When sending the pending intent, we require that the recipient hold the appropriate permission. This should pretty much close the security hole. Includes a bunch of infrastructure in the activity manager needed to support all this. Change-Id: I4dba7a98a7b8bbb9e347666451aa9cb1efad1848
* Add support for heavy-weight applications.Dianne Hackborn2010-06-041-0/+20
| | | | | | | Only one can be running at a time, their process can not be killed, and a notification is posted while it is running. Change-Id: I843015723947e0c934ae63a1aeee139327c0bc01
* Fix issue #2166755: BroadcastReceiver trying to return result during a ↵Dianne Hackborn2009-10-051-1/+1
| | | | | | | | | | | | non-ordered broadcast Tell the broadcast receiver whether it is getting an initial sticky value, so it will be quiet about attempts to do ordered broadcast stuff. Note that the original bug being reported was not actually a crash, just an error log. So all we are doing here is making the log quieter. Change-Id: Iaf1b718d82093ec1197142410a64feff47eb3859
* Fix issue #2093608: Calendar widget takes a few seconds to launchDianne Hackborn2009-09-171-0/+5
| | | | | | | | | | | Avert your eyes! The key change here is that RemoteViews can now call a Context API to start its pending intent, which inside of the activity manager we can use to determine to cancel the timeout delay for external entities to disrupt the home screen. Change-Id: If097cf7478cbed7a3c04a304050bd7fd5703d197
* Updates from API review.Dianne Hackborn2009-07-281-2/+7
| | | | | | | | | | | | * AccessibilityService -- document onBind() to not be implemented. * GestureLibrary.getLearner() -- needs to be hidden. * IntentSender -- remove protected constructors, document that it is retrieved from a PendingIntent. * Hide permissions: SHUTDOWN, STOP_APP_SWITCHES. * Context -- hide BACKUP_SERVICE. * ContextWrapper -- hide getSharedPrefs bla h blah * Intent.parseUri() -- fix docs. * ApplicationInfo.FLAG_TEST_ONLY?!? * Hide MockContext.getSharedPrefs blah blah
* Remove circular dependency in PackageManager. api freeStorage uses ↵Suchi Amalapurapu2009-06-171-0/+255
PendingIntent from android.app Create a new public IntentSender class that can be used by PackageManager instead. This new class uses IIntentSender internally and can only be created by PendingIntent for now. Provide a new getIntentSender api in PendingIntent to create an instance of this class. Move IIntentSender and IIntentReceiver from android.app to android.content Change imports of IIntentSender and IIntentReceiver to reflect the new package name The PackageManager api has been named as freeStorageWithIntent and will be renamed as freeStorage once the older api(which has been deprecated) will be removed shortly.