23 Commits

Author SHA1 Message Date
Alexander Dorokhine
610afe52c4 Unhide the storage attribution API with system visibility.
Bug: 179160886
Test: StorageStatsManagerLocalTest
Change-Id: I3a8994e215baff123df65d89d2d71b9e12de2af5
2021-05-10 15:59:31 -07:00
Andrei Onea
8168dc28be Remove non-updatable-* prefix from .txt files
The services/api/{current,removed,lint-baseline}.txt files used to
contain information for the merged system server stubs. Those files are
now created by the rules in api/Android.bp
('services-system-server-current.txt' and 'services-system-server-removed.txt').

Test: m checkapi
Bug: 177640454
Change-Id: I365be0a45126a6a056d5219e24ef93020c034c87
2021-04-30 13:27:48 +00:00
Muhammad Qureshi
ba6e2cf58e Create SystemApi for statsd ready broadcast
The statsd ready broadcast needs to be sent from statsd apex with
Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND flag that is @hide and cannot be
promoted to @SystemApi.
In R, this was worked around by getting the list of registered broadcast
receivers and sending them directed broadcasts to wake them up in
ag/10404099.
However, this is inefficient if there are multiple receivers so this
change creates a SystemApi for sending the actual broadcast with the
flag as recommended in ag/10404099 after it was submitted.

Bug: 150746848
Test: m
Test: flash
Test: ensure broadcast is received via logcat
CTS-Coverage-Bug: 184014462

Change-Id: I5103d8c6e87bdb47930cb7457731050da3d8e566
2021-03-30 00:50:23 -07:00
Bob Badour
1bf1c4a556 [LSC] Add LOCAL_LICENSE_KINDS to frameworks/base
Added SPDX-license-identifier-Apache-2.0 to:
  packages/SettingsLib/TwoTargetPreference/Android.bp
  services/api/Android.bp
  services/tests/servicestests/test-apps/PackageParsingTestManifests/Android.bp
  tests/FlickerTests/test-apps/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: I12b67c8466fbb1973d6b06f40b88d4e1e88e9a91
2021-03-19 04:22:12 -07:00
Sudheer Shanka
eba0108f38 Allow apps receiving onMediaButton() callback to start FGS from BG.
Bug: 174699413
Test: manual - verified that the app receiving onMediaButton()
      callback is able to start FGS only when the caller is in a
      state to start FGS.
CTS-Coverage-Bug: 174699413
Change-Id: I2dea43b79aa48fde83c6c3da2ad1454b29d60867
2021-03-13 02:25:28 +00:00
Andrei Onea
dcb5446b2b Add genrules for merged system server stubs
Re-land https://r.android.com/1596559 .

Bug: 177640454
Test: diff frameworks/base/services/api/current.txt \
out/soong/.intermediates/frameworks/base/api/services-system-server-current.txt/gen/system-server-current.txt

Merged-In: I021f59bb91572d28798a97ab8aa687b684599d6c
Change-Id: I5d5045f8d8f6b0ccdfb185582d1d4c4309937e6a
2021-03-10 16:52:28 +00:00
Bob Badour
354603079c [LSC] Add LOCAL_LICENSE_KINDS to frameworks/base
Added SPDX-license-identifier-Apache-2.0 to:
  services/api/Android.bp
  services/tests/servicestests/test-apps/PackageParsingTestManifests/Android.bp
  tests/FlickerTests/test-apps/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: I823e093d400903202e5535188639dddd1a1f78a9
Merged-in: I823e093d400903202e5535188639dddd1a1f78a9
2021-02-28 20:27:51 -08:00
Andrei Onea
43114704e6 Create non updatable system server stubs
Separate out stubs from non-updatable part of the system server. The
ultimate goal is to create system server stubs by merging the
non-updatable stubs and the per-module stubs, instead of generating them
from the combined sources.

Bug: 177640454
Test: m checkapi

Change-Id: Iecb9d51472ae238bbeabe65e1cd782b7c8a4ce59
2021-02-15 19:07:24 +00:00
Hai Zhang
0b4f1718f8 Move role into module.
These changes have to be in this CL together because:

- Code in service-permission depends on IRoleManager in
framework-permission, so the APIs in framework-permission and the code
in service-permission need to be moved together.

- The changes to service-permission build rules doesn't make sense
without the code moved in, so they have to be together as well.

Other details:

- framework-annotations: Several annotations are added into
framework-annoatations. Since the discussion with API council seems to
allow user IDs in system server in-process APIs, @UserIdInt and
@AppIdInt is added. @MainThread and @AnyThread is added since
@WorkerThread is already added. @CallSuper is added since @CheckResult
is also already added and they are similar in terms of category of
functionality.

