summaryrefslogtreecommitdiff
path: root/libs/binder/IAppOpsService.cpp
AgeCommit message (Collapse)Author
2021-04-19libbinder->libpermission: appops Steven Moreland
Since libbinder is used in many places, lightening it up (vtables in these classes contribute to private dirty memory). Bug: 183654927 Test: boot Change-Id: I79aa34c023074862c6c568be1f8e3503cd4a24eb
2021-04-08Properly unparcel return from note/startOperation Nate Myren
still to do: replace manual unparcelling with a C++ SyncNotedAppOp class Fixes: 184695771 Test: atest AppOpsLoggingTest Change-Id: Id1d9e72d9b2e5ba74b4782ca8d014235cf8513a1
2021-04-01Update native AppOpsService to unpack SyncNotedAppOp Nate Myren
Still return only mode, but unpack the "null attribution tag" byte from SyncNotedAppOp first. Bug: 184111263 Test: Presubmit Change-Id: I53cf9df803b23c30b0721998ff1ff18d928afd75
2020-11-25Merge "remove extra semicolons [-Wextra-semi]" am: b0379e376d am: 9baa2fe651 ↵ Treehugger Robot
am: 0ee3c1e24a Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1508298 Change-Id: Iacc3bffe2b560f841b3ef223f2b6e5c2e05d6f2b
2020-11-25remove extra semicolons [-Wextra-semi] Jooyung Han
Bug: n/a Test: no errors with -Werror,-Wextra-semi Change-Id: If523cadea4c6f02a9155fb7482ba5463fff7854a
2020-08-03Add shouldCollectMessage parameter to AppOpsManager calls from native code. Stanislav Zholnin
Bug: 161362515 Test: manually verified Change-Id: I05894dee10ba2cab587aea5d02773feae1085e34
2020-03-11Rename featureId -> attributionTag Philip P. Moltmann
Bug: 148792795 Test: TH Change-Id: Ic56606795e5e68ba76794198faf496eec6d87cd0 Exempt-From-Owner-Approval: API rename Merged-In: Ic56606795e5e68ba76794198faf496eec6d87cd0
2020-03-11Rename featureId -> attributionTag Philip P. Moltmann
Bug: 148792795 Test: TH Change-Id: Ic56606795e5e68ba76794198faf496eec6d87cd0 Exempt-From-Owner-Approval: API rename
2020-02-26Use std::optional for @nullable (AIDL) Jooyung Han
Previously, nullable types were mapped to std::unique_ptr for C++ backend. But std::unique_ptr typically involves unnecessary alloc/dealloc. For example, if nullable string is represented in unique_ptr<string>, we should do "unique_ptr<string>(new string(value))" to set a value. To avoid breaking all hand-written parcelables, only new read/write functions are added to Parcel class and they are used only by aidl-generated code and their implementations. Bug: 144773267 Test: build/flash/boot atest --test-mapping frameworks/native/libs/binder Merged-In: I2c801e3b69f2f8ccf44267f15cbf79e1d8fbf19e Change-Id: I2c801e3b69f2f8ccf44267f15cbf79e1d8fbf19e (cherry picked from commit 149be4a25ef423491c73dfc7bfd95e8177e9b4f8) Exempt-From-Owner-Approval: CP from master
2020-02-24Use std::optional for @nullable (AIDL) Jooyung Han
Previously, nullable types were mapped to std::unique_ptr for C++ backend. But std::unique_ptr typically involves unnecessary alloc/dealloc. For example, if nullable string is represented in unique_ptr<string>, we should do "unique_ptr<string>(new string(value))" to set a value. To avoid breaking all hand-written parcelables, only new read/write functions are added to Parcel class and they are used only by aidl-generated code and their implementations. Bug: 144773267 Test: build/flash/boot atest --test-mapping frameworks/native/libs/binder Change-Id: I2c801e3b69f2f8ccf44267f15cbf79e1d8fbf19e Exempt-From-Owner-Approval: already got ORV from smoreland
2020-01-04Collect AsyncNotedAppOp in same call as native noteOp Philip P. Moltmann
This reduces the overhead of collecting noted app-ops Exempt-From-Owner-Approval: minor change Bug: 136505050 Test: atest CtsAppOpsTestCases Change-Id: I05a186b772b337219f9e70123a89a15f1e88dd15
2019-12-09Create local clientId instead of sharing one Philip P. Moltmann
Bug: 144997947 Test: TH Change-Id: I767036b0acd3e5b6fb866dfef6ef5fdceb8f12de
2019-11-05Allow null featureIds in AppOpsService binder calls Philip P. Moltmann
Bug: 136595429 Test: atest CtsAppOpsTestCases Change-Id: I48713e962e3c3b60bd31ef134712a1d2f3da7cf5
2019-10-09Note appOps with featureIds from native code Philip P. Moltmann
Test: atest CtsAppOpsTestCases Bug: 136595429 Change-Id: I31cc35134035d19aa7b98567fd998ff7f406b271
2019-09-27Remove extraneous semicolon. Steven Moreland
Bug: N/A Test: build w/o -Wno-c++98-compat-extra-semi Change-Id: I632d6df9a03485e547a6e7f14df0f1c068066c1e
2019-09-09libbinder: Hide AppOpsManager/Service from vendor. Steven Moreland
Vendor apps can still use these behind stable SDK or NDK APIs as applicable, but native code on the vendor image can't use these APIs because they are using /dev/vndbinder and have an incompatible copy of libbinder. Since no vendor binary is serving this, removing extra pound defines and making the vendor version of this library slightly smaller. Bug: 124524556 Test: builds (no vendor code has added dependencies on this yet) Change-Id: Idf01641d4b340ca6fe33c181969507ec071ef930
2019-08-30Camera: add camera audio restriction binder call Yin-Chia Yeh
Also add the API to AppOpsManager Test: new CTS tests Bug: 135676184 Change-Id: I8bcdd34a4b6bb0fba5151677db38f8c35b7ae97e
2019-08-28Support noted appops collection in native code Philip P. Moltmann
With change I96ded4a8d8d9bcb37a4555d9b1281cb57945ffa9 the system now allows apps to collect all app-ops that are noted for them. Native code can also note app-op. Unfortunately there is no guaranteed way how an app's native code can interact with java code that might or might not be running in the same process. Hence we cannot support sending the noted app-ops back to the caller over binders. Hence all notes app-ops will need to be collected as AsyncNotedOps Test: atest CtsAppOpsTestCases (includes tests that note app-ops natively) Bug: 136505050 Change-Id: I5dc479468c8dae3b10f071123b0535a288bf8662
2019-07-15Merge "libbinder: don't export Static.h" Steven Moreland
am: b78f7c8eff Change-Id: Ie6a27a2a8089dcd68c4ebb584205eef98bdebe2a
2019-07-12libbinder: don't export Static.h Steven Moreland
This was being exported by the build system, but it shouldn't be used anywhere. Bug: N/A Test: N/A Change-Id: Id10772ec3e0ebf39ddf83f0f7981552c3f2e528d
2019-03-12Native impl for ApOpManager.checkAudioOperation Jean-Michel Trivi
Bug: 112339570 Test: enter DnD, play notifications, verify not heard Change-Id: I645121cbf2c5d99a727f82b8fbf4226d104a5ae3
2018-10-29Suppress lint warnings on google-default-arguments Jiyong Park
The lint rule google-default-arguments ensures that virtual or override methods do not have default arguments, because different default values across the hierarchy chain (e.g. Base::foo(int a=0) v.s. Derived::foo(int a=10)) can cause confusions. However, since the uses of the default arguments in libbinder don't lead to such problem, suppress the warnings. Test: WITH_TIDY=true WITH_TIDY_CHECKS=google-default-arguments m libbinder does not show any warning about google-default-arguments Change-Id: I90f6d05a9dc3232d0c63563df18a582432b83574
2018-06-08Merge pi-dev-plus-aosp-without-vendor into stage-aosp-master Xin Li
Bug: 79597307 Change-Id: I6d6bee71b9424eb478780bbfc06b830eb8ded342
2018-06-07[binder] Replace NULL/0 with nullptr Yi Kong
Fixes -Wzero-as-null-pointer-constant warning. clang-tidy -checks=modernize-use-nullptr -p compile_commands.json -fix ... Test: m Bug: 68236239 Change-Id: I3181bc5683796423a98b0f9b94daf30880c07bdc Merged-In: I3181bc5683796423a98b0f9b94daf30880c07bdc (cherry picked from commit 91635563b8a1bf7a31e4ceb439728dacb79abd76)
2018-02-26Use start/finish app ops in window manager - frameworks native Svet Ganov
Add infrastructure to app ops to specify how to treat mode_default (for now only for startOp) allowing the caller to decide of this mode should be treated as success - this is useful if the caller already performed the default permission checks which determined that the caller would perform the operation if the mode is default. This way there is a record in the app ops history that this op was performed. This is now used by the window manager service which starts/finishes ops when an alert window is shown/hidden. The window manager allows adding the window if the mode is default but the caller has the fallback permission. In this case the alert window would be shown and we want that noted in the op history. Now the window manager properly starts/finishes alert window op when an alert window is shown/hidden. This is required to allow SystemUI to badge notifications from apps showing alert windows or add a dedicated notification if the app has no notifications. Test: cts-tradefed run cts-dev -m CtsWindowManagerDeviceTestCases Added android.server.wm.AppOpAlertWindowAppOpsTest cts-tradefed run cts-dev -m CtsPermissionTestCases -t android.permission.cts.AppOpsTest bug:64085448 Change-Id: I59658522bb521bb1e08009de046f52fef6f88687
2016-04-25Fix google-explicit-constructor warnings. Chih-Hung Hsieh
Bug: 28341362 Change-Id: I0ce850de85e0de6a5472dd142f738856142db9ec
2015-05-01Add body sensors app op - framework native Svetoslav
Change-Id: I727a2bb1e28ae9158f2df9c74dd0aee977dfd47f
2014-11-14Replace IInterface::asBinder() with a static Marco Nelissen
so we can do NULL checks again, and update calls to IInterface::asBinder() to use the new static version. Change-Id: Ia7b10eb38ca55b72278bfd33d3bf647f338b4e6a
2014-05-29binder: rm utils/Debug.h Mark Salyzyn
Change-Id: I16931919a26c16a0d701771c93fa7fe1c6f60ef8
2013-07-17Follow framework change to track started ops by proc. Dianne Hackborn
Change-Id: Ibbce3bf6556f45751c74bab045b46377e56bff9b
2013-02-19Fixes to native app ops services Eino-Ville Talvala
Bug: 8181262 Change-Id: I3d3f20453f6c6f2756c988363c5b5453ef309cb6
2013-02-12App ops: new native access API. Dianne Hackborn
This is to help implementation of bug #8181262 and maybe bug #8181261 Note the current code has not yet been tested; it is only known to compile at this point. Change-Id: I489674c96d0d3fc0ddacc92611931a19a9ee5230