Commit Graph

21701 Commits

Author SHA1 Message Date
Neil Fuller
808b9f1b73 Merge "Add a Y2038 check into the time_detector" 2022-05-10 11:44:09 +00:00
Neil Fuller
2ff5ec1aad Add a Y2038 check into the time_detector
Add a Y2038 check into the time_detector and add infrastructure to allow
command-line testing to confirm it works.

This is before removing a Y2038 check from NITZ parsing code in the
telephony process. After this change, Androdi will consistently block
>= Y2038 suggestions, not just time signals that come in via telephony.

The initial checks attempt to limit the restriction to devices with
32-bit ABIs, since the main issue we're aware of is that time_t is a
32-bit signed int under bionic, hence there could be issues with that
type in 32-bit processes on 32-bit / mixed 32/64-bit devices.

Bug: 204193177
Test: adb shell cmd time_detector suggest_network_time --reference_time 2480587 --unix_epoch_time 1646473966056
Test: Run with 32-bit + 64-bit only builds, inspect adb shell dumpsys time_detector
Merged-In: Ib9d6472f5ca7a62d59b3224f1845846f99a0b52d
Change-Id: Ib9d6472f5ca7a62d59b3224f1845846f99a0b52d
2022-05-10 10:01:58 +00:00
Jing Ji
bf7ab279a6 Merge "[BugFix] acquireProvider maybe wait for timeout" 2022-04-19 04:31:57 +00:00
Sudheer Shanka
3bad67bf01 Inform Application thread to block for network rules to be updated.
Bug: 226299593
Test: atest tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
Change-Id: Ie37173d0d3f4034a74b834550920530166cd4201
Merged-In: Ie37173d0d3f4034a74b834550920530166cd4201
2022-04-15 09:40:13 +00:00
Sudheer Shanka
eb5e04aeca Inform AMS about the uid blocked reasons.
This will be used to let the application thread
know whether or not to block for network rules to
be updated when coming to the foreground.

Bug: 226299593
Test: atest tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
Change-Id: I9bff481a0026fb57af8dbee580e617c8410f9ebe
Merged-In: I9bff481a0026fb57af8dbee580e617c8410f9ebe
2022-04-15 09:39:57 +00:00
Sudheer Shanka
3d9f5e63c1 Inform NPMS about the app coming to the TOP state early.
It's possible for an app to come to the TOP state before
the oomAdj computation is done and we cannot wait for
oomAdj computation to complete and then inform NPMS about
the state change. So, inform NPMS early about the state
change when we know the app is going to the TOP state.

Bug: 226299593
Test: atest tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
Change-Id: I5d582618652cead179c419f7fe084283dd89d514
Merged-In: I5d582618652cead179c419f7fe084283dd89d514
2022-04-15 09:39:39 +00:00
Sudheer Shanka
99b5c0cbf6 Avoid checking for idle state when the app is in top state.
When we know that an app moved to a procstate that is considered
an interaction event, the app will not be in idle state. So, avoid
calling into UsageStatsService for idle state in this case.

Bug: 209338078
Test: atest tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
Change-Id: I5648db595d2fd10a151da13e472fd905bcafe182
Merged-In: I5648db595d2fd10a151da13e472fd905bcafe182
2022-04-15 09:35:40 +00:00
Julia Reynolds
e3a1682e0b Merge "Update FLAG_ONLY_ALERT_ONCE docs" 2022-04-13 19:02:02 +00:00
Edward Savage-Jones
1a90fd5998 Update FLAG_ONLY_ALERT_ONCE docs
Update FLAG_ONLY_ALERT_ONCE docs to match implementation
from Android P and onwards.

Bug: 222328375
Test: atest BuzzBeepBlinkTest
Change-Id: Ic058b8265551362b04b9cd0363e43a4c08ecd736
2022-04-13 08:35:38 +00:00
huang chaopeng
2da542d368 [Bugfix] Don't delete mPendingUids if PendingTopPid is added later than updateOomAdj started
Analysis:
1.Doing updateOomAdjInnerLSP in backgroud, and it would last for a long
time
2.Now start a new Activity, windowManager save the latest topUid into PendingStartActivityUids
3.updateOomAdj task in step.1 done, and then delete all uids in PendingStartActivityUids
4.The topApp will be rejected by AppOps due to the deleting in step.3

