439825 Commits

Author SHA1 Message Date
David Su
dcaf6e22b4 TetheringTests: Stop using @hide Wifi P2P APIs
Instead use Mockito to achieve the same thing.

Bug: 138801922
Test: atest TetheringTests
Change-Id: I41edd697017f4ce59e6707302bebc0da3d75831d
Merged-In: I41edd697017f4ce59e6707302bebc0da3d75831d
2020-01-13 13:15:14 -08:00
Treehugger Robot
93db49faec Merge "Add Callback for Registration Failure" 2020-01-13 20:58:00 +00:00
Philip P. Moltmann
843ab85dbf DO NOT MERGE Don't throw exception in AppOpsManager.checkOp
In Q we handled the case where the op does not match the package name by
returning the default state. NoteOp and StartOp returned errored.

Fix up these scenarios.

Test: - atest CtsAppOpsTestCases
      - backported new test to Q to verify the behavior is the same in Q
        and master
Bug: 132885449
Bug: 146463528
Bug: 146590200
Change-Id: I5b94e92af759580f2d2644ece49f159bd006b31c
2020-01-13 12:41:22 -08:00
Philip P. Moltmann
01883f3d02 DO NOT MERGE Remove unnecessary internal APIs.
Test: Built
Bug: 146463528
Bug: 146590200
Change-Id: I5391ac4989d7d5712982f5608f9fc28cf7935b00
2020-01-13 12:41:17 -08:00
Philip P. Moltmann
802ef29d58 DO NOT MERGE SetMode: Don't call into PM with AppOps lock held
In the setmode paths do not call into package manager with the app-ops
lock held. Otherwise we might get dead-locks then someone calls into
app-ops manager with the package manager lock held.

Test: Booted and saw no errors from the changed code
Bug: 124731615
Bug: 146463528
Bug: 146590200
Change-Id: If074bed1bd246a81791a7d9fd656f42f1a755495
(cherry picked from commit ec142a52fe6da0a18a1274249ae452cc5a8669fa)
2020-01-13 12:41:07 -08:00
Neil Fuller
b85d31d459 Remove wake lock checks from TimeDetectorStrategy
Remove wake lock checks from TimeDetectorStrategyCallbackImpl since
they're no longer valid in all cases. Originally the code that performed
time calcs were the only callers but that first changed in commit
312da9b9fcb65 and since then calls have been added to dumpsys too.

