Commit Graph

120285 Commits

Author SHA1 Message Date
Remi NGUYEN VAN
a1bef5bbc2 Do not query CS in NetworkProvider constructor
ConnectivityService may not be available in a NetworkProvider
constructor, if it is created (but still unused) before
ConnectivityService starts.

As ConnectivityManager is only necessary in
declareNetworkRequestUnfulfillable, which should not be called often,
just query ConnectivityManager at that point.

This is necessary for VcnManagementService, which is started before
ConnectivityService and creates its NetworkProvider in its constructor.
Fortunately VcnManagementService does not call
declareNetworkRequestUnfulfillable at this point.

ConnectivityManager may be migrated to classic service getters that
cache "null" when the service was not available the first time it is
queried, so no system service must query it before it starts.

Bug: 171540887
Test: atest FrameworksNetTests:NetworkProviderTest
Change-Id: I8dadcd0e1360a9464192f330493e13aa69dd9fe2
2020-11-30 12:42:15 +09:00
Treehugger Robot
a421f8ff53 Merge "Make ChangeReporter.{Status,Source} proper enums" 2020-11-26 13:37:45 +00:00
Treehugger Robot
97c2606bbd Merge "ParcelableHolder shouldn't write anything for empty case" 2020-11-26 02:39:54 +00:00
Treehugger Robot
27310f0340 Merge "Clarify why it's safe to add java.library.path to the classloader namespace." 2020-11-26 00:40:01 +00:00
Andrei Onea
10fb2bcd15 Make ChangeReporter.{Status,Source} proper enums
They mistakenly were tagged as flags, which is not applicable for either
of them.

Test: m
Bug: 174237593
Change-Id: I982ddc53839f13255ea68c9852fd20c3fe5a8433
2020-11-25 17:30:23 +00:00
Neil Fuller
1395dffdb1 Make manual suggestions synchronous/return result
Modify the suggestManual...() methods on TimeDetector and
TimeZoneDetector to be synchronous, and have them return true/false to
indicate if the call "succeeded". This is being done before adding more
calls that will be used by apps like SettingsUI; generally all calls
that are user facing and could conceivably fail should return
success/failure information and therefore need to happen synchronously.

Test: atest services/tests/servicestests/src/com/android/server/timedetector/
Test: atest services/tests/servicestests/src/com/android/server/timezonedetector/
Bug: 140712361
Merged-In: I5b6b7fb5af2ffe88392b2ca8d1e8fff2a187521b
Change-Id: I5b6b7fb5af2ffe88392b2ca8d1e8fff2a187521b
2020-11-25 09:57:07 +00:00
Jeongik Cha
3f5ffa615a ParcelableHolder shouldn't write anything for empty case
If neither Parcel nor Parcelable exists, ParcelableHolder'd better
write nothing like NDK and C++ backend.

In the case of empty ParcelableHolder
As-is(Java):
 4 -> Size
 -1 -> Existence(empty string)

To-be(NDK, C++ now):
 0 -> Size

Test: atest CtsNdkBinderTestCases
Bug: 173682663
Change-Id: I816108fdc59170ea7408f0633295ba978f1ef9d5
2020-11-24 22:44:42 +09:00
junyulai
e2dfbb3b65 Expose getTx/RxBytes in TrafficStats
Test: atest FrameworksNetTests TrafficStatsTest
      atest android.net.cts android.net.wifi.cts
Bug: 164965653
Change-Id: I17b9d0bc2404c5727d4c4530ad941439b7b71a54
2020-11-24 12:11:08 +08:00
Bram Bonné
6d7e4c43d6 Merge "Adds two missing Keymaster definitions." 2020-11-23 13:02:03 +00:00
Treehugger Robot
00326a8902 Merge "Update UntaggedSocketViolation StrictMode message to reference TrafficStats.setThreadStatsTag instead of the erroneous TrafficStats.setThreadSocketTag." 2020-11-21 00:42:47 +00:00
Martin Stjernholm
6e258a9c8b Clarify why it's safe to add java.library.path to the classloader
namespace.

