Commit Graph

16088 Commits

Author SHA1 Message Date
Xiangyu/Malcolm Chen
cb47d86158 Merge "Add HomeVisibilityObserver APIs in ActivityManager." 2020-02-11 21:00:16 +00:00
Treehugger Robot
05fb4434f3 Merge "Add TEST_MAPPING for gating and logging" 2020-02-10 21:12:10 +00:00
Andrei Onea
1a0195349b Add TEST_MAPPING for gating and logging
The tests included are unit tests for the implementation (under
FrameworksServicesTests), for the corresponding TestRule
(PlatformCompatGating) and CTS tests.

Bug: 137821288
Test: cd frameworks/base/core/java/android/app/compat && atest
Test: cd frameworks/base/services/core/java/com/android/server/compat \
          && atest
Change-Id: I1a652775715f1a9738cc72725303bc78dfa17d03
2020-02-10 18:25:06 +00:00
Andrei-Valentin Onea
45d1f67bf6 Merge "Clear callingId before binder calls in CompatChanges" 2020-02-10 16:13:13 +00:00
Andrei Onea
01ba3215fa Clear callingId before binder calls in CompatChanges
Since this was already a recurring pattern when using PlatformCompat
directly, clear calling id before binder calls in CompatChanges.

Bug: 149091690
Test: atest CtsAppCompatHostTestCases
Change-Id: I4eec315eba14b840f9ef222b81b624d8e4f201eb
2020-02-07 19:19:20 +00:00
Ivailo Karamanolev
3e376b79ce Add LightsManager implementation to LightsService
Includes backend code to support LightsManager binder calls and route
them to the HALs.

Bug: 144979010
Bug: 144978691
Bug: 142715294
Change-Id: I0080972620ba7a3fb1197cdd0288287d3cfa8780
Fix: 142230898
Test: atest LightsManagerTest
Test: atest LightsServiceTest
Merged-In: I2db7f2caa432cd1e2389ea5ca6544200ada18675
2020-02-07 02:11:18 +01:00
Andrei-Valentin Onea
54036c0525 Merge "Add CompatChanges API." 2020-02-06 17:31:15 +00:00
atrost
8a3cd58882 Add CompatChanges API.
This wraps our existing APIs for isChangeEnabled, and is exposed for
mainline modules to use.
Also upgrading PlatformCompatChangeRule to androidx to match with
frameworks coretests.

Test: http://aosp/1203413
Test: atest android.app.compat.CompatChangesTest
Test: atest com.android.tests.gating.PlatformCompatGatingTest
Bug: 142650523
Change-Id: I12b9436c2ea955e9b74228f150b872d6eb3a1081
2020-02-06 14:42:31 +00:00
Neil Fuller
c0d59e39d7 More renames for API council
Renames PhoneTime[|Zone]Suggestion to TelephonyTime[|Zone]Suggestion.
Makes changes to generally avoid PHONE and use SLOT_INDEX or telephony
as appropriate for the usage. Removes telephony / phone from a few
variable names where it doesn't add value.

This commit also renames some remaining phoneId instances to slotIndex
which were missed when that rename happened.

Bug: 148842434
Test: treehugger
Change-Id: I4302e68082b802b75b53c02a9c9b1ae39dff6085
2020-02-06 08:41:26 +00:00
Malcolm Chen
7521f33c8a Add HomeVisibilityObserver APIs in ActivityManager.
The new API will be @System which is used by Telephony stk app to
monitor foreground activity change.

Bug: 144351078
Test: manual with a test app that registers HomeVisibilityObserver
and monitor its callback.
Change-Id: I2f250cdd53a667b2d89e84e589b0ae0bc94a8aa3
Merged-In: I2f250cdd53a667b2d89e84e589b0ae0bc94a8aa3
2020-02-05 23:32:22 +00:00
Neil Fuller
4222b7bec8 Remove System APIs not required for R
Test: treehugger
Bug: 148842434
Merged-In: If022a726a058a90cb5446d220628c76800da8e96
Change-Id: If022a726a058a90cb5446d220628c76800da8e96
2020-02-04 21:21:34 +00:00
Anton Hansson
9bf0c496df Merge "Do not use @SystemApi(client = MODULE_APPS) (documents/settings)" 2020-02-03 22:29:37 +00:00
Makoto Onuki
4056d87005 Do not use @SystemApi(client = MODULE_APPS) (documents/settings)
There will be no special protection mechanisms around MODULE_APPS,
so we're going to remove it for now.

All the MODULE_APPS should be protected with a permission, etc, so
the change should be safe.