Signed-off-by: huang chaopeng <huangchaopeng@oppo.corp-partner.google.com>
Change-Id: I52c7c2a8d6cb86b27b1f008cb56f670ce7698dc9
2022-03-24 10:47:35 +08:00
Patrick Rohr
c02e97dcdd Merge "Split out the ethernet API surface and use framework-connectivity-t" 2022-03-16 16:03:30 +00:00
Xiao Ma
f4d72b212c Split out the ethernet API surface and use framework-connectivity-t
Ethernet framework and service source code is going to be moved to
Connectivity mainline module, this CL contains below corresponding
changes to adapt the migration in f/b side:

1. Split out ethernet module-lib APIs to Connectivity module.
   Add the ethernet resource filegroup to tiramisu-updatable-sources
   filegroup as well, build them together. Also update the module-lib
   and system api txt to reflect the APIs change. Remove the hidden
   APIs which are moved to Connectivity module. This removal fixes the
   api inconsistent issue with Tethering/apex/hidden/.

2. Remove EthernetService from SystemServer which will be registered
   from ConnectivityServiceInitializer.

3. Replace the BackgroundThread class(imported from f/b/core/java)
   with the one in the modules-utils-backgroundthread lib, which is
   visible to Connectivity module.

Bug: 210586283
Test: m
Test: atest FrameworksNetTests EthernetServiceTests
Change-Id: I3e13cb9c0e348333af295c2537d459aa6700ff17
Merged-In: I1956848d3248cc56e9841d221e5e4c160bed65a4
2022-03-14 13:47:01 +00:00
Sooraj Sasindran
e9c9dda003 Allow a list of configs to be sent for enterprise slice
Allow a list of configs to be sent for enterprise slice
Allow device owner to set enterprise slice config
Allow enterprise apn to be configured by profile owner

Bug: 217365439
Bug: 222723840
Test: ran CTS tests
Merged-In: I82c159843d0806cbfc5eea602fbd0304e7ff04ac
Change-Id: I82c159843d0806cbfc5eea602fbd0304e7ff04ac
2022-03-11 05:38:59 +00:00
Guanyou Chen
036d3ce1a9 [BugFix] acquireProvider maybe wait for timeout
Test: manual
Change-Id: Iaeb951ad8dda333e660a66a138e2cc80f9dbd6a0
2022-03-09 08:36:41 +00:00
Junyu Lai
990eeb962e [MS62.1] Start NetworkStatsService from the module am: c3c278779f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1987466

Change-Id: I1f72e7f3fbcb64052e90a10bc2869076fc9ecea7
2022-02-28 06:26:36 +00:00
Neil Fuller
b78dfa9ee9 Merge "Switch "UTC time" to "Unix epoch time"" am: 1ecf1d2462
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1979487

Change-Id: I87481e4d54250097a306a1e7a0c48c0223f37f37
2022-02-23 16:43:27 +00:00
Neil Fuller
69c6a42de0 Switch "UTC time" to "Unix epoch time"
This is more correct.

Bug: 218802673
Test: Compile only
Merged-In: Ic477c021529a94b4a3665426b7daaf6567fa311a
Change-Id: Ic477c021529a94b4a3665426b7daaf6567fa311a
2022-02-22 15:05:33 +00:00
Junyu Lai
c3c278779f [MS62.1] Start NetworkStatsService from the module
NetworkStatsService is going to be moved into Connectivity mainlne
module and it will be not visible to SystemServiceResistry after
migration done. Thus:
1. Register service in NetworkStatsServiceInitialalizer, a separate
   initializer is needed because the service needs to be created
   before NetworkPolicyManagerService's initialization.
2. Call SystemReady at PHASE_ACTIVITY_MANAGER_READY phase where
   it needs to be ready before StatsPullAtomService pulls at
   PHASE_THIRD_PARTY_APPS_CAN_START.
3. Register manager in ConnectivityFrameworkInitializerTiramisu
   instead of SystemServiceRegistery.

Test: atest FrameworksNetTests CtsNetTestCases NetworkUsageStatsTest
Bug: 204830222
  (cherry-picked from ag/16688794)
Change-Id: I95020d816ed613ce3480a0720a5b71dcdc7fab72
Merged-In: I95020d816ed613ce3480a0720a5b71dcdc7fab72
2022-02-18 16:20:47 +08:00
Joanne Chung
114d0c7773 Merge "Update team OWNERS file." am: e96070ac89
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1982066