Test: N/A - comment change only
Change-Id: I9ae485afc4b6b827c09bb7d65c3987eefd433492
2020-11-20 18:52:14 +00:00
Chiachang Wang
1b414d61b4 Merge changes from topic "move_BSCH"
* changes:
  Remove BasicShellCommandHandler from frameworks/base
  Move BasicShellCommandHandler to frameworks/lib/modules-utils
2020-11-20 07:29:56 +00:00
Benedict Wong
4833cf6910 Merge "Expose MIN_MTU_V6 as a public, @hide constant" 2020-11-20 01:30:18 +00:00
Benedict Wong
da498a524d Merge changes I72976905,I7a637d39
* changes:
  Add VcnTunnel, UnderlyingNetworkTracker skeletons
  Add bug number to stopship comment for VCN Network scores
2020-11-19 22:01:24 +00:00
Sarah Chin
9e7ff9a167 Merge "Clarify documentation on TEMP_NOT_METERED API" 2020-11-19 17:50:35 +00:00
Lorenzo Colitti
cbd6dbc553 Merge changes I3711b362,I49421183,Icc0701cb,I2f5ccc1d
* changes:
  Increase test coverage for VPN info sent to NetworkStatsService.
  Simplify MockVpn.
  Test a VPN with an underlying network that does not yet exist.
  Minor fixes to NetworkCapabilities#toString.
2020-11-19 10:20:00 +00:00
Sarah Chin
296eec4947 Clarify documentation on TEMP_NOT_METERED API
Test: build
Bug: 165337240
Change-Id: Ifc0843b529e7a205b0e1caf98420adfc377c28e7
2020-11-19 01:15:48 -08:00
Bram Bonné
b60861b281 Adds two missing Keymaster definitions.
Adds KM_TAG_BOOT_PATCHLEVEL and KM_TAG_VENDOR_PATCHLEVEL.

Bug: 173681969
Test: atest KeyAttestationTest
Change-Id: I4e94376241b37fd57c183e7865ae99a4770658c9
2020-11-19 10:15:02 +01:00
Benedict Wong
ac1921adce Expose MIN_MTU_V6 as a public, @hide constant
MIN_MTU_V6 is increasingly used, and the LinkProperties version is used
as a source of truth for the constant.

Bug: 163602123
Test: atest FrameworksNetTests
Change-Id: I67134cd4fb7e2cf59c36947b62f681ac9b94ea4a
2020-11-19 00:21:53 -08:00
Benedict Wong
4f040fb77d Add VcnTunnel, UnderlyingNetworkTracker skeletons
This change adds skeletons for each of the various major components used
in the VCN.

Additionally, this change adds the VcnGatewayConnectionConfig, used to
configure each logical connection to the VCN gateway. Each
VcnGatewayConnectionConfig specifies a Network that can be brought up on
demand for a given telephony service (INTERNET, MMS, DUN, etc)

Bug: 163602123
Bug: 163432852
Test: Skeletons only, no major testable pieces
Change-Id: I7297690573c1b6ebd0ab9c1d434dd45c1e7d841d
2020-11-19 00:07:35 -08:00
Chiachang Wang
a68fbfafb7 Remove BasicShellCommandHandler from frameworks/base
BasicShellCommandHandler is used by mainline modules and the
framwork. There is a new repo that was created for putting
this kind of utility class. Remove BasicShellCommandHandler
from frameworks/base to frameworks/lib/modules-utils.

Bug: 170598012
Test: m
Change-Id: I81e01ba097392e8fe6eb27c01212a8fa1e4cbfad
Merged-In: Ida30c877116090616d4bf3f87fdad835446dac84
2020-11-19 05:32:14 +00:00
Chiachang Wang
d5726c1916 Move BasicShellCommandHandler to frameworks/lib/modules-utils
BasicShellCommandHandler is used by mainline modules and the
framwork. There is a new repo that was created for putting
this kind of utility class. Move BasicShellCommandHandler for
the incoming ConnectivityService mainline and updating the
related usage.