Bug: 148177503
Test: Build / treehugger
Change-Id: I76328c2d5aaa3f171bf8afde5b3d1accad8c2e2b
Merged-In: I76328c2d5aaa3f171bf8afde5b3d1accad8c2e2b
2020-02-03 20:37:22 +00:00
Neil Fuller
6aef6673df Merge "API docs tidy up" 2020-02-03 17:48:03 +00:00
Treehugger Robot
55d16fac97 Merge "Minor refactor of ChangeReporter and PlatformCompat" 2020-02-03 12:37:48 +00:00
Neil Fuller
fb23c3ea2e API docs tidy up
Based on feedback from API council.

Bug: 148402959
Bug: 148402200
Test: treehugger only
Change-Id: I273ced8ec61dd72d8fd290b976ecfe1e613a1941
2020-02-03 12:17:27 +00:00
Neil Fuller
4e540a1c59 Merge "Rename phoneId to slotIndex" 2020-02-03 11:55:39 +00:00
Neil Fuller
d8da3387c4 Rename phoneId to slotIndex
Rename phoneId to slotIndex. Some of the classes are being put in an API
surface and phoneId is an internal concept. slotIndex is its replacement
and should be identical.

Bug: 148403082
Test: treehugger build only
Change-Id: Iecbf347c9d13877f2e3f74b6daa22661bade257a
2020-01-31 17:06:33 +00:00
Andrei Onea
1220afbd75 Minor refactor of ChangeReporter and PlatformCompat
Move all StatsLog generated constants into ChangeReporter, to make
re-submitting http://ag/10194708 easier.

Bug: 145952197
Test: atest PlatformCompatTest ChangeReporterTest
Change-Id: Iccff9582099c58f070a6b6aeb1d2588b0fafa90a
2020-01-31 14:30:28 +00:00
Remi NGUYEN VAN
6674b930fd Merge "Do not block for connector in TetheringManager" 2020-01-29 23:46:00 +00:00
Treehugger Robot
402674f2a0 Merge "Rename ZoneInfoDB -> ZoneInfoDb" 2020-01-29 14:00:45 +00:00
Remi NGUYEN VAN
24b7b6a047 Do not block for connector in TetheringManager
Instead of blocking for the ITetheringConnector, in the rare case (only
on boot) that the connector is not ready, queue requests and poll for
the connector until it is available.

Bug: 146821053
Test: Flashed, verified tethering working
Change-Id: I4bd45fcbdce2336694c3b6a349f121e40230f001
2020-01-29 15:15:58 +09:00
Neil Fuller
f14b18e153 Rename ZoneInfoDB -> ZoneInfoDb
Rename ZoneInfoDB -> ZoneInfoDb to conform with coding standards.

Bug: 148086409
Test: treehugger
Change-Id: I2a5eca6bd013d3ca2ba93aabf36745f8873fc6fb
2020-01-28 13:49:48 +00:00
Neil Fuller
ad6eb2b2d5 Extract TimeDetector/TimeZoneDetector interfaces
Extract TimeDetector/TimeZoneDetectors interfaces due to API council
feedback.

Bug: 148402378
Test: treehugger
Change-Id: I22b12c8c5cc1cca9e3a788ef76c38b77198a3bce
2020-01-28 12:18:46 +00:00
Benedict Wong
50b444359e Add VpnManger API surface
This change adds the VpnManager, which will be used by apps to install
profiles for all platform VPN types (currently only IKEv2).

Bug: 143325939
Test: Compiles, FrameworksNetTests passing.
Change-Id: I57f854d0a5b18358f3541c24ca0cd8aed03fd7a1
2020-01-22 19:24:24 -08:00
Cody Kesting
9cd249c11a Merge changes from topic "connectivity-diagnostics-system-server"
* changes:
  Add ConnectivityDiagnosticsManager to System Server.
  Make DataStallReport Parcelable.
  Make ConnectivityReport Parcelable.
2020-01-23 01:56:33 +00:00
Benedict Wong
d040b254c5 Add new appop for Platform VPNs
This change introduces a new appop, ACTIVATE_PLATFORM_VPN, that is a
subset of the ACTIVATE_VPN appop. VPN apps that have been granted the
more dangerous ACTIVATE_VPN appop should be allowed to use platform
VPNs, as they are more restricted, and safer. However, the opposite
must not be true.

Bug: 144246835
Test: Compiles, FrameworksNetTests passing
Change-Id: I609e87e688432f957751058b09f350fa641753d7
Merged-In: I609e87e688432f957751058b09f350fa641753d7
2020-01-22 04:30:23 +00:00
Cody Kesting
b125776009 Add ConnectivityDiagnosticsManager to System Server.
ConnectivityDiagnosticsManager should be accessed through
Context#getService. In order for this to be possible, it needs to be
defined as a service inside SystemServiceRegistry.

