Commit Graph

654870 Commits

Author SHA1 Message Date
lucaslin
07ca5cb00e Set underlying network of VCN
VCN has already known its underlying network, so set it into
NetworkCapabilities directly.

Bug: 191918368
Test: atest FrameworksVcnTests
Change-Id: Ibfe4f12bc5f3a8b7679d8a2c3b1b2f2161b9c9e5
2021-11-01 22:56:53 +08:00
Oscar Shu
5b4121cb00 Merge changes from topic "nearbyWifi"
* changes:
  Adding wifi nearby permission to DefaultPermissionGrantPolicy
  Add new wifi nearby devices app-ops
  New runtime permission NEARBY_WIFI_DEVICES
2021-10-25 18:33:37 +00:00
Rambo Wang
1c095d1456 Merge "Update javadoc of TM#getDataNetworkType to align with implementation" 2021-10-25 18:14:32 +00:00
Treehugger Robot
3d4a7e57fe Merge "Replaced BitUtils#maskedEquals hidden API call" 2021-10-25 17:45:14 +00:00
Etienne Ruffieux
b46a54d2e8 Replaced BitUtils#maskedEquals hidden API call
Added maskedEquals method to BluetoothLeUtils to prevent
hidden API usage.

Tag: #feature
bug: 200200870
Test: Manual
Change-Id: I7517cfef0b9e058e36d8d325f4a5ec653b1f804b
2021-10-25 17:41:44 +00:00
Treehugger Robot
379712430b Merge "Update display mode when setting mAlwaysRespectAppRequest" 2021-10-25 16:49:43 +00:00
Michael Groover
5ce00f02e8 Merge "Add a flag to export LOCKDOWN_RESET receiver in VpnManagerService" 2021-10-25 16:28:07 +00:00
Rahul Sabnis
a12c77ab44 Merge "Adding @SystemApi annotation to Bluetooth energy stats." 2021-10-25 16:21:35 +00:00
Snild Dolkow
a5f3ca1a06 Update display mode when setting mAlwaysRespectAppRequest
setShouldAlwaysRespectAppRequestedMode() is called from tests to make
DisplayModeDirector.getDesiredDisplayModeSpecs() to ignore non-app
votes. However, the set boolean will have no effect until something
triggers a call to that getter.

This caused MatchContentFrameRateTest#testMatchContentFramerate_Auto to
fail on devices with a lower-than-max peak_refresh_rate setting (or the
fallback resource config_defaultPeakRefreshRate): its setFrameRate()
call doesn't trigger a call to updateRefreshRateSettingLocked() or any
other vote update, so the lower peak value is still in effect in parts
of the system.

Notify the 'desired specs' listener when changing the bool will allow
the new mAlwaysRespectAppRequest value to properly take effect.

Any multi-refresh-rate device should be able to reproduce like so:

$ adb shell 'settings put system peak_refresh_rate 60'

On userdebug, you can overlay config_defaultPeakRefreshRate instead:

$ adb root
$ adb shell 'settings put system peak_refresh_rate ""' # remove setting
$ adb shell cmd overlay fabricate --target android \
      --name DefaultPeak60 \
      android:integer/config_defaultPeakRefreshRate 0x10 60
$ adb shell cmd overlay enable com.android.shell:DefaultPeak60
$ adb shell stop
$ adb shell start # so system_server loads the new resource value
$ adb shell cmd overlay lookup android \
      android:integer/config_defaultPeakRefreshRate # should output "60"

Bug: 204048977
Test: run cts -m CtsGraphicsTestCases -t android.graphics.cts.MatchContentFrameRateTest#testMatchContentFramerate_Auto
Change-Id: Ic6c2024ab1067ad7ba821190fe05009dac79b929
2021-10-25 16:40:44 +02:00
Chris Li
e563bef9fd Merge "Unregister configuration listener after the WindowProcessController was disallowed to be overridden." 2021-10-23 01:41:10 +00:00
Lucas Dupin
0f7d293cd8 Merge "Specify per-file owner for dimens_car.xml" 2021-10-22 15:16:52 +00:00
Yifan Hong
27c03c7f68 Merge "Add OWNERS for BatteryService" 2021-10-22 05:40:22 +00:00
bkchoi
a6d0be3d24 Specify per-file owner for dimens_car.xml
Bug: 202314754

Test: No need

Change-Id: If0042d64c55484ae361fc08e785e74c026247553
2021-10-21 22:40:58 +00:00
Etienne Ruffieux
d372361fe3 Adding @SystemApi annotation to Bluetooth energy stats.
Added @SystemApi annotation to BluetoothActivityEnergyInfo
and UidTraffic getters for mainline compatibility. Replaced
raw array by List. Deleted unused constructors.