Bug: 140712361
Bug: 147585410
Test: boot
Change-Id: I725699d81815eedc570d648dde7ed425009fb3bd
2020-01-13 20:35:28 +00:00
Neil Fuller
49c903a0d2 Merge "Make NtpTrustedTime safer / expand docs" 2020-01-13 20:19:11 +00:00
Neil Fuller
99d116cbbb Merge "Remove android.telephony.action.NETWORK_SET_TIME" 2020-01-13 20:04:54 +00:00
Meng Wang
eef767427c telephony/common/* should use android.util.Log
Bug: 144374158
Test: make
Merged-In: Iec082f0c0256d4e8f9cdbb2ebaf7425227f2299c
Change-Id: Iec082f0c0256d4e8f9cdbb2ebaf7425227f2299c
2020-01-13 11:37:56 -08:00
Treehugger Robot
5212ff1bf3 Merge "Migrate legacy dhcp server config to DeviceConfig" 2020-01-13 19:12:25 +00:00
Aaron Heuckroth
edabed7fb7 Merge "Change layout of ToggleAction for GlobalActionsDialog" 2020-01-13 18:45:05 +00:00
Meng Wang
6d3e821058 Use com.android.telephony.Rlog for mainline module.
Bug: 144374158
Test: make
Merged-In: I86a479affb8e0fa8e48734324a6a05c68230d910
Change-Id: I86a479affb8e0fa8e48734324a6a05c68230d910
2020-01-13 10:32:55 -08:00
Treehugger Robot
ab9527a44b Merge "Replace setCapability usage in Tethering" 2020-01-13 17:56:25 +00:00
Andrei Onea
0dfee62845 Tweak compat change override policy
Allow enabling and disabling non-target sdk compat changes on debuggable
apps, beta/preview builds.

Bug: 144552011
Test: atest OverrideValidatorImplTest
Change-Id: I1c0ed2d9cd77b02209e43d919d135c3c377cb35c
2020-01-13 17:56:07 +00:00
Aaron Huang
8e5e8c9815 Make NattKeepalivePacketData @SystemApi
Bug: 139268426
Bug: 135998869
Test: atest FrameworksNetTests

Change-Id: I687f1a8a4b82cb7e4a0dfeb24f0b23a4de6d5287
2020-01-14 01:45:28 +08:00
Artur Satayev
ffd7f95db9 Use android.compat.annotation.UnsupportedAppUsage everywhere.
The new annotation replaces existing two annotations in libcore/ and frameworks/base/. This helps avoid human confusion and allows better and correct tool support.

Bug: 145132366
Test: m
Change-Id: I9078b124ddf0273250c645fe17f27088092c8b18
2020-01-13 17:37:52 +00:00
Mark Chien
2a27a6ade1 Merge "Add config_tether_* and entitlement resources" 2020-01-13 17:19:02 +00:00
Calvin Pan
2d83e92bbd Merge "[Telephony Mainline] Add new api for Mvno matching" 2020-01-13 16:54:50 +00:00
Neil Fuller
845146b012 Make NtpTrustedTime safer / expand docs
This commit makes a number of changes:
1) Documents / enforces thread safety, removes or deprecates unsafe
check-then-do methods / adds a way to get the NTP query result
atomically.
2) Delays configuration lookup until point of use: the config can change
due to various possible config overlays, e.g. MCC-based config.

(1) is because the threading model is currently unclear / possibly
unsafe - it looks like NtpTrustedTime is supposed to be single threaded
but it's also a singleton so could be accessed from multiple threads.
If NtpTrustedTime were not a singleton things might be easier but the
@UnsupportedAppUsage makes it difficult to change now.
(2) is to address the same issue as https://r.android.com/1182530,
contributed by Luca Stefani.

Bug: 140712361
Test: build only
Merged-In: Ie09da9db5d853b59829886a020de21a88da5dd51
Change-Id: Ie09da9db5d853b59829886a020de21a88da5dd51
(cherry picked from commit 65f0f31bdee65d1bbe76fcd14a13151a476a51ec)
2020-01-13 16:54:14 +00:00
markchien
5e50b948d2 Replace setCapability usage in Tethering
Bug: 147413518
Test: build, flash, boot
Change-Id: I7abec2d7cf03d0675749e8379d624504ceb3d9af
2020-01-13 23:34:20 +08:00
Aaron Huang
c4081b2898 Add net-utils-framework-common-srcs to framework
Bug: 139268426
Bug: 135998869
Bug: 138306002
Bug: 143925787
Test: atest NetworkStaticLibTests
      atest FrameworksNetTests
      atest FrameworksTelephonyTests
      ./frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Change-Id: Ic7b5b07f0e95068eb53f54ced1fbc52743a7a5cd
2020-01-13 23:33:35 +08:00
Treehugger Robot
e57a8f338f Merge changes I5f425928,I397d361f
* changes:
  Define stubs_defaults for the new API surfaces
  Add SystemApi params to framework-module defaults
2020-01-13 15:31:42 +00:00
Treehugger Robot
f828b6c71d Merge "Add API stubs for module APIs" 2020-01-13 15:11:28 +00:00
markchien
2dfee023c9 Migrate legacy dhcp server config to DeviceConfig
Legacy dhcp server can also be enabled by resource config.

Bug: 144814607
Test: -build, flash, boot
      -atest TetheringTests

Change-Id: I8ae5fa3d5bbd88129bd0890f71be6f8a1bfec0eb
2020-01-13 15:07:03 +00:00
markchien
dcc69629f1 Add config_tether_* and entitlement resources
Copies config_tether_* and entitlement resources from
framework/base/core/res to tethering package. Will have
follow up changes to move overlay and switch tethering to
use this internal resource. duplicated resource in framework
will be removed after fixing all of users(e.g. test, TetherUtil,
Settings, ....).

Bug: 147399354
Test: build

Change-Id: I2a77e5070d53566d5ec3697358a6dbbebb4ff59f
2020-01-13 15:03:11 +00:00
Treehugger Robot
a5dd35d6c0 Merge "mainline:Replace serviceState.getDataRegState and getVoiceRegState" 2020-01-13 14:45:28 +00:00
Treehugger Robot
b2c3eaaf10 Merge "Use new UnsupportedAppUsage annotation." 2020-01-13 14:27:29 +00:00
Junyu Lai
432f29f770 Merge changes from topic "sp04"
* changes:
  [SP05] add unit test for onStatsProviderLimitReached in NPMS
  [SP04] add unit test for NetworkStatsProvider
  [SP03] support registerNetworkStatsProvider API
  [SP03.1] Replace com.android.internal.util.Preconditions.checkNotNull
2020-01-13 14:09:52 +00:00
Treehugger Robot
89ac95017f Merge "Use new UnsupportedAppUsage annotation." 2020-01-13 13:35:38 +00:00
satayev
e1432f59ee Merge "Use new UnsupportedAppUsage annotation." 2020-01-13 13:09:36 +00:00
Treehugger Robot
9938c70fb5 Merge "Use new UnsupportedAppUsage annotation." 2020-01-13 13:05:17 +00:00
Treehugger Robot
70a89435e7 Merge "Use new UnsupportedAppUsage annotation." 2020-01-13 13:04:48 +00:00
Jiyong Park
2e6cdcc524 Add API stubs for module APIs
The following two stub libraries are added:

- android_module_app_stubs_current: @SystemApis that are available for
modules implemented as apps. @SystemApis with client=PRIVILEGED_APPS
and client=MODULE_APPS are included here.

- android_module_lib_stubs_current: @SystemApis that are available for
modules implemented as bootclasspath jars. @SystemApis with
client=PRIVILEGED_APPS, MODULE_APPS, and MODULE_LIBRARIES are all
included here.

For now, the compatibility check against the last release API is not
done, but this is not a problem because this is the first time these
APIs are released.

Exempt-From-Owner-Approval: cherry-pick from internal

Bug: 139391334
Bug: 140202860
Bug: 146727827
Test: m

Merged-In: I0254a5f7751c58029fa7a8d5c342b731a7deb69a
Change-Id: I0254a5f7751c58029fa7a8d5c342b731a7deb69a
(cherry picked from commit e309516406a1ec2ce095713cc3adfacdedbcbefe)
2020-01-13 21:42:24 +09:00
Artur Satayev
bc3d8b9071 Use new UnsupportedAppUsage annotation.
Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library.

Bug: 145132366
Test: m && diff unsupportedappusage_index.csv
Change-Id: I534e3fd1305e2f4af076986770033478448a665c
Merged-In: I534e3fd1305e2f4af076986770033478448a665c
2020-01-13 12:39:59 +00:00
Jiyong Park
7be934f395 Define stubs_defaults for the new API surfaces
The new stubs_defaults shall be used to create stub libraries from
modules. The existing defaults
'framework-module-stubs-defaults-systemapi' is not enough because it
only captures the SystemApis with client=PRIVILEGED_APPS. Modules can
have broader SystemApis with client=MODULE_APPS and
client=MODULE_LIBRARIES.

Exempt-From-Owner-Approval: cherry-pick from internal

Bug: b/140202860
Test: m
Merged-In: I5f425928cf1db912ebe09499111a9925fcfc98fb
Change-Id: I5f425928cf1db912ebe09499111a9925fcfc98fb
(cherry picked from commit 2afff6cc73641dd11315e116f2f1f21ae4e64c56)
2020-01-13 21:34:50 +09:00
Anton Hansson
cfa5532127 Add SystemApi params to framework-module defaults
As was done in I3305b71e22970e80db95f3daf3d7713603c7d68d for
the other metalava args.

Exempt-From-Owner-Approval: cherry-pick internal

Bug: 140202860
Test: m
Merged-In: I397d361f649f179eada827782d82c002cc7fb2d3
Change-Id: I397d361f649f179eada827782d82c002cc7fb2d3
(cherry picked from commit 14c80cf363c6f657783969e64eef9c3a3619d753)
2020-01-13 21:34:16 +09:00
Lorenzo Colitti
ac08994fde Merge changes I0c45635b,I2201d0e4
* changes:
  Remove SystemMessageProto usage
  Replace PendingIntent/NotificationManager @hide APIs
2020-01-13 12:04:44 +00:00
Treehugger Robot
3e1548f5a5 Merge "Replace SystemNotificationChannels on Tethering" 2020-01-13 09:10:36 +00:00
Neil Fuller
260b1ba2db Remove android.telephony.action.NETWORK_SET_TIME
Remove the now-unused android.telephony.action.NETWORK_SET_TIME
intent.

Bug: 140712361
Test: treehugger
Test: atest com.android.server.timedetector
Merged-In: Ifa64d0dfa82a2db7742c0b3fcc76ad73b231a9f9
Change-Id: Ifa64d0dfa82a2db7742c0b3fcc76ad73b231a9f9
2020-01-13 09:05:15 +00:00
Jack Yu
4f44abe8e9 New system api to get UICC terminal based on slot number
Bug: 139701995
Test: Manual
Change-Id: Ia25293ef59c6a920cd683cf59bb25022a0bcfa56
2020-01-13 16:29:50 +08:00
paulhu
821a6fe68c Remove SystemMessageProto usage
Tethering can use SystemMessageProto which is @hide Class. Hence,
use drawable resource id to replace SystemMessageProto usage.

Bug: 122085773
Test: atest TetheringTests
Change-Id: I0c45635b52f86a261e1ac7aaaa9b2cc3a256c222
2020-01-13 15:48:08 +08:00
Treehugger Robot
1fe83df53a Merge "Do not throw exception when there is no omapi reader supported" 2020-01-13 07:43:56 +00:00
paulhu
57f215d97d Replace PendingIntent/NotificationManager @hide APIs
Tethering used some PendingIntent/NotificationManager @hide APIs
but they are not able to call now. Replace them with similar
System APIs.

Bug: 122085773
Test: atest TetheringTests
Change-Id: I2201d0e44a6356b8b1974ce0ed80d9913a7aeff5
2020-01-13 15:29:12 +08:00
paulhu
e5b7ec0100 Replace SystemNotificationChannels on Tethering
Tethering used SystemNotificationChannels for showing
notification before. But SystemNotificationChannels is used for
system package only, tethering package is not able to use it now.
Thus, replace it with tethering own notification channel.

Bug: 122085773
Test: atest TetheringTests
Change-Id: I854a102795c19351a4137360414926c461cc604c
2020-01-13 15:28:18 +08:00
Zoey Chen
484a87ee98 Merge "[TelephonyMainline] Cannot use UnsupportedAppUsage API" 2020-01-13 07:09:54 +00:00
junyulai
4935995a05 [SP05] add unit test for onStatsProviderLimitReached in NPMS
Test: atest NetworkPolicyManagerServiceTest
Bug: 130855321
Change-Id: I4ec177fedea816a9403422faef015009f2e1bb6d
2020-01-13 14:43:06 +08:00
junyulai
9ff7b4ed81 [SP04] add unit test for NetworkStatsProvider
Test: atest NetworkStatsServiceTest
Bug: 130855321
Change-Id: I0c19d8bedcb9398da3f464efe01e775fde9f8a78
2020-01-13 14:43:06 +08:00
junyulai
80831d2ff3 [SP03] support registerNetworkStatsProvider API
This change provides an API that allow external modules to
register a custom provider of NetworkStats to merge the
network statistics that cannot be seen by the kernel to system.

Test: atest FrameworksNetTests CtsUsageStatsTestCases
Test: atest NetworkPolicyManagerServiceTest
Test: m doc-comment-check-docs
Bug: 130855321

Change-Id: I265bc637c40666cde505fde5056d2d9bfc5fb204
2020-01-13 14:43:03 +08:00
junyulai
232b2edcfb [SP03.1] Replace com.android.internal.util.Preconditions.checkNotNull
Extracted from ag/9990011 to make NetworkStatsManager sync with internal
line, given that it is missing in aosp/1198084.

Bug: 126528330

Test: Treehugger
Change-Id: I77f50326869799f51d4636cb7c6d7c97daf531e6
Merged-In: I42117ebfb640e3b0b133183e5e146860bed8471a
2020-01-13 14:42:37 +08:00
Chiachang Wang
207b6cff26 Support reevaluation request from captive portal app
CaptivePortalLogin use similar way to validate the network as
NetworkMonitor. Provide API to reuse NetworkMonitor facilities
for consistent captive portal detection.

Bug: 134892996
Test: atest FrameworksNetTests NetworkStackTests NetworkStackNextTests
Test: manually test with captive portal Wi-Fi
Test: make system-api-stubs-docs-update-current-api \
      test-api-stubs-docs-update-current-api
Change-Id: I6f039eae7ceb18eb6c3cf15587cdc27a7fe35b00
2020-01-13 14:28:02 +08:00