Commit Graph

10613 Commits

Author SHA1 Message Date
mattgilbride
d8323e8684 Make getCallingUidOrThrow() not throw in clearCallingIdentity() blocks
The new method hasExplicitIdentity will track whether the caller is
within a Binder.clearCallingIdentity/restoreCallingIdentity block based
on packing this state information into the token returned by clearCallingIdentity.

Bug: b/252975769
Test: android.os.cts.BinderTest
Change-Id: I162db933f9e52cd6f9f46796bda11ad6216d3d66
2022-11-21 20:24:28 +00:00
Nikita Ioffe
4fa14ea225 Merge "Add Process.isIsolatedUid(int uid) API" 2022-11-16 16:58:19 +00:00
Parth Sane
60bcab9367 Merge "Add TRACE_TAG_AIDL to SystemApi for mainline modules" 2022-11-15 13:03:21 +00:00
Vikram Gaur
81a458a73c ServiceManager APIs for Remote Key Provisioning mainline module.
ServiceManager.getDeclaredInstances is needed for Remote Key
Provisioning mainline module to get all the implementations for
IRemotelyProvisionedComponent.

Test: build + usage in Remote Key Provisioning mainline module.
Change-Id: I92545104fa9bc190fe7c2f84b33d5f8693fcc2a4
2022-11-11 22:46:33 +00:00
Peter Kalauskas
66e5f1dac2 Merge "Log wtf for warn-on-blocking on eng builds" 2022-11-10 18:47:39 +00:00
Parth Sane
1eb9a2e634 Add TRACE_TAG_AIDL to SystemApi for mainline modules
Test: manual

Change-Id: I76de5146f49256884e2de88dcb42789365e5d081
Bug: 236441443
2022-11-10 15:37:52 +00:00
Bill Yi
0de01a9871 Merge TP1A.221105.002 to aosp-master - DO NOT MERGE
Merged-In: I7caa2e966bae2ec146ca77b36d2a467d746e2531
Merged-In: I361e8838571ab7b3f19778833b820f0b1b584d94
Merged-In: I361e8838571ab7b3f19778833b820f0b1b584d94

Change-Id: Ic9224a1948b26c8703a272aa3b26337e0586f3e3
2022-11-09 06:33:42 +00:00
Treehugger Robot
1bd897f545 Merge "Remove permissions team from PermissionEnforcer OWNERS" 2022-11-07 15:14:46 +00:00
Treehugger Robot
47050bb8b6 Merge "Unify binder txn trace name" 2022-11-04 15:31:23 +00:00
Peter Kalauskas
b3cedbba88 Log wtf for warn-on-blocking on eng builds
Log.wtf on eng builds when setWarnOnBlocking is enabled. Previously,
setWarnOnBlocking would only log a WTF on userdebug builds.

Bug: 32715088
Test: Manual
Change-Id: Iab416c58827db558d21e518c09af1dac1569ebe8
2022-11-03 14:00:25 -07:00
Hai Zhang
2ba6452ffc Remove permissions team from PermissionEnforcer OWNERS
Our team didn't implement and isn't intended to be the owner of this.

Change-Id: I7dd17d41c930fd3d1e5771e7779cb2e9927c9c43
Test: presubmit
2022-11-02 23:37:43 +00:00
Thiébaud Weksteen
4f2bc9a73a Merge changes I72f810a7,I2bd23f62
* changes:
  Add OWNER entry for android.os.PermissionEnforcer
  Add PermissionEnforcer class
2022-11-02 23:03:07 +00:00
Zim
762a8b305a Unify binder txn trace name
To match cpp aidl trace name for easier perfetto parsing

Test: Manual
Bug: 161393989
Change-Id: I21d788c8de27327bd3f64da2e8cf14e6fcf9d073
2022-11-02 10:33:45 +00:00
Gil Cukierman
6c70a328e5 Merge changes from topic "cukie-2genterprise-user-restriction"
* changes:
  Add TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_USER_RESTRICTION
  Add DISALLOW_CELLULAR_2G As a New User Restriction