Bug: 146444622
Test: compiles.
Test: CTS testing in aosp/1211164
Change-Id: I6fe29441ecc9967a04ceb394b3bbe54830bef079
2020-01-21 08:31:56 -08:00
Hall Liu
f3b914bd02 Merge "Expose NotificationChannel#setBlockableSystem as SystemApi" 2020-01-17 20:25:50 +00:00
Hall Liu
b12609a432 Expose NotificationChannel#setBlockableSystem as SystemApi
Expose setBlockableSystem as a module-apps-only SystemApi.

Bug: 138401571
Test: atest android.app.cts.NotificationChannelTest
Change-Id: I0b6a14360e9278a092476ada6533e63a46d4e4fe
Merged-In: I0b6a14360e9278a092476ada6533e63a46d4e4fe
2020-01-16 17:43:10 -08:00
Treehugger Robot
e88817bd42 Merge changes Ie816e0c6,I5b94e92a,I5391ac49,If074bed1
* changes:
  DO NOT MERGE Fix AppOpsServiceTest
  DO NOT MERGE Don't throw exception in AppOpsManager.checkOp
  DO NOT MERGE Remove unnecessary internal APIs.
  DO NOT MERGE SetMode: Don't call into PM with AppOps lock held
2020-01-15 19:01:15 +00:00
Neil Fuller
e9dafe541e Merge "Expose time / time zone system apis for telephony" 2020-01-15 16:19:16 +00:00
Treehugger Robot
d63ebcf807 Merge "DevicePolicyManager: annotate SystemApi" 2020-01-15 06:37:55 +00:00
Neil Fuller
efe063e5dc Expose time / time zone system apis for telephony
Expose system apis / permissions needed by the telephony module to
communicate with the system server for time and time zone detection.

There are also small improvements for @Nullable.

Bug: 147012511
Test: build only
Merged-In: I27e5aa4c594d5fbad0b6f043afb9e910dcba4349
Change-Id: I27e5aa4c594d5fbad0b6f043afb9e910dcba4349
(cherry picked from commit 2be7ac4531)
2020-01-14 19:30:40 +00:00
Remi NGUYEN VAN
fe1ce1e047 Add NETWORK_STACK_SERVICE to SystemServiceRegistry
The service is already registered in ServiceManager. It needs to be
accessible from SystemServiceRegistry so that other mainline modules
can communicate with it.

Bug: 147255753
Test: Dependent CLs using the service
Change-Id: I940c62064466c3b3b8d2a195b810e90eaade7e6c
Merged-In: I940c62064466c3b3b8d2a195b810e90eaade7e6c
2020-01-14 02:17:54 +00:00
Philip P. Moltmann
01883f3d02 DO NOT MERGE Remove unnecessary internal APIs.
Test: Built
Bug: 146463528
Bug: 146590200
Change-Id: I5391ac4989d7d5712982f5608f9fc28cf7935b00
2020-01-13 12:41:17 -08:00
junyulai
80831d2ff3 [SP03] support registerNetworkStatsProvider API
This change provides an API that allow external modules to
register a custom provider of NetworkStats to merge the
network statistics that cannot be seen by the kernel to system.

Test: atest FrameworksNetTests CtsUsageStatsTestCases
Test: atest NetworkPolicyManagerServiceTest
Test: m doc-comment-check-docs
Bug: 130855321

Change-Id: I265bc637c40666cde505fde5056d2d9bfc5fb204
2020-01-13 14:43:03 +08:00
junyulai
232b2edcfb [SP03.1] Replace com.android.internal.util.Preconditions.checkNotNull
Extracted from ag/9990011 to make NetworkStatsManager sync with internal
line, given that it is missing in aosp/1198084.

Bug: 126528330

Test: Treehugger
Change-Id: I77f50326869799f51d4636cb7c6d7c97daf531e6
Merged-In: I42117ebfb640e3b0b133183e5e146860bed8471a
2020-01-13 14:42:37 +08:00
Neil Fuller
641fa6730a Merge "Rename android.util.TimestampedValue to android.os" 2020-01-10 08:11:14 +00:00
Neil Fuller
35cc296228 Rename android.util.TimestampedValue to android.os
Rename android.util.TimestampedValue to android.os to avoid dependency
from android.util onto android.os, which is disallowed by lint.

