Commit Graph

17805 Commits

Author SHA1 Message Date
Junyu Lai
0e27aa3be6 Merge "[MS10.1] Move multiplySafeByRational to NetworkStatsUtils" am: 6ff6240694 am: 239ffb98df am: c12c9ad508 am: 499790f024
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1920477

Change-Id: I4d415add75f300bd01ecfeb231c9edd9892b4d1f
2021-12-21 02:04:30 +00:00
Junyu Lai
499790f024 Merge "[MS10.1] Move multiplySafeByRational to NetworkStatsUtils" am: 6ff6240694 am: 239ffb98df am: c12c9ad508
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1920477

Change-Id: I6bff9f75d9426978d2d4077a3bc54d5c0cb0fe4a
2021-12-21 01:51:06 +00:00
Junyu Lai
c12c9ad508 Merge "[MS10.1] Move multiplySafeByRational to NetworkStatsUtils" am: 6ff6240694 am: 239ffb98df
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1920477

Change-Id: Icf376927fd8c66ccf22e825f0157fc5b61d985a1
2021-12-21 01:46:03 +00:00
Junyu Lai
6ff6240694 Merge "[MS10.1] Move multiplySafeByRational to NetworkStatsUtils" 2021-12-21 01:22:14 +00:00
Junyu Lai
b241707f03 [MS10.1] Move multiplySafeByRational to NetworkStatsUtils
Since NetworkStats related code will be moved to the module.
multiplySafeByRational in the NetworkUtilsInternal cannot be
accessed after that. Thus, create another utils class that
will be moved with NetworkStats code and put the function
into it.

Test: atest NetworkStaticLibTests:com.android.net.moduletests.util.NetworkStatsUtilsTest
Bug: 204830222
Change-Id: I96f3ac02e57b7325ed53988285770f478dee529e
2021-12-20 09:12:13 +00:00
Ruslan Tkhakokhov
16a8f596d5 Make IBackupTransport AIDL async
Make the transport AIDL async and introduce a callback AIDL for passing
back results. A follow-up CL will implement the client-side portion of
the callback class and update BackupTransportClient to use it.

Bug: 202716271
Test: m -j
Change-Id: I79cb376bd2a805bf2739470a3f538207ae6bd9a0
2021-12-19 18:40:50 +00:00
TreeHugger Robot
895a377861 Merge "Detect broken IC#endBatchEdit() impl at runtime" 2021-12-17 02:48:08 +00:00
Hunter Knepshield
d95546ffed Merge "Create CarrierPrivilegesListener callback." am: d54e1126ab am: e66c82b449 am: c7a0de9f6f am: 93a25e9cd1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1912993

Change-Id: Ica9fba211d8cc8c866a370a83c57e070dd6f338c
2021-12-16 20:48:34 +00:00
Yohei Yukawa
60c7c55c36 Detect broken IC#endBatchEdit() impl at runtime
This is a safeguard against cases like Bug 203086369, where the UI
thread can be locked up if IC#endBatchEdit() never returns false no
matter how many times it gets called.

With this CL, the system will have a max retry count on how many times
it attempts to call IC#endBatchEdit(), which is currently set to 16,
then fall back to InputMethodManager#restartInput(View) if it hits
such a limit.

This CL also introduces a volatile type cache to early fall back to
the fallback implementation if the same type of InputConnection
implementation class appears again.

As long as InputConnection#{begin,end}BatchEdit() is correctly
implemented, there should be no developer observable behavior change
in this CL.

See the corresponding test CL [1] about when the fallback
implementation is used.

 [1]: Ifb80015ab0f0c32c917a80c4e5f60e836648e7b4

Bug: 203086369
Bug: 208941904
Bug: 209008342
Test: atest CtsInputMethodTestCases:InputMethodStartInputLifecycleTest
Change-Id: I109e0c26d8249fc2e01323e3e1cb36395fa7cc97
2021-12-16 12:45:41 -08:00
Hunter Knepshield
93a25e9cd1 Merge "Create CarrierPrivilegesListener callback." am: d54e1126ab am: e66c82b449 am: c7a0de9f6f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1912993