Bug: 170598012
Test: m ; verify with adb shell cmd
Change-Id: I8a2873df6e7d8342b7a8b466bda155f74c807ee3
Merged-In: Ida30c877116090616d4bf3f87fdad835446dac84
2020-11-19 03:16:03 +00:00
Treehugger Robot
6bf6e05d47 Merge "Add UWB AIDL" 2020-11-19 00:34:03 +00:00
Alexander Zlatin
739620f26f Update UntaggedSocketViolation StrictMode message to reference TrafficStats.setThreadStatsTag instead of the erroneous TrafficStats.setThreadSocketTag.
Bug: 143923100

Change-Id: I1a4f75d7e3fff538d418a956b8eead79bc0b3e55
2020-11-18 23:23:50 +00:00
Songchun Fan
84c340e6ab [DeviceConfig] add schfan to OWNERS
Test: N/A
Change-Id: I851d3925fa328d06f8165f9da9b367221b734fac
2020-11-18 23:12:02 +00:00
Treehugger Robot
6f7c5e0914 Merge "Migrate CALLBACK_ON_CLEAR_CHANGE" 2020-11-18 09:19:29 +00:00
Treehugger Robot
3724bc6c47 Merge "Migrate THROW_SECURITY_EXCEPTIONS" 2020-11-18 09:19:11 +00:00
Paul Hu
c5ec644861 Merge "Expose BroadcastOptions#setMaxManifestReceiverApiLevel as system API" 2020-11-18 08:35:15 +00:00
Lorenzo Colitti
945b512d4d Minor fixes to NetworkCapabilities#toString.
1. The current code only prints the array of administrator UIDs
   if it's empty. This is clearly an oversight. Print it only if
   it's non-empty.
2. Only print requestor UID and package name if they are set.
   This makes output shorter in the common case that they are
   unset.
3. Reorder the output at the end: group all UIDs together, and
   place SSID and private DNS broken bit after that.
4. Make the private DNS broken indication a single word instead
   of a sentence. This saves space and makes it easier to write
   regexps.

New format:
... SignalStrength: -72 OwnerUid: 1000 AdminUids: [1000] SSID: ...
... Uid: 1000 RequestorUid: 1000 RequestorPkg: android ...

Test: manual
Change-Id: I2f5ccc1d9e4af6ddacc4d193185a17723822972b
2020-11-18 17:10:11 +09:00
Treehugger Robot
5bc68e02a0 Merge changes Ifcb0f60e,I09ecdff9
* changes:
  Nfc adapter randomly returns null on devices having Nfc
  Improve NfcAdapter APIs to report correct nfc state
2020-11-18 03:06:55 +00:00
Treehugger Robot
62b028daca Merge "Fixed Handler Leak on RecyclerView" 2020-11-17 20:17:44 +00:00
Brian Stack
06ed05563c Add UWB AIDL
Adds the UWB AIDL interface used to communicate with the UWB Service

Bug: 170323306
Test: atest UwbManagerTests

Change-Id: I746a5b7c453a54cc3c8c34dc356d8165df20c739
2020-11-17 10:37:07 -08:00
paulhu
030fd23caa Expose BroadcastOptions#setMaxManifestReceiverApiLevel as system API
Connectivity service is going to become a mainline module which
will not able to access hidden APIs. But it needs
BroadcastOptions#setMaxManifestReceiverApiLevel to restrict the
receiving of CONNECTIVITY_ACTION intent. Thus, expose it as a
system API to support the usage.