Tag: #feature
Bug: 200201373
Test: Manual
Change-Id: Id93215f48bf08d31ac269af9e064cf598f50b6d3
2021-10-21 20:39:31 +00:00
xshu
0d889ae932 Adding wifi nearby permission to DefaultPermissionGrantPolicy
Grant this by default with the other nearby permission.

Bug: 197776854
Test: compiles
Change-Id: Iff1894a545889230c08578d8ae163116152ab28a
Merged-In: Iff1894a545889230c08578d8ae163116152ab28a
2021-10-21 17:42:18 +00:00
Bernardo Rufino
6a793fe262 Merge "Change out value type for Parcel::hasFileDescriptorsInRange()" 2021-10-21 10:13:15 +00:00
Lucas Lin
528c63e564 Merge "Set underlying networks into NetworkCapabilities directly" 2021-10-21 08:33:29 +00:00
Jing Ji
8787386e84 Merge "Fix potential race condition due to missing lock" 2021-10-20 23:58:28 +00:00
Treehugger Robot
b0914ffd45 Merge "Fix queryRawContactEntity api" 2021-10-20 20:25:15 +00:00
Jing Ji
7ee3a1fec3 Fix potential race condition due to missing lock
Bug: 194991626
Test: atest ProcStatsValidationTests
Test: atest ProcessStatsDumpsysTest
Test: CtsIncidentHostTestCases:ProcStatsProtoTest
Change-Id: I1dc7c03d031248fb945dc2cf9dd47ad590ec672c
Merged-In: I1dc7c03d031248fb945dc2cf9dd47ad590ec672c
2021-10-20 13:19:08 -07:00
Treehugger Robot
d51c3f3a2c Merge "AbsoluteVolume change custom call to official API" 2021-10-20 20:09:14 +00:00
Yifan Hong
99bc2d42a2 Add OWNERS for BatteryService
... to point to owners of health HAL. BatteryService
contains large usage of the health HAL.

Test: pass
Bug: 177269435
Change-Id: I38e7ec9e2ab25dec67ab674e9f169360f4690f1e
2021-10-20 12:53:53 -07:00
Treehugger Robot
c12df4f3b1 Merge "Add accessibility framework team to the owners for UiAutomation. Bug:159651900 Test: n/a" 2021-10-20 18:45:13 +00:00
Treehugger Robot
09b947cd02 Merge "Migrate Connectivity modules to use modules-utils" 2021-10-20 13:43:58 +00:00
Bernardo Rufino
68a6b0d1a3 Change out value type for Parcel::hasFileDescriptorsInRange()
Test: atest -d android.os.cts.ParcelTest
Change-Id: Idfcad04de35750d291f3351378e8420e5b890abf
2021-10-20 11:22:52 +01:00
Neil Fuller
5b274f5eef Merge "Add android.net tests to postsubmit" 2021-10-20 09:48:52 +00:00
Neil Fuller
8f15a06f5a Merge "Fix error prone warnings" 2021-10-20 09:35:44 +00:00
xshu
b4933d744e Add new wifi nearby devices app-ops
(cherry-picked from internal master)
This will be part of nearby devices permission group

Bug: 197776854
Test: compiles
Change-Id: I6002edfd951322d959cd8f4c7a06381badfd1660
Merged-In: I6002edfd951322d959cd8f4c7a06381badfd1660
2021-10-19 16:26:38 -07:00
xshu
a8395ffa3a New runtime permission NEARBY_WIFI_DEVICES
(cherry-picked from internal master)
This will be added to the nearby devices permission group.

Bug: 197776854
Test: compile
Change-Id: I3f827be6219b5bb1595744e20b316d2b968e022d
Merged-In: I3f827be6219b5bb1595744e20b316d2b968e022d
2021-10-19 13:25:55 -07:00
William Escande
5b4de494a0 Fix queryRawContactEntity api
Bug: 203535224
Tag: #refactor
Test: build
Change-Id: Id2e4be7a7985c47e81b6bafee5c35d0df3f33d8f
2021-10-19 21:21:48 +02:00
Treehugger Robot
f637a0d63d Merge changes I6d3584f3,Ifdaada39
* changes:
  Fix SntpClient 2036 issue (2/2)
  Fix SntpClient 2036 issue (1/2)