Change-Id: I50a93d3e190ba2a4988e0777be2c5e571f2a2760
2022-02-16 04:42:57 +00:00
Xin Li
2b87be68b8 Merge SP2A.220305.012
Bug: 219523960
Merged-In: I748fdd49626acaa0e986a9d8038039cada6faa60
Change-Id: I67693156d705f2488fe18149d2dd02d529f009ff
2022-02-14 20:06:38 +00:00
Joanne Chung
b00f0d6c95 Update team OWNERS file.
Bug: 177641730
Test: n/a
Change-Id: If4ecc7326dc229d8807e1497c5e3e2ef0637680f
2022-02-14 14:51:12 +08:00
Xin Li
5ad6db7742 Merge sc-v2-dev-plus-aosp-without-vendor@8084891
Bug: 214455710
Merged-In: I8cfa435bb6233818adb9cc99dadeeb06a03443d5
Change-Id: Ib93992d88fd1704179009a3872798b9e7b83a6d1
2022-02-11 07:25:43 +00:00
Aaron Huang
794d210854 Split out the ipsec API surface and use framework-connectivity-tiramisu
(cherry picked from commit 1dad7aa006)
Bug: 204153604
Test: TH
Change-Id: I6cc8aef6a0ab9ce4bcef2797196b1d1b3687acca
Merged-In: I6cc8aef6a0ab9ce4bcef2797196b1d1b3687acca
2022-02-10 19:01:00 +09:00
Xin Li
f55c524f34 Merge SQ1A.220205.002
Bug: 213904741
Merged-In: Ib2b0342af85679c0514fb4d88530376b58e6e12a
Change-Id: I82a9718a548507487ab9fa1795e08fc42dca0086
2022-02-07 23:18:56 -08:00
Hans Boehm
63e3c2c709 Merge "Prefer WeakReference.refersTo() to get()" 2022-01-27 00:22:02 +00:00
Sooraj Sasindran
14074e8a2c Add device poliy manager support for profile network preference
Change-Id: If3f28dfdd731dddf2d2a7516d6479359a5454b83

Bug: 194332512
CTS-Coverage-Bug: 215722242
Test: unit test
Change-Id: Ibe680d47548e0f17979301ccbbac98a79c9031ac
2022-01-24 19:24:15 -08:00
Makoto Onuki
34af3074f2 *ServiceStartNotAllowedException shouldn't have a "cause"
Bug: 210890426
Test: Manual test with a test app, received this exception and
made sure cause isn't set.
Change-Id: I94ba39c775cf95074907db6814104289a577d496
Merged-in: I94ba39c775cf95074907db6814104289a577d496
(cherry picked from commit d4396b9a9d)
Merged-In:I94ba39c775cf95074907db6814104289a577d496
2022-01-23 20:56:24 +00:00
Junyu Lai
a411d32226 Merge "[MS66] Initialize TrafficStats with context" 2022-01-22 00:06:17 +00:00
Sharon Su
3166def10f Merge "Create directories for wallpaper effects generation api and and owners files. Bug: 213238425 Test: meta file change" 2022-01-22 00:05:24 +00:00
Junyu Lai
de9cf3392d [MS66] Initialize TrafficStats with context
TrafficStats has static methods created in API level 8 that need
access to NetworkStatsManager but doesn't take a context.
Previously this was achieved by using ServiceManager, but
with TrafficStats moving to the connectivity module, this
is no longer possible.

Instead, make sure TrafficStats has an appropriate context by
the time any client code can call the relevant methods.
• In app code, this achieved by passing the application
  context from ActivityThread#handleBindApplication, before any
  app code can run.
• In the system server, this is achieved by passing the context
  right after creating service.

Test: atest TrafficStatsTest CtsWebkitTestCases
Bug: 204830222

Change-Id: I251bb8a4431ad12ff61929879ef1363cf06b9244
2022-01-22 01:01:49 +08:00
Hans Boehm
3492061b6d Prefer WeakReference.refersTo() to get()
This is an initial pass over frameworks/core to avoid WeakReference
get(), since that can cause the referent to be unnecessarily retained.
Most of these were found by searching for "get() == null".

Bug: 215259836
Test: Treehugger
Change-Id: I5227b05ca22e83b886ccf6713989961076df3f8c
2022-01-20 17:57:02 -08:00
Sharon Su
fd184683cb Create directories for wallpaper effects generation api and and owners
files.
Bug: 213238425
Test: meta file change

