Bug: 174932174
Test: I solemnly swear I tested this conflict resolution.
Exempt-From-Owner-Approval: refactoring with team leads buy-in
Change-Id: I9262a08ffc1ccede8e519d0eed90ed2bfcf0232c
As general background, OWNERS files expedite code reviews by helping
code authors quickly find relevant reviewers, and they also ensure
that stakeholders are involved in code changes in their areas.
Some teams under frameworks/base/ have been using OWNERS files
successfully for many years, and we're ready to expand them to cover
more areas. Here's the historical coverage statistics for the last
two years of changes before these new OWNERS changes land:
-- 56% of changes are fully covered by OWNERS
-- 17% of changes are partially covered by OWNERS
-- 25% of changes have no OWNERS coverage
Working closely with team leads, we've now identified clear OWNERS on
a per-package basis, and we're using "include" directives whenever
possible to to simplify future maintenance. With this extensive
effort, we've now improved our coverage as follows:
-- 98% of changes are fully covered by OWNERS
-- 1% of changes are partially covered by OWNERS
-- 1% of changes have no OWNERS coverage
This specific change is automatically generated by a script that
identifies relevant "include" directives.
Bug: 174932174
Test: manual
Exempt-From-Owner-Approval: refactoring with team leads buy-in
Merged-In: I3480ddf2fe7ba3dfb922b459d4da01fa17a2c813
Change-Id: I3480ddf2fe7ba3dfb922b459d4da01fa17a2c813
We've been writing many new framework-specific Error Prone checkers
to help detect obscure platform bugs, and this change starts enabling
those checkers for more packages across the platform.
Bug: 155703208
Test: manual
Exempt-From-Owner-Approval: trivial blueprint changes
Change-Id: I1db3412b0be40f6f78c68331ae01756887192071
Some functions were trying to get the UserHandle of a userId,
but were instead treating the userId as a uid, and thereby
getting the wrong UserHandle.
Bug: 162543841
Test: atest com.android.internal.app.ChooserActivityTest
Test: atest com.android.internal.app.ResolverActivityTest
Test: atest ScreenshotNotificationSmartActionsTest
Test: atest com.android.server.devicepolicy.DevicePolicyManagerTest
Change-Id: Ib977267e3bae0aa3c7b6b31cfe8f0b3f9cc884b1
This is just a plain refactoring: the removed methods in the changed
classes were called by default by the new methods in the superclass
(SystemService).
Test: m
Test: atest NotificationManagerServiceTest BackupManagerServiceRoboTest
Fixes: 161943081
Exempt-From-Owner-Approval: refactoring without side-effects
Change-Id: Ifd8df592eb4494cc0922b7e0b2ff20187b8a8b3e
Over the years we've had several obscure bugs related to how SDK level
comparisons are performed, specifically during the window of time
where we've started distributing the "frankenbuild" to developers.
Consider the case where a framework developer shipping release "R"
wants to only grant a specific behavior to modern apps; they could
write this in two different ways:
1. if (targetSdkVersion > Build.VERSION_CODES.Q) {
2. if (targetSdkVersion >= Build.VERSION_CODES.R) {
The safer of these two options is (2), which will ensure that
developers only get the behavior when *both* the app and the
platform concur on the specific SDK level having shipped.
Consider the breakage that would happen with option (1) if we
started shipping APKs that are based on the final R SDK, but are
then installed on earlier preview releases which still consider R
to be CUR_DEVELOPMENT; they'd risk crashing due to behaviors that
were never part of the official R SDK.
Bug: 64412239
Test: ./build/soong/soong_ui.bash --make-mode services RUN_ERROR_PRONE=true
Exempt-From-Owner-Approval: trivial blueprint changes
Change-Id: Ia20181f8602451ac9a719ea488d148e160708592
java.util.Objects.requireNonNull
Removing variable self assignments. This wasn't an issue with
checNotNull because of difference in input and output types, but
requireNonNull doesn't add any attributes.
Bug: 126528330
Test: Treehugger
Change-Id: I6dc5c489ceec1f118bf7f3c21c3206f0b4477f70
onServiceDisconnected() and unbindLocked() both
are responsible to make mRemoteInstanceas null,
so ensure that the service is not unbinded already
while calling onServiceDisconnected()
Fixes:111631529
Test: Build Successful and device Running.
Change-Id: I505d97e32c4e76f06a358850e91fe189bf02654c
Most functionality works, but the PrintActivity cannot directly interact
with the instant service.
As instant services should only appear in tests this functionality needs
to be enabled via shell commands.
Fixes: 79484768
Test: cts-tradefed run commandAndExit cts-instant-dev -m CtsPrintTestCases
cts-tradefed run commandAndExit cts-dev -m CtsPrintTestCases
Change-Id: Ie4663c72b8c0f959b5d172ef28875479d120e386
Work profile uses the same instance of PrintManager and DPM
as the primary user. We have to explicitly check restriction for calling user.
Bug: 73768054
Test: Set restriction in Work profile, check that it applies only in work profile.
Change-Id: Iaa63ce000fc84b7d0ee2bd0ff008f1c0f7272a87
This guarantees that the print job is created before the print activity
deals with it.
Test: CtsPrintTestCases
Change-Id: I3451fff71bd981beb45882b7b42d4cc49d63a91c
Fixes: 73127052
Add @GuardedBy for simple functions that require a single lock
and are named XYZLocked.
Derived by errorprone.
Bug: 73000847
Test: m
Test: m javac-check-framework RUN_ERROR_PRONE=true
Change-Id: Id1d9fbe5018250e3b9d1466fc5f670d5ad902fa3
Use existing API instead of creating new method.
Bug: 64140119
Test: cts-tradefed run cts-dev --module CtsDevicePolicyManagerTestCases --test com.android.cts.devicepolicy.MixedDeviceOwnerTest#testPrintingPolicy
Change-Id: I9ff94f4d73824e7bf9aedbb64811ad60fccf9779
This allows to dump the USB state as proto-buf. This in turn allows to
automatically process this data.
Test: adb shell dumpsys usb
incident_report usb
No automated test possible as no field is guaranteed to be set
Change-Id: Ifdf22bfaf9c78226c420b11c43278013ce69f849
Sometimes app inside profile can't get package info for its owner.
Instead of relying on calling user id, we make PrintManagerService switch to
system id and pass user that called print() explicitly.
Bug: 72309652
Test: cts-tradefed run cts-dev --module CtsDevicePolicyManagerTestCases --test com.android.cts.devicepolicy.MixedDeviceOwnerTest#testPrintingPolicy
Test: cts-tradefed run cts-dev --module CtsDevicePolicyManagerTestCases --test com.android.cts.devicepolicy.MixedManagedProfileOwnerTest#testPrintingPolicy
Test: cts-tradefed run cts-dev --module CtsDevicePolicyManagerTestCases --test com.android.cts.devicepolicy.MixedProfileOwnerTest#testPrintingPolicy
Test: bit FrameworksServicesTests:com.android.server.devicepolicy.DevicePolicyManagerTest
Change-Id: Ib97018f56693549fbca506dba6efaadb6dd010b3
This adds a new "isPrintingEnabled" policy (true by default)
and hooks it into PrintManagerService.
Bug: 64140119
Test: manual
Change-Id: Ifb0f6772af51e6185135e9dcf5551e9ef0d88af3
Beside addressing the comments on this change, this adds a check that
the token in end( is correct and prints a message if not. This is useful
when creating new dumping methods.
Test: adb shell dumpsys print
Change-Id: Ic2e6152cbd82f98d9d305a15edffc69c55fd1fd3
Add a class DualDumpOutputStream that maps proto-dump commands onto
print writer commands.
The effect of this is that there is only one - very proto dump like -
way to dump the print manager which is much easier to maintain.
The DualDumpOutputStream tries to produce a result similar to the
incident-report tool.
Test: adb shell dumpsys print
Change-Id: I1f0c56651eaa59f0ce90cdb08c71e89a96c48dd4
See build/soong/README.md for more information.
Test: m checkbuild
Change-Id: I417409281c928ea667d937090d2a0d9d72a449a2
Merged-In: I417409281c928ea667d937090d2a0d9d72a449a2
Exempt-From-Owner-Approval: trivial conversion
(cherry-picked from commit e0b2ee52d2f274a2d46b2e6695e42d2764c39fa7)
See build/soong/README.md for more information.
Test: m checkbuild
Exempt-From-Owner-Approval: trivial conversion
Change-Id: I417409281c928ea667d937090d2a0d9d72a449a2
This introduces PooledLambda - a way of obtaining lambdas without the
allocations overhead.
See PooledLambda javadoc for a guide and PooledLambdaSample for code samples
of useful usages.
Test: ensure samples of PooledLambdaSample work as described.
Change-Id: I46f8ad27bc1de07e19f6e39f89d2cafe4238497a
Symptom:
Global reference table overflow happens on system_server.
Root cause:
When a listener is added to the PrintManager, death notification for
the listener is registered. So the listener is added to global
reference table.
But the death notification is not unregistered when the listener is
removed from PrintManager. The listener isn't removed from the global
reference table until client process die. If client process repeatedly
add/remove listener, the global reference table overflow.
Solution:
Call unlinkToDeath() when the listener is removed from PrintManager.
Test: cts-tradefed run cts-dev -m Print
Bug: 68746445
Change-Id: I0b133e4607317a15e51bdf6e1248552dcc920d6d
This causes ANRs as we are trying to the the print spooler connection
while holding a lock that can also be aquired on the system server's
main thread.
Fixes: 63159459
Test: cts-tradefed run singleCommand cts-dev -m Print
adb shell dumpsys print
incident_report print
Change-Id: I228fc5ddc10c1c89f61e8a6d8eb8ea9e384197a8
We should only need to prune services if the package that changed
had a print service or has been changed to have a print service.
Bug: 63019430
Test: Manual; observed that the print spooler isn't started up.
Test: run cts -m CtsPrintTestCases
Change-Id: I32df27e4b1d11615cf6053dd3d35c2b60068d0d3
The permission is preinstalled as we want to leave the PrintSpooler
unpriviledged.
Test: Checked that Settings, PrintSpooler and BuiltInPrintService still
behave as expected.
Fixes: 62350107
Change-Id: Id33896f2899533f2d05cafa926df29cf1c6bfa77
Apps with a normal UID are typically isolated enough to not require
socket tagging; we're mostly interested in tracking down internal
UIDs that have lots of code sharing the same UID.
Also fix up everyone doing manual string checks of Build.TYPE, since
we now have first-class fields for those.
Bug: 38126076
Test: builds, boots
Change-Id: I3a40348196bd8459289f2b9355d9783a07f1e7dd
As in the change: I4f4cdaba65132dc2ef054877cbb097b499a723f6
the lock object is removed when calling RemotePrintSpooler
and so as it in the method prunePrintService(). But in the
constructor of UserState, the mLock is still held when calling
prunePrintService(), it may also block the main thread
It is better to take it out of the synchronized block
Test: null
Change-Id: I709b491d611dbcbf21a5fd493b879ed290dd0247
Signed-off-by: yangbingqian <yangbingqian@xiaomi.com>
Test: 1. Trigger the confitrmation dialog.
Ensure it looks exactly like the one from settings.
2. Call an API without associating the appa first
Ensure exception is thrown with a message mentioning the need to associate 1st
Change-Id: I94d4116e1988db869ed445ae3fd018c50590e3f4
There mas a missing defensive copy causing false positive detections of
"associations not changed" case, leading to xml file not being updated once
at least one record is present
Bug: 30932767
Test: Associate at least two different devices and ensure the xml has both.
Change-Id: Ic0dc615dd2b847e137555c1084c616831b4dde83
This effectively treats chooser activity pause event as cancel.
Bug: 30932767
Test: Install two toy apps and call associate API from both.
Ensure foreground app always end up showing fresh data.
Change-Id: I7f5742e9878245550f678efd244bf84c427baef3
Bug: 30932767
Test: ensure getAssociations works as before
Change-Id: I58dc4dac5bf7aae83fe3611890116a928e290a43
(cherry picked from commit 544d714626db38714f826a31a5483c647510a743)