2021-10-19 18:58:55 +00:00
Neil Fuller
a0db5578fc Fix error prone warnings
Fix warnings introduced by previous commits and add @RunWith annotation
to new tests for consistency with existing tests.

Bug: 199481251
Test: Treehugger only
Change-Id: Iaec4caa80b15112bce84268adc6d763198f0ff61
2021-10-19 18:45:14 +01:00
Neil Fuller
c9bbe6b59e Fix SntpClient 2036 issue (2/2)
Fix issue with SntpClient after the end of NTP era 0 (2036).

This is the second of two commits. This commit makes the actual fixes
and makes tests pass.

Before this change SntpClient converted to Unix epoch times too eagerly.
NTP 64-bit timestamps are lossy: they only hold the number of seconds /
factions of seconds in the NTP era and the era is not transmitted. The
existing code assumed the era was always era 0, which ends in 2036.

As explained at https://www.eecis.udel.edu/~mills/y2k.html,
the lossiness of the type is not an issue providing that the maths is
implemented carefully: the NTP timestamps are only ever subtracted from
each other, are always assumed to be in the same or adjacent NTP eras,
and are used to calculate offsets that are applied to client Unix epoch
times.

This commit:

+ Switches to use a dedicated Timestamp64 type, avoiding the use
of the Unix epoch.
+ Switches to use a dedicated Duration64 type for holding the
32-bit signed difference between two Timestamp64 instances.
+ Simplifies the readTimeStamp() and writeTimeStamp() methods.
+ Adds missing validation covered by a TODO. The code was randomizing
the lower bits of the client transmit timestamp, but then not checking
the result as it should, presumably because it was difficult to know
what value was sent. Easily fixed with a dedicated type.
+ Stops randomizing the lower bits of various other timestamps
unnecessarily.
+ Fixes some naming to add clarity.

Bug: 199481251
Test: atest core/tests/coretests/src/android/net/sntp/Timestamp64Test.java
Test: atest core/tests/coretests/src/android/net/sntp/Duration64Test.java
Test: atest core/tests/coretests/src/android/net/SntpClientTest.java
Merged-In: I6d3584f318b0ef6ceab42bb88f20c73b0ad006cb
Change-Id: I6d3584f318b0ef6ceab42bb88f20c73b0ad006cb
2021-10-19 18:22:43 +01:00
Neil Fuller
f663ab4276 Fix SntpClient 2036 issue (1/2)
Fix issue with SntpClient after the end of NTP era 0 (2036).

This commit is 1/2. It makes some refactoring changes, lint fixes, adds
tests and introduces types that will be used in 2/2. Some of the added
tests fail and demonstrate the issue being fixed with the current
implementation.

-----

Failures that demonstrate the bug:

android.net.SntpClientTest#testRequestTime_era1ClientEra1Server

STACKTRACE:
junit.framework.AssertionFailedError: expected=5, actual=-4294967295995, allowedSlop=1
	at junit.framework.Assert.fail(Assert.java:50)
	at junit.framework.Assert.assertTrue(Assert.java:20)
	at android.net.SntpClientTest.assertNearlyEquals(SntpClientTest.java:502)
	at android.net.SntpClientTest.checkRequestTimeCalcs(SntpClientTest.java:215)
	at android.net.SntpClientTest.testRequestTime_era1ClientEra1Server(SntpClientTest.java:201)

android.net.SntpClientTest#testRequestTime_era0ClientEra1Server: FAILED (145ms)

STACKTRACE:
junit.framework.AssertionFailedError: expected=1139293696005, actual=-3155673599995, allowedSlop=1
	at junit.framework.Assert.fail(Assert.java:50)
	at junit.framework.Assert.assertTrue(Assert.java:20)
	at android.net.SntpClientTest.assertNearlyEquals(SntpClientTest.java:502)
	at android.net.SntpClientTest.checkRequestTimeCalcs(SntpClientTest.java:215)
	at android.net.SntpClientTest.testRequestTime_era0ClientEra1Server(SntpClientTest.java:174)

android.net.SntpClientTest#testNonMatchingOriginateTime: FAILED (116ms)

STACKTRACE:
junit.framework.AssertionFailedError
	at junit.framework.Assert.fail(Assert.java:48)
	at junit.framework.Assert.assertTrue(Assert.java:20)
	at junit.framework.Assert.assertFalse(Assert.java:34)
	at junit.framework.Assert.assertFalse(Assert.java:41)
	at android.net.SntpClientTest.testNonMatchingOriginateTime(SntpClientTest.java:384)

------

This commit:

