Instead use Mockito to achieve the same thing.
Bug: 138801922
Test: atest TetheringTests
Change-Id: I41edd697017f4ce59e6707302bebc0da3d75831d
Merged-In: I41edd697017f4ce59e6707302bebc0da3d75831d
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
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)
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
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
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)
Legacy dhcp server can also be enabled by resource config.
Bug: 144814607
Test: -build, flash, boot
-atest TetheringTests
Change-Id: I8ae5fa3d5bbd88129bd0890f71be6f8a1bfec0eb
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
* 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
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)
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
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)
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)
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
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
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
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
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
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