Change-Id: Id89455067252fd32f2c8890af120c4241185fcf7
2021-12-16 19:48:39 +00:00
Hunter Knepshield
c7a0de9f6f Merge "Create CarrierPrivilegesListener callback." am: d54e1126ab am: e66c82b449
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1912993

Change-Id: Ia3a4afac2c703b6ff411dd981d4899be78d78281
2021-12-16 19:40:11 +00:00
Hunter Knepshield
d54e1126ab Merge "Create CarrierPrivilegesListener callback." 2021-12-16 19:00:24 +00:00
Dmitri Plotnikov
553429ae39 Merge "Attribution of modem power per process state" 2021-12-16 18:59:50 +00:00
Ayush Sharma
7fd1f1cc2d Merge "Revert "Add APIs that allow to exclude routes from VPN"" am: da37e0f471 am: d48a67e944 am: 05fad87223 am: e41e71aca7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1927301

Change-Id: I2d6f52d4c11e8b3064f816a4a125ada8b344866c
2021-12-16 15:55:07 +00:00
Ayush Sharma
e41e71aca7 Merge "Revert "Add APIs that allow to exclude routes from VPN"" am: da37e0f471 am: d48a67e944 am: 05fad87223
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1927301

Change-Id: I84505e56bfdb32ab4dc43559d56390d60bc1ff73
2021-12-16 15:52:37 +00:00
Ayush Sharma
05fad87223 Merge "Revert "Add APIs that allow to exclude routes from VPN"" am: da37e0f471 am: d48a67e944
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1927301

Change-Id: I2847af72de65564d3bda4145ebc05261e9fbe61e
2021-12-16 15:39:49 +00:00
Ayush Sharma
da37e0f471 Merge "Revert "Add APIs that allow to exclude routes from VPN"" 2021-12-16 15:01:30 +00:00
Ayush Sharma
487b2e645a Revert "Add APIs that allow to exclude routes from VPN"
Revert "Suppress NewApi warnings for @SystemApi -> public APIs"

Revert "Add VpnServiceBuilderShim for VpnService.Builder"

Revert submission 1551943-vpn-impl

Reason for revert: <DroidMonitor-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?branch=aosp-master&target=mainline_modules_x86_64-userdebug&lkgb=8007224&lkbb=8008168&fkbb=8007902 >, bug b/210979001
Reverted Changes:
I0e7aa077a:Add VpnServiceBuilderShim for VpnService.Builder
Ib12f5ab39:Suppress NewApi warnings for @SystemApi -> public ...
I59b9185cf:Unhide RouteInfo#getType and related fields
Ie5b62b2b2:Unhide IpPrefix(InetAddress, int)
I993a32d40:Add CTS tests for exclude VPN routes APIs
Ib24b2d3fb:Suppress NewApi warnings for @SystemApi -> public ...
Ic3b10464a:Add APIs that allow to exclude routes from VPN

Change-Id: I89209357ab4bb206d206adcf9fd6d3498ce6ef4c
BUG: 210979001
2021-12-16 14:40:13 +00:00
Taras Antoshchuk
37479d8fcf Merge "Add APIs that allow to exclude routes from VPN" am: 55f030225b am: 1e2f898c30 am: 0cfd695f07 am: a5d20fcf3c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1619406

Change-Id: I6d0a62140e6d8c525bbf0114b52c3b196a97b9d4
2021-12-16 12:05:50 +00:00
Taras Antoshchuk
a5d20fcf3c Merge "Add APIs that allow to exclude routes from VPN" am: 55f030225b am: 1e2f898c30 am: 0cfd695f07
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1619406

Change-Id: If11e20ea47987c6017d52ee93489b6784af580ec
2021-12-16 12:04:23 +00:00
Taras Antoshchuk
0cfd695f07 Merge "Add APIs that allow to exclude routes from VPN" am: 55f030225b am: 1e2f898c30
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1619406

Change-Id: I982d3289d967d42954087e88628b2022982cb721
2021-12-16 11:49:25 +00:00
Taras Antoshchuk
55f030225b Merge "Add APIs that allow to exclude routes from VPN" 2021-12-16 11:13:33 +00:00
Rambo Wang
19384d89da Merge "Support CarrierService#notifyCarrierNetworkChange with subscription" am: eaa2a701cd am: c37af99d0a am: 48f89c249b am: 7f9a9fd489
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1897973