+ Introduces a dedicated Timestamp64 type + test for holding NTP
timestamps.
+ Introduces a dedicated Duration64 type + test for holding the
32-bit signed difference between two Timestamp64 instances.
+ Fixes some naming to add clarity / addresses lint issues.
+ Adjusts tests

Tests are NOT expected to pass with just this commit. See 2/2.

Bug: 199481251
Test: atest core/tests/coretests/src/android/net/sntp/Timestamp64Test.java
Test: atest core/tests/coretests/src/android/net/sntp/Duration64Test.java
Test: atest core/tests/coretests/src/android/net/SntpClientTest.java
Merged-In: Ifdaada39298b05c48a3207fe6c0fad71c8a0a252
Change-Id: Ifdaada39298b05c48a3207fe6c0fad71c8a0a252
2021-10-19 18:22:16 +01:00
Ian Hua
bae244ddd1 Merge "Add nnapi_native flag namespace." 2021-10-19 15:53:21 +00:00
Neil Fuller
563ecfccb1 Add android.net tests to postsubmit
Add android.net tests to postsubmit. The tests / annotations will
be added in a separate commit.

Bug: 199481251
Test: Treehugger / inspection
Change-Id: I17cb464979535c767bbb8ee22fd7456ff08bae6c
2021-10-19 15:57:01 +01:00
Treehugger Robot
fdc344e6b6 Merge "Removed Bluetooh ScanFilter hidden API usage." 2021-10-19 14:41:30 +00:00
wescande
e312b160f4 AbsoluteVolume change custom call to official API
BT mainline effort to remove hidden api:
`avrcpSupportsAbsoluteVolume` only inform for a new volume behavior and
AudioManager already provide such method.

Bug: 190422401
Tag: #refactor
Test: Manual: Start bluetooth, play music and change volume from speaker/phone
Change-Id: I935df5e0f5632cd4144343bdb1bc2b9d7bc61c01
2021-10-19 14:32:50 +02:00
Jakub Pawlowski
10d9b01f61 Merge "settingslib/media: Add LeAudio support" 2021-10-19 05:19:37 +00:00
Jordan Liu
78a8259df5 Merge "Do not strip trailing F's of test ICCID" 2021-10-18 23:33:54 +00:00
Treehugger Robot
b20dc98bfa Merge "Add a method to get rawContact" 2021-10-18 22:14:39 +00:00
Treehugger Robot
e722500621 Merge "Removed BluetoothDevice#prepareToEnterProcess" 2021-10-18 21:37:57 +00:00
Ameer Armaly
187d8c7ac7 Add accessibility framework team to the owners for UiAutomation.
Bug:159651900
Test: n/a

Change-Id: I7d89bfc67f2077bca00a048d79f4b90792ed8c69
2021-10-18 20:18:14 +00:00
Jordan Liu
e1dd6a01de Do not strip trailing F's of test ICCID
Some OEMs use test SIMs which have ICCID=FFFFFFF... In this case we
don't strip trailing F's.

Bug: 199254579
Test: manual
Change-Id: I69b40fa75e59163e8c30be77cc38e908d6dd8cd4
2021-10-18 11:51:31 -07:00
Łukasz Rymanowski
9b07c89fd1 settingslib/media: Add LeAudio support
Bug: 150670922
Tag: #feature
Sponsor: jpawlowski@
Test: Manual
Change-Id: I4d4af980b1d41860b1d3fc7bf22aeb29e8615d41
2021-10-18 18:34:02 +00:00
Jonathan Scott
7593e112ae Merge "Centralise owners for Enterprise Platform team." 2021-10-18 18:31:04 +00:00
Jonathan Scott
7443751dd9 Centralise owners for Enterprise Platform team.
This will allow us to point other directories at these files for OWNERS
and make it easier to update after future team changes.

Test: N/A
Bug: 202714830
Change-Id: Iaaf5b8eb7568be4ebfd1b30abae0b757153f0391
2021-10-18 19:28:50 +01:00
Jakub Pawlowski
4fef608423 Merge "server/audio: Add LeAudio support" 2021-10-18 18:21:02 +00:00
Treehugger Robot
210da8ceef Merge "[Telephony] Add more javadoc for carrier privileges" 2021-10-18 17:47:42 +00:00
Zoey Chen
9b66398997 [Telephony] Add more javadoc for carrier privileges
Bug: 192252210
Change-Id: I9f43b7ba2e0184d48149a3496559a4be6d07cf6a
Merged-In: I9f43b7ba2e0184d48149a3496559a4be6d07cf6a
Test: manual
2021-10-18 16:22:57 +00:00