Bug: 170593746
Test: atest FrameworksNetTests
Test: atest CtsNetApi23TestCases
Test: atest KeyChainTests
Change-Id: Ic45552174c3f9e74141db4495bb99a582000b574
Merged-In: Ic45552174c3f9e74141db4495bb99a582000b574
2020-11-17 16:10:26 +00:00
Benedict Wong
03492715e8 Merge "Add stubs for VCN configuration management" 2020-11-17 02:17:21 +00:00
Treehugger Robot
aeb15e8592 Merge changes I9731d978,I9e325782,I441a4d4d,I86a85e48,I9268fd66, ...
* changes:
  Keystore 2.0 SPI: Install legacy Keystore provider as AndroidKeyStoreLegacy
  Keystore 2.0 SPI: Zygote install Keystore2 provider conditionally
  Keystore 2.0 SPI: Evolve the generator SPI.
  Keystore 2.0 SPI: Evolve Factory SPI
  Keystore 2.0 SPI: AndroidKeyStoreProvider loads keys from Keystore 2.0
  Keystore 2.0 SPI: Evolve the Crypto SPI.
  Keystore 2.0 SPI: KeyParameter utilities.
  Keystore 2.0 SPI: Update the chunked streamer.
  Keystore 2.0 SPI: KeyStoreCryptoOperationUtils
  Keystore 2.0 SPI: KeyStoreKeys adopt Keystore 2.0
  Keystore 2.0: Shim around the basic functionality of Keystore 2.0
  Keystore 2.0 SPI: Duplicate Keystore SPI to android.security.keystore2 package
2020-11-16 22:51:03 +00:00
Benedict Wong
4b140e2bd6 Add stubs for VCN configuration management
This change adds stubs for both the API and the internal binder
interfaces.

Bug: 163431877
Test: Compiles, boots
Change-Id: I11183d9fe3ad53944882b163eee5110e85898393
2020-11-16 13:29:34 -08:00
Aurimas Liutikas
e1bb600fc7 Merge "Remove legacy style metalava suppression" 2020-11-16 17:40:07 +00:00
Janis Danisevskis
6180e85e36 Keystore 2.0 SPI: Zygote install Keystore2 provider conditionally
This patch makes Zygote install the Keystore 2.0 SPI as
"AndroidKeyStore" and the old Keystore SPI as "AndroidKeyStoreLegacy"
if the platform property ro.android.security.keystore2.enable is
set to true. This allows us to boot Android with vital components, such
as LockSettingsService, still using the legacy Keystore, while we run
CTS tests against the new implementation, migrate other system
components, and perform migration tests.

This CL will be superseded by a CL that makes Zygote install the
Keystore 2.0 SPI exclusively when the migration of all dependent
components is complete.

Bug: 171305684
Test: None
Change-Id: I9e32578285167c4d63f4f536a07fe98473a883e0
2020-11-13 19:55:41 -08:00
Inseob Kim
56ab231a8f Remove obsolete property ro.kernel.android.tracing
Bug: 173179120
Test: build
Change-Id: If46e65dac70ab4f1835048dbbcc8b571ce598224
2020-11-13 19:39:02 +09:00
Jack Yu
3217255a4d Nfc adapter randomly returns null on devices having Nfc
Try to get NfcAdapter from NfcManager only when nfc service interface is
ready.

Bug: 173184157
Test: manaul test
Change-Id: Ifcb0f60e23f01cafd8b6b5f6bc8522773ece23a6
2020-11-13 18:34:42 +08:00
Patrick Baumann
2288e2adff Remove pi.append_native_lib_paths property
This change removes the "pi.append_native_lib_paths" property added as a kill switch for a feature that has been out in the wild now for several releases now.

Change-Id: I21f9d158f60d0cf47e3631bb37ece711b3450494
Merged-In: I21f9d158f60d0cf47e3631bb37ece711b3450494
Fixes: 173103133
(cherry picked from commit 22efaa8422)
2020-11-13 13:27:59 +09:00
Aurimas Liutikas
bdd6c53abb Merge "Suppress all hidden abstract methods in constructable classes." 2020-11-13 02:56:37 +00:00
Aurimas Liutikas
d23189b998 Suppress all hidden abstract methods in constructable classes.
Having a hidden abstract method for a class that can be extended
means that public implementors cannot implement these hidden methods
posing a risk that custom implementations will not have required
abstract methods resulting in an exception.