Change-Id: Ib1af4cc68a27a5ee5d7268b4122bc0f950d2428d
2021-12-16 01:34:36 +00:00
Dmitri Plotnikov
fa84b666d1 Merge "Fix MeasuredEnergyStats.reset() for per-process-state counters" 2021-12-16 01:26:35 +00:00
Rambo Wang
7f9a9fd489 Merge "Support CarrierService#notifyCarrierNetworkChange with subscription" am: eaa2a701cd am: c37af99d0a am: 48f89c249b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1897973

Change-Id: I612975482ce290deb3f0fd3d4999460e90aeae4b
2021-12-16 01:16:14 +00:00
Rambo Wang
48f89c249b Merge "Support CarrierService#notifyCarrierNetworkChange with subscription" am: eaa2a701cd am: c37af99d0a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1897973

Change-Id: Ic0a51db9174ef6f58af469b1cbeeab613b79836d
2021-12-16 00:56:07 +00:00
Bernardo Rufino
3d10fb4b83 Merge "Migrate unsafe parcel APIs in framework-minus-apex" 2021-12-15 19:15:58 +00:00
Bernardo Rufino
90bb3709dc Migrate unsafe parcel APIs in framework-minus-apex
Migrate the following unsafe parcel APIs in framework-minus-apex:
* Parcel.readSerializable()
* Parcel.readArrayList()
* Parcel.readList()
* Parcel.readParcelable()
* Parcel.readParcelableList()
* Parcel.readSparseArray()

This CL was generated by applying lint fixes that infer the expected
type from the caller code and provide that as the type parameter
(ag/16365240).