Bug: 147012511
Test: boot
Merged-In: I4b84db03c8ad24bbef63e45d6d15fb306a10364e
Change-Id: I4b84db03c8ad24bbef63e45d6d15fb306a10364e
(cherry picked from commit d159015e54)
2020-01-09 15:34:43 +00:00
Artur Satayev
d9b11b058c Use new UnsupportedAppUsage annotation.
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
Merged-In: I8789f8499d4dca08580672e9e45ed9a7026dd686
2020-01-09 13:56:05 +00:00
Hall Liu
f428f58080 Merge "Add setDisabledForSimNetworkLock to StatusBarManager" 2020-01-08 20:54:48 +00:00
Neil Fuller
48247d9223 Merge "Change NetworkTimeUpdateServiceImpl behavior" 2020-01-07 10:07:08 +00:00
Hall Liu
2ada7fbac2 Merge "Clean up SmsApplication and expose getDefaultSmsPackage" 2020-01-07 00:36:51 +00:00
Hall Liu
9ded659a50 Add setDisabledForSimNetworkLock to StatusBarManager
Add a new @SystemApi disable utility method to allow telephony's
mainline module to disable the status bar when the device is SIM-locked

Bug: 146834818
Bug: 138956541
Test: atest StatusBarManagerTest
Change-Id: Id3757fc560c5b70bed553f19b050524a024b4c78
2020-01-06 15:47:45 -08:00
Neil Fuller
62ace8c46a Merge "Add new permissions" 2020-01-06 19:38:25 +00:00
Justin Yun
1ef374f98b Use ro.product.vndk.version for unbundled product apks
Instead of using "ro.product.apps.unbundled", use
"ro.product.vndk.version" to determine if product apks are unbundled.
"ro.product.vndk.version" will be defined by
PRODUCT_PRODUCT_VNDK_VERSION. If it is defined, all product apks must
be unbundled.

Bug: 144534640
Bug: 127738095
Bug: 128557860
Test: boot and check logs if product apps are loaded successfully
Change-Id: I6d0f7c20e131dfe12203c63a14e6254a8223893b
2020-01-02 06:30:02 +00:00
Hall Liu
35c243caa4 Clean up SmsApplication and expose getDefaultSmsPackage
- Clean up usages of hidden AppOpsManager APIs in SmsApplication
- Add unit tests for SmsApplication
- Expose RoleManager#getDefaultSmsPackage for use in SmsApplication.

Bug: 146834818
Test: atest SmsApplicationTest
Change-Id: I4ab49d7f6274389e7de7cd7223cab3c433936044
2019-12-31 14:41:02 -08:00
Neil Fuller
4ab8a199de Change NetworkTimeUpdateServiceImpl behavior
This change moves some logic associated with time detection out of the
NetworkTimeUpdateServiceImpl and moves it to the TimeDetectorStrategy
called by the TimeDetectorService.

The TimeDetectorStategy implementation now decides when to use an
NTP-derived time instead. The logic implemented here is effectively the
same as it was: NITZ takes priority over NTP until the latest NITZ
signal becomes "too old".

The motivating reasons for the change:
1) The "what signal is used when several are available?" logic should be
in one place: the TimeDetectoryStrategy not scattered around the
platform. Centralizing will enable different strategies and time sources
to be introduced over time.

2) It will allow removal of the ACTION_NETWORK_SET_TIME intent in a
follow-up commit; this intent was used to coordinate the NTP vs NITZ
logic should no longer be required.

The "bonus" effect of this change is that NetworkTimeUpdateServiceImpl
becomes more general: It can now be the authority for the NTP time on a
device independently of how the system clock should be set. e.g. it
could be used in future to back the
AlarmManager.currentNetworkTimeMillis() API call.  Anything that needs a
"what is the best time according to NTP?" answer could use this service.

Note: The NetworkTimeUpdateServiceImpl still observes the AUTO_TIME
setting and will perform an NTP lookup "on demand" (if required) when
the user enables the setting. This should be a temporary state and
likely to be removed in future; knowledge of AUTO_TIME shouldn't be
required for the NTP info to be correct and if
NetworkTimeUpdateServiceImpl is doing the right thing.

Bug: 140712361
Test: atest com.android.server.timedetector
Test: atest android.app.timedetector
Change-Id: I4b2936a42c552c4dd4cb55010306bb81bca0c712
2019-12-19 19:21:47 +00:00
markchien
6d06f6d51a [Tether13] Move TetheringManager into framework
Move tethering out of ConnectivityService. All client would
use TetheringManager to talk with TetheringService directly.

Bug: 144320246
Test: -build, flash, boot
      -atest TetheringTests

Change-Id: Ib051bea724a256f9c4572b566e46ae7b9c4abe6e
Merged-In: Ib051bea724a256f9c4572b566e46ae7b9c4abe6e
2019-12-19 20:53:06 +08:00