Change-Id: Ibdd21969f4cbd30c68f933ea4515358173307919
2022-01-20 01:07:27 +00:00
Wu Ahan
ac8151be84 Revert "Decode the input of both setStream and setResource calls first"
This reverts commit f6a946bbcd.

Reason for revert: will deliver a better fix for that, ag/16580245.

Change-Id: I9c401b4cbded8753fc89df25a2c4f88a2fe72087
(cherry picked from commit aba1d77ff7)
Merged-In:I9c401b4cbded8753fc89df25a2c4f88a2fe72087
2022-01-20 00:46:35 +00:00
Dave McCloskey
b90933a1cc Add OWNERS file for TrustManager et al.
Test: m

Change-Id: I8045e9518a05d3d29811153b22c94e920e1e6335
2022-01-19 15:17:04 -08:00
TreeHugger Robot
4b30a3ee91 Merge "Fix IME shrunk by WindowTokenClient mis-detach" into sc-v2-dev am: ff6577fd10
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16598426

Change-Id: I2e7b34abfe7769160c383a0774cf3bb9635c46e2
2022-01-15 04:39:36 +00:00
TreeHugger Robot
ff6577fd10 Merge "Fix IME shrunk by WindowTokenClient mis-detach" into sc-v2-dev 2022-01-15 04:27:54 +00:00
Ming-Shin Lu
29de30597b Fix IME shrunk by WindowTokenClient mis-detach
As CL[1] introduced WindowTokenClient for WindowProviderService (aka the
parent class of InputMethodService starts from CL[2]) as a token that
IME context can associate with the windowContainer of
the InputMethod window in server side. Like the activity context,
IME context can adopt configuration/resources update when the IME
window changed by display/window changes.

And, the IME context caller can also create another type of context
with wrapping IME context (i.e. calling createDisplayContext to create
a display context), that makes this context can be mixed the window
token of WindowProviderService since it's the base context.

However, the finalization of the context mixed WindowTokenClient
will detach the token when the attached context type is non-window
context, this action will mis-detach the token when it managed by
WindowProviderService.

So like SoftKeyboard previously using
createDisplayContext in CL[3] to workaround context resources issues,
will in-directly expose this mis-detach token issue as the above.

Beside, the handling of WindowTokenClient#{onConfigurationChange,
onWindowTokenRemoved} does not thread-safe since this is called from
IPC.

As the result, the fix is to ignore the check in ContextImpl#finalize
to not detach the token when it managed by WindowProviderService,
also make sure to post to the main handler when received
onConfigurationChanged/onWindowTokenRemoved in WindowTokenClient.

Note that this fix could help to resolve "The Window Context should
have been attached to a DisplayArea." exception if the token has been
detached as the above case that happens before the next
WindowProviderService#attachToWindowToken invoked.

[1]: I64a1614f32d097785915f6105b1813a929e0fe32
[2]: Ie565e30ed5dd3f2cfe27355a6dded76dc3adc14b
[3]: Ic592a1d2fb2da149220c8b503b522b3e864bcc77

Bug: 213118079
Bug: 211062619
Test: manual as steps:
1) adb install -r EditTextVariations.apk
2) adb install -r SoftKeyboard.apk
3) adb shell ime enable com.example.android.softkeyboard/.SoftKeyboard
4) adb shell ime set com.example.android.softkeyboard/.SoftKeyboard5
5) Enable screen auto-rotation
6) Launch EditTextVariations from launcher's shortcut
7) Tap the first EditText field to show IME
8) Rotate the device to the landscape mode
9) Expect the IME should not be shrunk

Change-Id: I7beb7a122af93e596239a36db62073233cea0726
2022-01-14 12:49:13 +00:00
Mariia Sandrikova
a274e1a7d4 DO NOT MERGE Revert "[2/n] Camera Compat UI: Add interfaces for client-server..." am: 7617679a61
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16571392

Change-Id: I0adf2bf45c5f7d7349e9c0f180aea9d10f70645d
2022-01-13 22:55:51 +00:00
Mariia Sandrikova
7617679a61 DO NOT MERGE Revert "[2/n] Camera Compat UI: Add interfaces for client-server..."
Revert submission 16468379

Reason for revert: Feature development is moving to T.

Reverted Changes:
Id9b9a8930:[3/n] Camera Compat UI: Add a camera compat contro...
Id6be4a954:Enable a camera app compat control on Large screen...
I083aa6718:[2/n] Camera Compat UI: Add interfaces for client-...

