Add NtpTrustedTime.forceRefresh(Network). If a component that uses
NtpTrustedTime is monitoring network connectivity, it should probably
provide the network to be used, otherwise there is a non-obvious
relationship between the network being monitored and the network
actually used.
Only one user of NtpTrustedTime is updated here as the other,
GnssLocationProvider / NtpTimeHelper, is going to be refactored in an
upcoming commit. Leaving it using the forceRefresh() method that doesn't
take a parameter is not a regression.
Bug: 222295093
Test: atest core/tests/coretests/src/android/util/NtpTrustedTimeTest
Test: Treehugger
Change-Id: I51db528d06359c33335c874aca524f5adee3f3a7
Add a note about the return values from logging function since it was
asked in b/228523679.
Bug: 228523679
Fix: 228841312
Test: m
Change-Id: I39a3cad4ba10c4602e58ec9e88c7864ead4b9d85
As documented in art/runtime/jni/jni_internal.cc, ART has deviated
from the RI by using a 4-byte encoding instead of the 3-byte encoding
required by the JNI specification.
Some users are okay with this 4-byte encoding (where they control
both the reading and writing logic) but other users require
compatibility with the DataOutput/DataInput API contract, so this
change lets users request either behavior.
This change now exercises all tests in both 4-byte and 3-byte modes,
and exhaustively confirms that all valid code-points match the
DataOutput/DataInput contract when in 3-byte mode.
Benchmark results still show significant performance benefits when
using this 3-byte encoding over the upstream RI:
timeRead_Upstream_mean (ns): 5090068
timeRead_LocalUsing3ByteSequences_mean (ns): 1996032
timeRead_LocalUsing4ByteSequences_mean (ns): 1813250
timeWrite_Upstream_mean (ns): 3856276
timeWrite_LocalUsing3ByteSequences_mean (ns): 1632697
timeWrite_LocalUsing4ByteSequences_mean (ns): 886503
Bug: 236923096
Test: atest FrameworksCoreTests:CharsetUtilsTest
Test: atest FrameworksCoreTests:FastDataTest
Test: atest FrameworksCoreTests:XmlTest
Test: atest FrameworksCoreTests:BinaryXmlTest
Test: ./frameworks/base/libs/hwui/tests/scripts/prep_generic.sh little && atest CorePerfTests:FastDataPerfTest
Change-Id: Ibddd36410a0d4a909522de011f23a337b53d6889
Add support for multiple NTP servers in NtpTrustedTime. The algorithm to
select the server is documented in comments in that class. Tests have
been updated accordingly.
This commit changes config.xml, removing (string) config_ntpServer and
replacing it with (string-array) config_ntpServers. It also modifies
command line and settings behavior.
Bug: 223365217
Test: atest frameworks/base/core/tests/coretests/src/android/util/NtpTrustedTimeTest.java
Test: atest frameworks/base/services/tests/servicestests/src/com/android/server/timedetector/
Test: atest cts/tests/tests/os/src/android/os/cts/SystemClockSntpTest.java
Test: adb shell settings put global ntp_server "ntp://time.google.com\|ntp://time.android.com"
Test: Inspection: adb shell dumpsys network_time_update_service
Test: Inspection: adb shell dumpsys time_detector
Change-Id: I5e19a4d82c9771448940b9f1db1689f21508667b
Further refactoring to support adding multiple NTP servers in a later
commit. The logic for multiple servers will be added to forceRefresh()
later.
This commit also contains some refactoring to support improved testing
of NtpTrustedTime.forceRefresh(). Tests for the existing behavior have
been added here.
As part of this change, SntpClient / NtpTrustedTime /
NetworkTimeUpdateService have also been extended to pipe information
about the IP address of the NTP server used to obtain the time back to
the NetworkTimeUpdateService for improved logging / debugging support.
Bug: 223365217
Test: atest frameworks/base/core/tests/coretests/src/android/util/NtpTrustedTimeTest.java
Test: atest frameworks/base/services/tests/servicestests/src/com/android/server/timedetector/
Test: atest cts/tests/tests/os/src/android/os/cts/SystemClockSntpTest.java
Test: Inspection: adb shell dumpsys network_time_update_service
Test: Inspection: adb shell dumpsys time_detector
Change-Id: Ia0f13e2c8cbd102d677797b745414d8ab5fa1eba
Refactoring changes to make it easier to support NTP configuration that
contains multiple NTP servers to try. As part of this change, the NTP
server configuration is being changed from a simple hostname to a URI in
the form ntp://<host>[:port]. This is a local scheme introduced for this
commit for this purpose and not (currently) an official, registered IANA
URI scheme.
Settings parsing in NtpTrustedTime retains support for the simple
hostname-only form to avoid introducing incompatibilities when devices
upgrade and have settings values from earlier releases. All other cases
(config.xml, commandline) are updated here to only support the new URI
form as these don't have backwards compatibility guarantees.
A later commit will add:
+ The settings / config changes to support a list of URIs in the format
introduced in this commit, i.e. in place of the single one supported
today.
+ The server request loop / server stickiness need to support multiple
servers.
Switching to a URI over a simpler encoding scheme means:
1) Not having to deal with parsing awkward host + port cases, like IPv6
addresses which contain colons, e.g. "[:::1]:1234" (these are used in
in our tests).
2) Opens up the possibility of future protocols like NTS via a different
URI scheme, and future parameterization of NTP server config with
query params, paths, or similar.
3) Easy delimiting of lists later using a whitespace character like
space, which will be encoded when part of a URI. This can be used for
extending settings parsing to support multiple, space-delimited
configs as settings code doesn't support multi-value settings out of
the box (unlike config / commandline cases, which are comparatively
easy).
This commit contains a new OWNERS file for NtpTrustedTimeTest. The file
has been populated with ownership information for TypedValueTest using
information from the OWNERS for the code under test.
Ignore-AOSP-First: The OWNERS change relates to a file landing
internally
Bug: 223365217
Test: atest frameworks/base/core/tests/coretests/src/android/util/NtpTrustedTimeTest.java
Test: atest cts/tests/tests/os/src/android/os/cts/SystemClockSntpTest.java
Change-Id: I3afbd04659b4e4ee336619ea5ac6db7588057d6e
Switch NetworkTimeUpdateService to using TimeDetectorInternal instead of
the binder API.
The NetworkTimeUpdateService runs in the system server, so it does not
have to use binder to communicate with the time_detector.
Also update NetworkTimeSuggestion to include uncertainty so that it
contains all the information needed for future usecases associated with
GnssLocationProvider.
Bug: 219693030
Bug: 222295093
Test: atest services/tests/servicestests/src/com/android/server/timedetector/
Test: atest services/tests/servicestests/src/com/android/server/timezonedetector/
Test: atest core/tests/coretests/src/android/app/timedetector/
Change-Id: I4665da76429bc333b34769fc362221581472690e
Move network time logic out of AlarmManagerService in preparation for
a future refactoring. The TimeDetectorService is now a better home for
functionality associated with time signals, as it should receive most
time signals from various sources so it can determine whether the
device's system clock needs to change.
Although the TimeDetectorService is not currently informed every time
the NtpTrustedTime obtains a new time, it should be in future after
further work in later commits.
This change modifies the logic in SystemClock to match the GNSS time
logic in the same class, i.e. rather than calculating the "current time"
in the system server and then sending it over binder (introducing a
delay), the latest information needed to compute the time is sent to the
client, which then calculates the current time.
Bug: 219693030
Bug: 222295093
Test: atest services/tests/servicestests/src/com/android/server/timedetector/TimeDetectorServiceTest.java
Test: atest cts/tests/tests/os/src/android/os/cts/SystemClockSntpTest.java
Test: Treehugger
Change-Id: I80ea52877352122b52ac54daed8b092f3cc18e02
This flag will allow/restrict intent redirection to/from clone profile.
This is to ensure that framework is not impacted by intent redirection
till we are ready to launch.
The default is false, once ready to launch we would set it true and
eventually remove it.
The flag can be modified through Settings>System>Developer
options>Feature
flags>settings_allow_intent_redirection_for_clone_profile.
Bug: 236221777
Test: tested this by flashing the device along with intent redirection
code.
Design Document: go/intent-redirection-blue-doc
Change-Id: I98d57ef6ff3883b423ada7b3d567425720dc5665
The DisplayManager.getStableDisplaySize is not the right way to get the
size we want for screen decorations and display team is going to get rid
of it.
Instead, we use the maximum display size supported by the display as the
base size to define the cutout and rounded corner configs.
Also fixed a bug that DisplayCutoutBaseView didn't update the
shoudDrawCutout config when display change.
Bug: 230227839
Test: 1. On foldable device, fold and unfold the device and check if the
cutout is correctly drawn.
2. On device supporting multiple resolutions, switch resolution
between FHD & QHD and check if the cutout is correctly drawn.
Test: atest LocalDisplayAdapterTest DisplayCutoutTest
ScreenDecorationsTest RoundedCornersTest
DisplayCutoutBaseViewTest
Change-Id: I7a602b5abd7d6a21d17eae4f8e99414eaf765fa5
Previously, a fixed size buffer was allocated each time a call to
`computeSha256DigestForLargeFile` was made. This causes
undesirable performance issues. This change allocates a buffer
per apex/module-update session instead.
To fix this, that method is amended to take in a buffer passed
in by the caller instead.
To aid in the usage of this API, a new method called
`createLargeFileBuffer` is introduced to help callers allocate
a pre-determined buffer size to be passed into the SHA
computation method based on whether the device is low RAM
device or not.
Subsequent RSS benchmarking shows that this helps to
significantly lower the RSS high watermark (HWM) for
the `system_server` process into just noise.
Bug: 229137737
Test: Manual
Change-Id: I6d2d17353f999bd6cfb937cd5ae6e6925f1353ac
UDFPS position and assets are configured in pixels in native
resolution. This CL adds a mechanism to detect a runtime resolution
change and scale the UDFPS coordinates accordingly.
Bug: 223342274
Test: atest SystemUITests:com.android.systemui.biometrics
Change-Id: Iaa1f3d633b50019d06bdecb5063490ad6eb11272
In current desgin, the confgis for cutout and rounded corner are based
on the original display size. If the display resolution is overridden,
cutous and rounded corners will be drawn in incorrect places with
incorrect size.
We should load the cutout & rounded corners with the orignal display
size and then scale the results with the display ratio which is
calculated by dividing current size with original size.
Bug: 209592558
Test: manual:
1. Go Settings-> Display-> Screen Resolution
2. Switch between FHD+ and QHD+
3. Check if the cutout and rounded corner looks the same as they
are in the original display size.
Test: manual:
1. adb shell wm size 1080x2340
2. Check if the cutout and rounded corner looks the same as they
are in the original display size.
Test: atest DisplayCutoutTest LocalDisplayAdapterTest
ScreenDecorationsTest RoundedCornerResDelegateTest
Change-Id: Iea42b73c0276b82983c1ddbce9455355afdc164d
- Add API in IUserManager to allow setting ephemeral user flag
- Implement and export this API in UserManagerService and UserManager
- Set guest as ephermal by default when createGuest in UserManager is called
- Handle guest user switching in UserSwitcherController for the case
of dynamic change of ephemeral state
- Add persistant notification when in guest mode to indicate
- if guest session is new or previously used.
- if guest session will be cleared on exit or not
- Add buttons in persistant notification to reset or exit guest
- Add flags to enable/disable this feature
Bug: 214031645
Screenshots: go/ephemeral-guest-b-214031645-ux
Test: Manual test using sunfish, atest SystemUITests, atest SettingsRoboTests
Relands ag/16545010 after resolving post submit issues
Revert "Revert "Guest mode updates to resolve privacy concerns in guest mode""
This reverts commit dd5c440802.
Change-Id: I46b8ab527bab8fe665114ed0fffbb06a59d49a77
Merged-In: I46b8ab527bab8fe665114ed0fffbb06a59d49a77