- framework-permission-s-shared-srcs: 3 classes (and 2 AIDL files)
from framework is copied as shared source files and jarjared for
framework-permission, and an additional 3 is added for
service-permission as service-permission-shared-srcs. Similar to
framework-wifi and service-wifi, the 3 classes in framework-permission
is also available to service-permission by the stub library
framework-permission-pre-jarjar, and the other 3 classes used only for
service-permission is included separately to minimize our impact on
classes loaded into boot classpath. framework-permission and
service-permission shares the same jarjar rules to make sure the
classes remain available, and for the same reason framework-permission
cannot be shrank during any optimization.

- framework-permission-s-shared: A java_library target for
framework-permission-shared-srcs is created to make sure that the
public classes won't be counted as APIs, as it would be if directly
included as srcs for framework-permission
java_sdk_library. service-permission-shared is the same thing for
service-permission.

- framework-permission-s: A new java_sdk_library target created to be
loaded into bootclasspath by Android S+.

- Dumpsys Protobuf: The dumpsys protobuf
file (rolemanagerservice.proto) is moved into the module, and both the
platform (incident.proto) and the module uses protoc-gen-javastream to
generate the Java classes from it. This should be fine since it's a
"source level inclusion", and we jarjar the generated classes in our
module to avoid conflict with platform copies.

Bug: 158736025
Test: manual
Test: device boots, default apps can be changed successfully.
Change-Id: I1914774f631e51d0c587a7e527a1c9bc05ee1595
2021-01-24 12:55:16 -08:00
Hai Zhang
bd47187f71 Add LocalManagerRegistry inside system server.
This is similar to LocalServices, but dedicated to module API in the
same process.

Bug: 158736025
Test: presubmit
Change-Id: Ib9f14070a665ebd8c582376d7ea044d9b945b6b0
2021-01-22 07:51:53 -08:00
Jeff Sharkey
52b9862f87 Improve OWNERS coverage across frameworks/base/.
As general background, OWNERS files expedite code reviews by helping
code authors quickly find relevant reviewers, and they also ensure
that stakeholders are involved in code changes in their areas.

Some teams under frameworks/base/ have been using OWNERS files
successfully for many years, and we're ready to expand them to cover
more areas.  Here's the historical coverage statistics for the last
two years of changes before these new OWNERS changes land:

-- 56% of changes are fully covered by OWNERS
-- 17% of changes are partially covered by OWNERS
-- 25% of changes have no OWNERS coverage

Working closely with team leads, we've now identified clear OWNERS on
a per-package basis, and we're using "include" directives whenever
possible to to simplify future maintenance.  With this extensive
effort, we've now improved our coverage as follows:

-- 98% of changes are fully covered by OWNERS
-- 1% of changes are partially covered by OWNERS
-- 1% of changes have no OWNERS coverage

This specific change is automatically generated by a script that
identifies relevant "include" directives.

Bug: 174932174
Test: manual
Exempt-From-Owner-Approval: refactoring with team leads buy-in
Merged-In: I3480ddf2fe7ba3dfb922b459d4da01fa17a2c813
Change-Id: I3480ddf2fe7ba3dfb922b459d4da01fa17a2c813
2020-12-08 08:36:28 -07:00
Jeff Sharkey
061c2ec3b6 Improve OWNERS coverage across frameworks/base/.
As general background, OWNERS files expedite code reviews by helping
code authors quickly find relevant reviewers, and they also ensure
that stakeholders are involved in code changes in their areas.

Some teams under frameworks/base/ have been using OWNERS files
successfully for many years, and we're ready to expand them to cover
more areas.  Here's the historical coverage statistics for the last
two years of changes before these new OWNERS changes land:

-- 56% of changes are fully covered by OWNERS
-- 17% of changes are partially covered by OWNERS
-- 25% of changes have no OWNERS coverage

Working closely with team leads, we've now identified clear OWNERS on
a per-package basis, and we're using "include" directives whenever
possible to to simplify future maintenance.  With this extensive
effort, we've now improved our coverage as follows:

-- 98% of changes are fully covered by OWNERS
-- 1% of changes are partially covered by OWNERS
-- 1% of changes have no OWNERS coverage

This specific change begins defining top-level OWNERS lists,
including a general catch-all for string translations.