2022-11-01 13:51:58 +00:00
Treehugger Robot
0c35c51d71 Merge "Parcel: noop upon double recycle" 2022-11-01 10:15:54 +00:00
Steven Moreland
2681cb2d92 Merge "Parcelable: getStability in system API" 2022-10-31 17:39:56 +00:00
Gil Cukierman
a247dae4d4 Add DISALLOW_CELLULAR_2G As a New User Restriction
Bug: 247121216
Test: atest UserRestrictionsTest
Change-Id: I9be85ae7a9bfb3f287ea972bbaac35469e8d772b
2022-10-31 13:25:51 +00:00
Ian Elliott
9e7649d5e7 Merge changes from topic "UpstreamAngleSwitch"
* changes:
  Add 2 ANGLE deferlist settings
  Can switch to legacy GLES driver when ANGLE is system driver
2022-10-28 03:55:27 +00:00
Steven Moreland
558ba131f9 Parcelable: getStability in system API
Requirement to use stable AIDL parcelables in priv-apps.

Bug: 254476191
Test: aidl_integration_test, build target added which uses this
Change-Id: Ib2434e5566bf8bd804f76cf1e63ec1df0e904d77
2022-10-28 00:32:53 +00:00
Steven Moreland
08b17a98a8 Merge changes I7315059b,If2dd13d8
* changes:
  Binder: don't call getCallingUid for RPC calls
  Parcel: lift 'isForRpc' here from native
2022-10-27 20:56:19 +00:00
Jintao Zhu
64ff38669a Parcel: noop upon double recycle
Fix this scenario:

  Parcel p = Parcel.obtain();
  p.recycle();
  p.recycle(); // illegal but possible

  Parcel p1 = Parcel.obtain();
  Parcel p2 = Parcel.obtain();

  ASSERT_TRUE(p1 != p2); // fail!

Signed-off-by: Jintao Zhu <zhu.jintao@gm.com>

Change-Id: Ied25188549801122874a05c2e66969e1f281b346
2022-10-27 21:55:16 +08:00
Thiébaud Weksteen
0e318f1938 Add OWNER entry for android.os.PermissionEnforcer
Bug: 241171714
Bug: 243724362
Test: Gerrit OWNERS validation plugin
Change-Id: I72f810a75ebee3813fc7ad87f8187a0ebc135bc7
2022-10-27 13:21:37 +11:00
Thiébaud Weksteen
ec0d763059 Add PermissionEnforcer class
Defines a new PermissionEnforcer class used to check permission as part
of the @EnforcePermission AIDL annotation. It is registered as a system
service to avoid the cost of creating a new object for each new client.

Bug: 234083358
Test: TH
Change-Id: I2bd23f62a0d207ddac6bbe69666ced96e77ba16f
Merged-In: I2bd23f62a0d207ddac6bbe69666ced96e77ba16f
2022-10-27 12:12:11 +11:00
Ian Elliott
1cf20cd849 Can switch to legacy GLES driver when ANGLE is system driver
Change the sense of the run-time switches so that ANGLE can be an
optional GLES driver or the default system GLES driver.  When ANGLE is
the system GLES driver, also handle the case of there being no legacy
GLES driver.

Test: logcat
Test: atest CtsAngleIntegrationHostTestCases
Test: atest CtsEffectTestCases:android.effect.cts.EffectTest#test5_effectCreate
Bug: 224558229
Change-Id: Ie53f5221d51b62db226c0c634537959612a06655
Merged-In: Ie53f5221d51b62db226c0c634537959612a06655
2022-10-26 18:04:25 -06:00
Steven Moreland
e72e27929f Merge "markVintfStability for priv-apps" 2022-10-26 19:55:38 +00:00
Steven Moreland
04a6a74682 markVintfStability for priv-apps
Any AIDL interface that has @VintfStabilty should be
able to be used everywhere.

Bug: 254476191
Test: aidl_integration_test
Change-Id: I3138a6e4dbfdfb972d87e7c4eb9b591be40b6d39
2022-10-26 16:33:48 +00:00
Steven Moreland
b95831cbd9 Binder: don't call getCallingUid for RPC calls
All the code using getCallingUid here should be
ripped out anyway because it's Java-centric. Here
are some of the issues with the current stuff around
here:
- it's broken because it won't handle things happening in
  native code
- it's slow (e.g. big transactions are already logged in
  native code anyway)