A few observations:
* In some classes we couldn't migrate because the class also belonged to
another build module whose min SDK wasn't current (as is the case for
framework-minus-apex), hence I suppressed the lint check
(since I'll eventually submit the lint check to the tree).
* In some cases, I needed to do the cast in
https://stackoverflow.com/a/1080525/5765705 to make the compiler happy
since there isn't another way of providing a class of type
Class<MyClassWithGenerics<T>>.
* In the readSerializable() case, the new API also requires the class
loader, that was inferred to by InferredClass.class.getClassLoader().
* Note that automatic formatting and import rely on running hooked up
to the IDE, which wasn't the case here.

Bug: 195622897
Test: TH passes
Change-Id: I11a27b9bdab7959ee86e90aa1e1cbebd7aaf883c
2021-12-15 18:21:38 +00:00
Treehugger Robot
9e9eb416f7 Merge "Fix an off-by-one bug in EditableInputConnection#endBatchEdit() return value" am: e908851af5 am: 0c024d11ed am: d9c2da8152
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1923058

Change-Id: I3ed9484befd715965561bd80d0de6498a5b2735e
2021-12-15 18:19:34 +00:00
Treehugger Robot
d9c2da8152 Merge "Fix an off-by-one bug in EditableInputConnection#endBatchEdit() return value" am: e908851af5 am: 0c024d11ed
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1923058

Change-Id: Icaa621b17c72031f0a767aaece8c96a92221fc82
2021-12-15 17:54:19 +00:00
Rambo Wang
241b1fa964 Support CarrierService#notifyCarrierNetworkChange with subscription
Current APIs does not include subId or phoneId to locate which
carrier network reported the change. A patch based on carrier
privilege were deployed in Q to temprarily fix the issue.

However, multiple subscriptions which all have the carrier
privileges will all get notified, even only one of them
has the real change.

To throughly resolve the issue, the subscription is introduced
in the API to distinguish which network actually has the change.

Bug: 131697791
Test: atest TelephonyRegistryManagerTest CarrierServiceTest
Change-Id: Ie7ee25f53da605c15e1a9228482cc8c4e7406d2a
2021-12-15 17:35:52 +00:00
Treehugger Robot
e908851af5 Merge "Fix an off-by-one bug in EditableInputConnection#endBatchEdit() return value" 2021-12-15 17:00:15 +00:00
TreeHugger Robot
9975e2c412 Merge "Add ACTION_SWITCH_DISPLAY_UNFOLD to LatencyTracker" 2021-12-15 14:34:40 +00:00
Dmitri Plotnikov
2cb00ccc8f Fix MeasuredEnergyStats.reset() for per-process-state counters
Bug: 191921016
Test: atest FrameworksCoreTests:MeasuredEnergyStatsTest
Change-Id: I8a05503a31d07535d5d14907c8b145dd3dc20491
2021-12-14 18:37:21 -08:00
Treehugger Robot
9fe54e87fc Merge "Allow renounce location permission" am: 373b687d96 am: 9bb03ffe7c am: 61569b3924
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1887652

Change-Id: I9af82e5d7dc806ffc42122e0849cbf854c220fde
2021-12-15 01:30:19 +00:00
Treehugger Robot
61569b3924 Merge "Allow renounce location permission" am: 373b687d96 am: 9bb03ffe7c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1887652

Change-Id: I1f8a4b7f8e4774a780b18cb9c6475293ea706f37
2021-12-15 01:16:33 +00:00
Treehugger Robot
373b687d96 Merge "Allow renounce location permission" 2021-12-15 00:35:20 +00:00
Yohei Yukawa
1fdc14b8a9 Fix an off-by-one bug in EditableInputConnection#endBatchEdit() return value
This is a follow up CL to our previous CL [1], which had an off-by-one
bug when determining the return value of

   EditableInputConnection#endBatchEdit().

According to the API document of InputConnection#endBatchEdit(), the
following test should pass.

   EditText editText = new EditText(context);
   EditorInfo editorInfo = new EditorInfo();
   InputConnection editableInputConnection =
           editText.onCreateInputConnection(editorInfo);
   assertThat(editableInputConnection.beginBatchEdit()).isTrue();
   assertThat(editableInputConnection.beginBatchEdit()).isTrue();
   assertThat(editableInputConnection.endBatchEdit()).isTrue();
   assertThat(editableInputConnection.endBatchEdit()).isFalse(); // (*)
   assertThat(editableInputConnection.endBatchEdit()).isFalse();

However, the last assertion marked with (*) actually fails due to an
off-by-one bug.  This CL finally fixes it.

The risk of app compat breakages because of fixing this long standing
bug is supposed to be low, mainly because:

 * the system has not relied on this return value yet.
 * Widgets like WebView have correctly implemented this API.
 * IME has always received true no matter what the app returned, which
   is the same behavior as other async InputConnection APIs.

This CL adds several notes to InputConnection#endBatchEdit() document
to help developers correctly implement and use this API.

 [1]: I1ec5518fdc16fb0551fbce9d13f5d92eb4bc78c0
      c478c171e9

Fix: 209958658
Fix: 210165648
Test: atest -c CtsInputMethodTestCases:EditTextImeSupportTest
Change-Id: Ibc40072fa11a4d6e3c24b8d7860c914ccdbcbc8a
Merged-In: Ibc40072fa11a4d6e3c24b8d7860c914ccdbcbc8a
(cherry picked from commit beda2b7f76)
2021-12-14 15:15:54 -08:00
Sooraj Sasindran
5d02dbb7bf Allow renounce location permission
Allow renounce location permission

Bug: 198533763
Test: CTS
Merged-In: I10872f34603441da2cf80f1f2976f3f3ca0ff6c2
Change-Id: I10872f34603441da2cf80f1f2976f3f3ca0ff6c2
2021-12-14 13:25:04 -08:00
Kalesh Singh
90f708dce6 Merge "Add system_server to readtracefs group" am: 3f73570646 am: 1802c2eb34 am: f3c80521cf am: 298efb93e7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1914167

Change-Id: I789acb585330d394dc85f770449d35c5f93958f7
2021-12-14 21:14:18 +00:00
Nicolo' Mazzucato
ea41bd1c52 Add ACTION_SWITCH_DISPLAY_UNFOLD to LatencyTracker
Thanks to this, we will be able to create a dashboard of the time needed to turn on the screen after unfolding the device.

Test: atest DeviceFoldStateProviderTest
Test: atest KeyguardViewMediatorTest
Test: atest UnfoldLatencyTrackerTest
Bug: 209963184
Change-Id: I078be6431e1053bd9658b5756ab2d54f6f28c630
2021-12-14 21:57:48 +01:00
Kalesh Singh
298efb93e7 Merge "Add system_server to readtracefs group" am: 3f73570646 am: 1802c2eb34 am: f3c80521cf
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1914167

Change-Id: Ia3cd14996f74a7b8f0a0b64402c7c1381bed9c56
2021-12-14 20:43:24 +00:00
Xin Li
85d715bac3 Merge "Merge Android 12 QPR1" 2021-12-14 20:25:23 +00:00
Kalesh Singh
f3c80521cf Merge "Add system_server to readtracefs group" am: 3f73570646 am: 1802c2eb34
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1914167

Change-Id: Ic8dcd91d0f980e0bb2afbe8e0f9e657a4e0f7d2f
2021-12-14 20:24:56 +00:00
Kalesh Singh
1802c2eb34 Merge "Add system_server to readtracefs group" am: 3f73570646
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1914167

Change-Id: Idb8d8c434d577e01d7d9a31e317022a6f25ebf90
2021-12-14 19:54:11 +00:00
Kalesh Singh
3f73570646 Merge "Add system_server to readtracefs group" 2021-12-14 19:37:02 +00:00
Dmitri Plotnikov
9bf5b2f104 Attribution of modem power per process state
Bug: 191921016
Test: atest FrameworksCoreTests:BatteryStatsTests

Change-Id: I43bde25785e246340dffe87a15fa960771fa1ec5
2021-12-14 10:23:03 -08:00
TreeHugger Robot
238f9d577d Merge "Fix an off-by-one bug in EditableInputConnection#endBatchEdit() return value" 2021-12-14 01:33:51 +00:00
Taras Antoshchuk
59073f0652 Add APIs that allow to exclude routes from VPN
Add new methods to VpnService.Builder that allow to specify network
routes that should bypass the VPN. Implemented by using RTN_THROW
routes.

Bug: 186082280
Test: atest HostsideVpnTests
Test: atest VpnServiceBuilderTest
Change-Id: Ic3b10464a53a8b56334589acec8f27acdc180ff7
2021-12-13 11:11:00 +01:00
Yohei Yukawa
beda2b7f76 Fix an off-by-one bug in EditableInputConnection#endBatchEdit() return value
This is a follow up CL to our previous CL [1], which had an off-by-one
bug when determining the return value of

   EditableInputConnection#endBatchEdit().

According to the API document of InputConnection#endBatchEdit(), the
following test should pass.

   EditText editText = new EditText(context);
   EditorInfo editorInfo = new EditorInfo();
   InputConnection editableInputConnection =
           editText.onCreateInputConnection(editorInfo);
   assertThat(editableInputConnection.beginBatchEdit()).isTrue();
   assertThat(editableInputConnection.beginBatchEdit()).isTrue();
   assertThat(editableInputConnection.endBatchEdit()).isTrue();
   assertThat(editableInputConnection.endBatchEdit()).isFalse(); // (*)
   assertThat(editableInputConnection.endBatchEdit()).isFalse();

However, the last assertion marked with (*) actually fails due to an
off-by-one bug.  This CL finally fixes it.

The risk of app compat breakages because of fixing this long standing
bug is supposed to be low, mainly because:

 * the system has not relied on this return value yet.
 * Widgets like WebView have correctly implemented this API.
 * IME has always received true no matter what the app returned, which
   is the same behavior as other async InputConnection APIs.

This CL adds several notes to InputConnection#endBatchEdit() document
to help developers correctly implement and use this API.

 [1]: I1ec5518fdc16fb0551fbce9d13f5d92eb4bc78c0
      c478c171e9

Fix: 209958658
Fix: 210165648
Test: atest -c CtsInputMethodTestCases:EditTextImeSupportTest
Change-Id: Ibc40072fa11a4d6e3c24b8d7860c914ccdbcbc8a
2021-12-10 16:38:49 -08:00