Bug: 174932174
Test: manual
Exempt-From-Owner-Approval: refactoring with team leads buy-in
Change-Id: Ie7ac3302d40a717fa048115cca2ea4359de64959
2020-12-08 08:36:27 -07:00
Hai Zhang
6e84285bcd DO NOT MERGE Implement suggested changes in API review for permission mainline.
Test: build
Fixes: 150877494
Change-Id: Ieca5f7a46241032f6722bb379fc08206b9600ddc
2020-03-05 14:07:10 -08:00
Felipe Leme
339b7149af Improved user callbacks on SystemService:
* Renamed:

  onStartUser() -> onUserStarting()
  onStopUser() -> onUserStopping()
  onSwitchUser() -> onUserSwitching()
  onUnlockUser() -> onUserUnlocking()
  onCleanupUser() -> onUserStopped()
  isSupportedUser() -> isUserSupported()

* Added:

  onUserUnlocked()

Tested on automotive, which uses the callbacks to dump user metrics:

$ adb shell dumpsys car_service --user-metrics
adb shell dumpsys car_service --user-metrics
* User Metrics *
  no users starting
  no users stopping
Last 10 started users
  2020-02-21T19:44:47.101 - user=0 start=2020-02-21 19:44:45.357 unlocking=+885ms unlocked=+1s122ms
  2020-02-21T19:44:56.376 - user=10 start=2020-02-21 19:44:47.380 switch=+209ms unlocking=+8s262ms unlocked=+8s994ms
  2020-02-21T20:00:08.792 - user=11 start=2020-02-21 20:00:04.634 switch(from 10)=+351ms unlocking=+4s44ms unlocked=+4s156ms
Last 10 stopped users
  2020-02-21T20:00:48.323 - user=10 stop=2020-02-21 20:00:16.741 shutdown=+31s581ms

Test: m update-api
Test: atest BackupManagerServiceTest
Test: manual verification (see above)
Fixes: 150001654

Exempt-From-Owner-Approval: approved on master right before rvc split

Merged-In: I8774c57620030b9aa8e7ec039a6a758ad56db368
Change-Id: I8774c57620030b9aa8e7ec039a6a758ad56db368
(cherry picked from commit 58e7458ac7204992c5408eb2d6420d767afc4eb8)
2020-02-24 16:44:52 +00:00
Roshan Pius
ea33fb9ab8 SupplicantManager: Expose an API to start/stop supplicant daemon
Bug: 149923078
Test: Compiles
Change-Id: Ic7027f0d18abee2ea1c9e48700c706954d54773a
2020-02-20 14:03:17 -08:00
Anton Hansson
6a2973a075 Merge "Allow com.android.* classes in system_service stubs" 2020-02-20 10:41:03 +00:00
Hai Zhang
5ce0b1adcb Rename permission APIs.
According to lint warnings.

Bug: 136503238
Fixes: 149818284
Test: presubmit
Change-Id: I83e9ac9b65e307bb47d305003ce7adcd2b9c4049
2020-02-19 11:09:01 -08:00
Anton Hansson
f74130f525 Allow com.android.* classes in system_service stubs
The android.* rule is meant to be for the public SDK.

Bug: 147559833
Test: m checkapi
Change-Id: I8b36cf7a4ff569d0b960455de09ed40592dd5a9e
2020-02-19 18:29:12 +00:00
Anton Hansson
daa9d88444 Enable compat checking & lint for system_services api
These were previously turned off as there were no previous
releases to compare it to. Check in empty files as comparison.

Whitelist current lint problems for now (filed bugs to follow-up).

Bug: 149818061
Bug: 149818284
Bug: 147559833
Test: m checkapi
Change-Id: Ib4cbc84ac9a826f7b947c951c94f8f5578f4554d
2020-02-19 12:03:04 +00:00
Hai Zhang
47c1de2ff8 Move roles persistence into APEX.
Bug: 136503238
Test: presubmit
Change-Id: Id11842ad7653317d5f0ebf2df0f4c315d0018440
2020-01-17 19:05:57 -08:00
Hai Zhang
76f0defebf Move runtime permissions persistence into APEX.
Bug: 136503238
Test: presubmit
Change-Id: Id016d8c111ceadd27dc318c256b2f32ff0380f60
2020-01-17 19:05:48 -08:00
Makoto Onuki
bf03b1b0b3 Expose SystemService as @SystemApi for mainline modules
Test: build / treehugger (annotation change only)
Bug: 146145144
Change-Id: I41b4d56dce06034730e8b3e70c2ca3fab8cc3456
2020-01-15 11:16:19 -08:00
Jiyong Park
13c923d00a Add API signature files for the system server APIs
... so that they can be reviewed.

Bug: 140202860
Test: m
Change-Id: Iec8cdd30ad5e4979d56140a8c00a85af6476f67f
2019-12-24 00:22:36 +09:00