Bug: 206602997

Change-Id: I9ad876043fd61f708a8f468fffd1ef371bfa0866
2022-01-13 15:21:38 +00:00
Wei Sheng Shih
494706d9c2 Merge "Fix transfer splash screen view been called twice from onDraw" into sc-v2-dev am: 0c6450141f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16561482

Change-Id: If8a3b2bddc7583da65673258ae2fe1c64ab840a2
2022-01-10 17:02:47 +00:00
wilsonshih
4ee97aa498 Fix transfer splash screen view been called twice from onDraw
postOnAnimation is not robust enough from remove the onDrawListener
before next traversal, add a flag to to ensure that transfer splash
screen view only been called once.

Bug: 204125440
Test: atest SplashscreenTests
Test: verify SplashScreenTests and SplashscreenParametrizedTest pass
Change-Id: Id0e6d57b901b2dae45f5aa77e5571f9cf81b6e29
2022-01-10 18:23:20 +08:00
Bill Yi
6042a19c72 Merge sc-qpr1 to aosp-master - DO NOT MERGE
Merged-In: I90ca5ccbf686a975f479c2488ff34f82af12946a
Merged-In: I128f5ed6c1bad350ea449bba5da21123de3ea31b
Change-Id: Ib18c8042f735dceeee5e6ab9f1c963cf630913a6
2022-01-06 18:38:32 -08:00
Mariia Sandrikova
02a17e7b1f Merge changes from topic "camera-compat" into sc-v2-dev am: 3486eacda3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16468379

Change-Id: I1e56abcef9715a3dd6a00d70cb815c4d9260175a
2021-12-18 21:59:31 +00:00
Mariia Sandrikova
3486eacda3 Merge changes from topic "camera-compat" into sc-v2-dev
* changes:
  [3/n] Camera Compat UI: Add a camera compat control.
  [2/n] Camera Compat UI: Add interfaces for client-server communication.
2021-12-18 21:39:13 +00:00
TreeHugger Robot
09ff886960 Merge "Workaround to dump error log instead of exception" into sc-v2-dev am: 0eeab2b04d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16489361

Change-Id: I110dce293d0dae9088b9ba3826d0a3421bb50beb
2021-12-17 16:19:27 +00:00
Mariia Sandrikova
24f4d8a952 [2/n] Camera Compat UI: Add interfaces for client-server communication.
Changes:
- Listens to changes from the client coming through IActivityClientController#requestCompatCameraControl to ActivityRecord#updateCameraCompatState
- ActivityRecord#updateCameraCompatState sends updated state via TaskInfo to WM Shell
- ITaskOrganizerController#updateCameraCompatControlState to dispatch the user interactions with the control from WM Shell triggers callback to ActivityRecord#updateCameraCompatStateFromUser
- ActivityRecord#updateCameraCompatStateFromUser remembers the user's choice and asks client to apply treatment through ICompatCameraControlCallback

Feature is guarded with config_isCameraCompatControlForStretchedIssuesEnabled

Test: atest WMShellUnitTests:ShellTaskOrganizerTests, atest WmTests:ActivityRecordTests
Bug: 206602997
Change-Id: I083aa6718bd67456bedd9444e9b78740c041f870
2021-12-17 00:18:57 +00:00
Hui Wu
27399689e6 Merge "Adding owners in cloudsearch packages" am: d628edb425 am: f921b4b76d am: 8c7f2f8695
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1925161

Change-Id: I6727e0357235c69d2c5a75c69081a3699167f1d2
2021-12-16 21:08:01 +00:00
Hui Wu
8c7f2f8695 Merge "Adding owners in cloudsearch packages" am: d628edb425 am: f921b4b76d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1925161

Change-Id: I60c619f8c1275b22e069aa256b1569c1efe9eebe
2021-12-16 20:44:09 +00:00
Hui Wu
d628edb425 Merge "Adding owners in cloudsearch packages" 2021-12-16 19:33:49 +00:00
Chilun
77ed8e5724 Workaround to dump error log instead of exception
This is a short-term workaround to dump error log instead of throwing
the exception to unblock the test.

Bug: 209744518
Test: build pass
Change-Id: I2ece3b9d85edc1ae43038e6f69b35f59b160a3dd
(cherry picked from commit f8fc1326f7)
2021-12-16 16:04:29 +00:00