Bug: 151134792
Test: make update-api
Change-Id: I758d12465fabc671be19bedeeceb16885de23c87
Merged-In: I758d12465fabc671be19bedeeceb16885de23c87
Exempt-From-Owner-Approval: large scale suppression of existing issues,
    no-op in terms of behavior
2020-11-13 02:56:20 +00:00
Aurimas Liutikas
46a165215b Remove legacy style metalava suppression
@SuppressLint("Doclava125") is a legacy way of suppressing
RequiresPermission check. Updating to the new style of suppression
so metalava no longer has to support the legacy mode.

sed -i "s/@SuppressLint(\"Doclava125/@SuppressLint(\"RequiresPermission/" \
core/java/android/app/admin/DevicePolicyManager.java \
core/java/android/hardware/hdmi/HdmiControlManager.java \
core/java/android/hardware/location/ContextHubManager.java \
core/java/android/hardware/usb/UsbDeviceConnection.java \
core/java/android/net/TrafficStats.java \
core/java/android/os/RecoverySystem.java \
core/java/android/os/storage/StorageManager.java \
core/java/android/service/persistentdata/PersistentDataBlockManager.java \
location/java/android/location/LocationManager.java \
media/java/android/media/AudioManager.java \
telecomm/java/android/telecom/TelecomManager.java \
telephony/java/android/telephony/CarrierConfigManager.java \
telephony/java/android/telephony/TelephonyManager.java \
wifi/java/android/net/wifi/RttManager.java \
wifi/java/android/net/wifi/WifiScanner.java

Test: make
Exempt-From-Owner-Approval: No-op change
Merged-In: I6d5df95cfca2950ea86872d2f0afc1ba828841dc
Change-Id: I6d5df95cfca2950ea86872d2f0afc1ba828841dc
2020-11-12 18:30:12 -08:00
Andrei-Valentin Onea
714960f745 Merge "Migrate FILTER_APPLICATION_QUERY" 2020-11-12 13:09:53 +00:00
Junyu Lai
02bd168520 Merge changes I6a48d4db,I6741c41c,Ifec6bde5,Icd0717c5
* changes:
  Remove unused variables
  Return offloaded traffic when querying from TrafficStats API
  Add hardware tethering traffic in testTethering test
  Remove unused getTetherStats
2020-11-12 08:45:15 +00:00
junyulai
e5d0585e2c Return offloaded traffic when querying from TrafficStats API
TrafficStats API are being used for querying realtime network
statistics for years. However, on certain devices, some network
traffic are produced by hardware components and not be
able to seen by kernel counters.

Thus, include statistics for those missing network traffic is
necessary. Note that the included statistics might be stale
since polling newest stats from hardware might impact system
health and not suitable for TrafficStats API use cases.

Test: atest FrameworksNetTests TetheringTests
Bug: 16229221

Change-Id: I6741c41cb5145ca8748f9b083b9c15e7e2735681
2020-11-12 14:22:31 +08:00
Jack Yu
cb2a677767 Improve NfcAdapter APIs to report correct nfc state
For enable and disable and state checking APIs, retry once if we found
nfc service is dead.

Bug: 173077348
Test: manual tests
Change-Id: I09ecdff9b0b7071569a854e7ace42a46b62a464f
2020-11-12 12:07:38 +08:00
Treehugger Robot
412a12977c Merge "Remove UWB RangingParams" 2020-11-12 02:37:44 +00:00
Tobias Thierer
37ef4e0be3 Merge "Fix malformed OWNERS." 2020-11-11 20:46:18 +00:00