Bug: 254835230
Test: boots, atest MicrodroidTestApp (with new tests)
Change-Id: I7315059bff138966e9509f1d529a6417466d2b7f
2022-10-26 01:21:38 +00:00
Steven Moreland
b6663f9d82 Parcel: lift 'isForRpc' here from native
Platform API, in order to fix bugs like b/254835230 where
certain utilities call getCallingUid, which doesn't make
sense for RPC calls.

Bug: 254835230
Test: android.os.ParcelTest
Change-Id: If2dd13d8edd515c945ccde2a2554f6f2b7b87b26
2022-10-26 01:21:38 +00:00
Jooyung Han
2f0d179958 add ServiceManager.getUpdatableNames()
Bug: 254201177
Test: m
Change-Id: I6921263e1f99c735c322a030d54ccc09a995563e
2022-10-26 09:41:05 +09:00
Sergey Nikolaienkov
b03d346354 Update core/java/android/os/storage/OWNERS
Bug: -
Test: not really...
Change-Id: I71ef824d0f1bbc80ece29fc1915ba327f2436752
2022-10-21 08:26:40 +02:00
Zimuzo Ezeozue
f31dc9a61b Merge "Populate binder trace txn names lazily" 2022-10-19 17:09:25 +00:00
Zimuzo Ezeozue
da1c78d158 Merge "Skip tracing missing binder txn names" 2022-10-19 17:08:23 +00:00
Zimuzo Ezeozue
e75a6f8696 Merge changes from topic "aidl_trace"
* changes:
  Clean up binder txn tracking special case
  Enable binder txn tracing more broadly
2022-10-19 17:08:05 +00:00
Lais Andrade
ba35aa1ebf Update Vibrator documentation for support check methods.
Update documentation for methods areAllEffectsSupported and areAllPrimitivesSupported to explain the default behavior for empty queries. The behavior remains unchanged.

Change-Id: I23dd792af7e3ee2c70fec136fb7db4965a7195be
Fix: 237509304
Test: N/A
2022-10-17 12:37:30 +00:00
Zim
b0d5d53fdf Populate binder trace txn names lazily
Previously, for each binder interface, we populated a cache of all
txn codes to names on the first binder txn to that interface. This
skewed the binder txn latency significantly for the first txn to an
interface.

Now, we lazily populate the cache on each new binder txn.

Test: atest open-prebuilt-calculator --rebuild-module-info
--tf-template metric_post_processor=
google/template/postprocessors/metric-file-aggregate.xml
(neglible startup time diff locally)
Bug: 246650647

Change-Id: Ib569ebe34e7ef6bb4fa6e53defedcb33ed824308
Merged-In: Ib569ebe34e7ef6bb4fa6e53defedcb33ed824308
2022-10-14 19:36:17 +01:00
Zim
b7cdc3b1d1 Skip tracing missing binder txn names
This works around b/156126072 which introduces app startup latencies
that are multiplied with binder txn tracing enabled.

Skiping tracing interfaces without binder txn names avoids tracing
interfaces like ContentProviders and app-defined interfaces. This is
still an improvement on the status quo since we still trace the
auto-generated framework interfaces.

When we fix sporadic binder calls in the app-startup critical path, we
can remove the restriction and enable tracing more broadly.

Note that we still keep the old behavior of 'best effort' trace names
when binder call stack sampling tracing is enabled

Test: Manual
Bug: 246650647
Change-Id: Id04b701f97241cbd5d14bbb368fdd8527b6f8c93
2022-10-14 19:33:04 +01:00
Zim
ab23aee04d Clean up binder txn tracking special case
Previously, binder txns were only traced for txns from sysui/launcher
to system_server.

ag/Iffc4bb534d239c07d2e4d43ab43a9ed76abe7496 enabled binder txn tracking
more broadly

Removed the special case for sysui/launcher and cleaned up the code

Test: Manual
Bug: 161393989
Change-Id: I9d46d2362ca0ca33bc2477d68092f7ba5fe9c8ac
Merged-In: I9d46d2362ca0ca33bc2477d68092f7ba5fe9c8ac
2022-10-14 19:30:37 +01:00
Zim
1b71f6b3d0 Enable binder txn tracing more broadly
Previously, binder txns were only traced for txns from sysui/launcher
to system_server.

aosp/I57857443495475b1d2efa82cbcb448af5d37a79a and
aosp/I01d520afa8e26eabb97318192151b707b002c28b enabled aidl tracing
if aidl#gen_trace or aidl#generate_traces respectively is true.

