654832 Commits

Author SHA1 Message Date
Patrick Baumann
8255f5f4c0 Consolidating PM owner definition and adding new owners.
Change-Id: If4b080755701452c53d55f26380e887dc3944dbf
2021-10-19 21:06:56 +00: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
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
Treehugger Robot
fdc344e6b6 Merge "Removed Bluetooh ScanFilter hidden API usage." 2021-10-19 14:41:30 +00: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
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
Trevor Radcliffe
106fa79deb Merge "Migrate LockTaskTests to Soong" 2021-10-18 16:13:22 +00:00
Trevor Radcliffe
770099002a Merge "Migrate DynamicCodeLoggerIntegrationTests to Soong" 2021-10-18 16:12:52 +00:00
Grzegorz Kołodziejczyk
ad46dc5b5e server/audio: Add LeAudio support
This patch adds handling active device and set volume

Bug: 150670922
Tag: #feature
Sponsor: jpawlowski@
Test: Manual
Change-Id: I50a966ed2f199464381ff561fd83342b0a9b08a9
2021-10-18 14:32:45 +00:00
Treehugger Robot
f822fdf129 Merge "Fix Configuration.diff documentation." 2021-10-18 02:27:58 +00:00
Jakub Pawlowski
3e6f16c19f Merge "server/audio: Add Le audio messages to MESSAGE_MUTE_MUSIC" 2021-10-16 10:35:36 +00:00
Sudheer Shanka
37e891fce1 Merge "Fix an issue in NPMS blockedReasons computation logic." 2021-10-15 22:53:37 +00:00
Sudheer Shanka
0ca63ddebd Fix an issue in NPMS blockedReasons computation logic.
If an app does not have the permission to access network
in Restricted mode, we should be removing
ALLOWED_REASON_RESTRICTED_MODE_PERMISSIONS from the uid's
allowedReasons but right now, we end up removing all the
allowedReasons except ALLOWED_REASON_RESTRICTED_MODE_PERMISSIONS
and this could result in sending wrong network state to apps.

Bug: 202213533
Test: atest tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
Change-Id: Ibcae147bf4ba84ff91ef7038ffef8c33082b82ca
Merged-In: Ibcae147bf4ba84ff91ef7038ffef8c33082b82ca
(cherry picked from commit 259414efbc207e5e8c4299f39a3c48580e3221df)
2021-10-15 14:03:06 -07:00
Guojing Yuan
1678f07605 Merge "Add OWNERS for services/companion" 2021-10-15 19:41:09 +00:00
Hui Wang
1465700c00 Merge "Update the BroadcastQueue logic for runtime permissions" 2021-10-15 16:48:15 +00:00
Kai Shi
fb799763d1 Merge "Bug fix: LCE list initialization" 2021-10-15 16:17:03 +00:00
Etienne Ruffieux
e8f2077fee Removed BluetoothDevice#prepareToEnterProcess
Tag: #feature
Bug: 200202780
Test: manual
Change-Id: I8d4be1da1bcb5b819c324f1a3a89c7dc317c31d6
2021-10-15 14:41:32 +00:00
Łukasz Rymanowski
3be9944e1f server/audio: Add Le audio messages to MESSAGE_MUTE_MUSIC
Bug: 150670922
Tag: #feature
Sponsor: jpawlowski@
Test: compile
Change-Id: Iaf41085d13a5b249f6ba3e6705e8a42234ace330
2021-10-15 13:41:09 +00:00
William Escande
e44b464866 Add a method to get rawContact
This remove the leak of hidden private field and add an api to get
entreprise raw contact
Bug: 194119078
Test: Build
Tag: #refactor

Change-Id: I9285cd54545e1359a4a7f57826ddb1a0e1dcdfbe
2021-10-15 13:33:52 +02:00
Jakub Pawlowski
ba8a56e93d Merge "settingslib/bluetooth: Add LeAudio support" 2021-10-15 09:55:05 +00:00
Alan Stokes
31a3297733 Merge "Update OWNERS" 2021-10-15 09:38:00 +00:00
Treehugger Robot
41e10b86d8 Merge "Move set member pair handle from settingLib to setting" 2021-10-15 07:56:18 +00:00
Łukasz Rymanowski
c0aa3b3276 settingslib/bluetooth: Add LeAudio support
Bug: 150670922
Tag: #feature
Sponsor: jpawlowski@
Test: Manual
Merged-In: I45402a6d315d8ccc2bc756bdc9937e81eea3c58a
Change-Id: I45402a6d315d8ccc2bc756bdc9937e81eea3c58a
2021-10-15 07:07:10 +00:00
Alice Kuo
423e648a82 Move set member pair handle from settingLib to setting
Remove createBond from settingLib. SystemUI and Setting have the
individual settingLib instance. If we trigger pairing inside settingLib,
the action would be called twice.