Guarded tracing on the availability of txn names instead

Test: Manual
Bug: 161393989
Change-Id: Iffc4bb534d239c07d2e4d43ab43a9ed76abe7496
Merged-In: Iffc4bb534d239c07d2e4d43ab43a9ed76abe7496
2022-10-14 19:30:08 +01:00
Steven Moreland
31075f2951 Merge "Parcel: more stacks printed when recycle twice." 2022-09-29 20:48:15 +00:00
Steven Moreland
cdb5f00ecb Parcel: more stacks printed when recycle twice.
We can print the second stack by default.

Bug: 243768096
Test: N/A
Change-Id: I49d4e72f87c15fc04ddf94a19ff8f76512b6ebbc
2022-09-29 01:00:47 +00:00
Nikita Ioffe
e50e1a2035 Add Process.isIsolatedUid(int uid) API
Test: atest ProcessTest
Bug: 222718282
Change-Id: I9e3dc700636ac7723d1807b6c173c9f4fb693c53
2022-09-27 21:03:39 +01:00
Juan Yescas
7afbbec42f Add new field in MemoryInfo to get advertised memory size.
This API will get the advertised memory size from the bootloader parameter
passed to the kernel. The advertised memory size might be different from
the MemTotal value in /proc/meminfo. This could be due the original design
manufacturer (ODM) reserved part of the memory for the Trusted Execution
Environment.

Test: Run test caes
Bug: 231718727
Change-Id: I06494cb9013048d73a83f2180a9241c2259d46eb
2022-09-27 15:11:52 +00:00
Juan Yescas
71e11ae9ba Add method to parse the size in FileUtils
The method parseSize() will parse the strings that match
the regular expression:

  "^((\\s*[-+]?[0-9]+)\\s*(B|K|KB|M|MB|G|GB|Ki|KiB|Mi|MiB|Gi|GiB)\\s*)$"

For example: 12GB, +100MB, 23MiB.

It will return the size in bytes.

Test: atest
Bug: 231718727
Change-Id: Id4b9084d2ff8a0a8bd23ddb8a7e10dcf17391c49
2022-09-27 15:11:05 +00:00
Neil Fuller
d272f786c2 Clarify method names and improve debug
Change LocationTime.getTime() -> getUnixEpochMillis() for clarity.
Add LocationTime.toString() to improve log messages involving
LocationTime.

Test: build only
Bug: 236611620
Change-Id: I6f33bec6288c67e18a2008a735e88a8981186183
2022-09-16 09:03:00 +00:00
Hani Kazmi
1aae720772 Update BaseBundle to not use LazyValues when using ReadWriteHelper
This is a partial backport of ag/19532036. It fixes a bug where a
LazyValue might have been pointing to a parcel which was already
recycled.

Bug: 240138318
Test: atest android.os.cts.ParcelTest android.os.cts.BundleTest
android.os.BundleTest android.os.ParcelTest
android.os.BundleRecylingTest
Test: Running PoC app from linked bug

Change-Id: I3acf7127fdf373ee8b38a55702ae315be499601c
Merged-In: I8a878a6d0055b04b2611909b4b17977ba5677a4f
(cherry picked from commit d2f9cc6342)
Merged-In: I3acf7127fdf373ee8b38a55702ae315be499601c
2022-09-14 17:52:29 +00:00
Lais Andrade
55217bc20b Remove VibrationEffect javadocs to methods not available in public APIs.
Change-Id: Idf5a339a5fb0ffd510e7fda0e3784916c8505eae
Merged-In: Idf5a339a5fb0ffd510e7fda0e3784916c8505eae
Fix: 245491186
Test: N/A
2022-09-12 12:21:16 +00:00
Treehugger Robot
cac091cedb Merge "change the format" 2022-09-08 21:31:23 +00:00
Xiaozhen Lin
ce5a2ae1b0 change the format
use "file:" instead of "include"

Test: N/A
Change-Id: I7db7abba49b117f782b557926d06fa858223185b
2022-09-07 22:42:57 +00:00
Treehugger Robot
724eea8b2e Merge "Update OWNERS file for Multiuser." 2022-09-05 10:55:36 +00:00
Miguel Aranda
ace6c8c76e Merge "Enable StrictMode checks for explicit garbageCollection from T." 2022-08-31 15:18:22 +00:00