Bug: 201758444
Bug: 150670922
Test: Pair the coordinated set devices, and check the set member pairing
would be done automatically without the pairing dialog

Change-Id: I289b8af857530f0fb207b777d09d94549cfdf553
2021-10-15 13:15:08 +08:00
Ashwini Oruganti
88d4dea9a0 Update the BroadcastQueue logic for runtime permissions
Previously, we were skipping a broadcast when either the permission or
the app op was granted. However, for runtime permissions to be
considered "granted" both the permission and the app op need to be
granted. This change updates taking this into account.

Test: manual
Bug: 202436287
Bug: 183537857
Change-Id: I9f12f9e17e61246d723d18ead93c6115bbf6d5cf
2021-10-15 01:22:06 +00:00
Elliott Hughes
f2ab01c09e Merge "Fix NPE in BootReceiver.addTombstoneToDropBox." 2021-10-14 22:40:00 +00:00
Guojing Yuan
e34abb6e48 Add OWNERS for services/companion
Change-Id: Iaef71cf1c01b2ca625431bcbfa2faf5a20c18e89
2021-10-14 21:19:34 +00:00
Trevor Radcliffe
d9a9509ab3 Migrate LockTaskTests to Soong
Fixes: 203118260
Test: Confirmed apks are installed as expected
Test: Treehugger
Change-Id: I764c788330da5c1597566ec723b31b7443c51eaf
2021-10-14 20:13:05 +00:00
Christian Wailes
59e9a53f60 Merge "Updated OWNERS file" 2021-10-14 18:57:32 +00:00
Kai Shi
7180cca70d Bug fix: LCE list initialization
Initialize LCE list so that its size is at least 1. This is important for 1st call back after registration especially when there is no LCE report yet.

Bug: 198682652
Test: atest -c TelephonyCallbackTest in airplane mode.
Change-Id: I54b4ce0c51e6c10c6ef67776cf3083a04b7d5da3
Merged-In: I54b4ce0c51e6c10c6ef67776cf3083a04b7d5da3
2021-10-14 18:34:27 +00:00
Steven Moreland
b146c8bedb Merge "getBlobAshmemSize -> getOpenAshmemSize" 2021-10-14 17:43:16 +00:00
Hao Ke
d6f306117a Merge "Add “@throws BadParcelableException” to the JavaDoc of new API methods that throw the exception." 2021-10-14 17:30:43 +00:00
Treehugger Robot
214a74b728 Merge "Partial revert "Wait for unlock to start jobs."" 2021-10-14 16:43:16 +00:00
Trevor Radcliffe
93a5458bb0 Migrate DynamicCodeLoggerIntegrationTests to Soong
Also migrates related dependencies, and needed to make a small code
change to make it work.

Fixes: 202986197
Test: Ran the tests
Test: Treehugger
Change-Id: Ie30ca52200b93d4f7bff9f60ceb0ba95d052b5c8
2021-10-14 16:30:21 +00:00
Hao Ke
f98489f1c0 Add “@throws BadParcelableException” to the JavaDoc of new API methods that throw the exception.
Test: atest -d android.os.cts.ParcelTest
Bug: b/203004511
Change-Id: I24bf7314e63015d46ab478ec8c44ecf22857bac2
2021-10-14 15:31:37 +00:00
Alan Stokes
66749427da Update OWNERS
As discussed.

Test: N/A
Change-Id: I56beaeff1e492fb1a2a674647f310552df346744
2021-10-14 14:20:50 +01:00
Neil Fuller
c3c74384e2 Merge "Attempt 2 for adding OWNERS for SNTP code" 2021-10-14 12:37:09 +00:00
Neil Fuller
3725e9c638 Attempt 2 for adding OWNERS for SNTP code
Commit e5ad1297165888eb5eef24c1985e64b18b8fb88b combined with pending
reviews demonstrated the OWNERS syntax has quirks and it is not working
as intended.

Documentation used:
https://android-review.googlesource.com/plugins/code-owners/Documentation/backend-find-owners.html#syntax

The syntax guide recommends that patterns like sub-dir/* aren't used as
they can cause problems when renaming directories; better to have OWNERS
in the sub-dir. The pattern sntp/* didn't appear to be working (perhaps
because of spaces).

Test: None
Bug: 199481251
Change-Id: I193744eaaad529b9680d3ccf905b86d68f62f7ff
2021-10-14 13:28:57 +01:00
Treehugger Robot
530fbd2d14 Merge "Pass Binder token to ISuspendControlServiceInternal#enableAutosuspend" 2021-10-14 11:48:30 +00:00