Commit Graph

24526 Commits

Author SHA1 Message Date
Cole Faust
22deef8d08 Merge "[conflict] Merge "Fix errorprone warnings that should be errors" am: 677d6cd780 am: f9df26ae3c am: d3c499dabc" 2022-11-16 03:17:38 +00:00
Michael Groover
e709cb858b Merge "Remove isInstrumenting workaround from receiver flag enforcement" 2022-11-16 02:21:42 +00:00
Jing Ji
cba1edbc25 Merge changes from topic "fgs_246792057_type"
* changes:
  Implement the foreground service type enforcement
  Introduce foreground service type enforcement
2022-11-16 02:03:28 +00:00
Michael Groover
2976761175 Remove isInstrumenting workaround from receiver flag enforcement
Android T added support to register a runtime receiver with a flag
indicating the receiver should not be accessible to other apps on
the device. To ensure developers could take advantage of this new
flag, receivers registering for non-system broadcasts and targeting
T+ were required to specify a flag indicating the exported state of
the receiver. While flags were being updated in the platform, an
isInstrumenting check was added that automatically flagged receivers
as exported if they were under instrumentation. This was intended
to allow additional time for these receivers to be flagged, but
this workaround caused issues to be missed with WebView and
potentially other components. Enforcement of this flag was punted
from T and is now in plan for U, but before enforcement is enabled,
this commit will remove the isInstrumenting workaround to ensure
tests run with the same behavior as the platform and any potential
issues can be caught earlier in the cycle.

Bug: 234659204
Test: atest CtsWebkitTestCases
Change-Id: Id24e15f951901b4d998f8301950d49bad53ca278
2022-11-15 15:34:56 -06:00
Nate Myren
e32609da00 Merge "Use chain start token in performOpTransaction" 2022-11-15 20:16:44 +00:00
Cole Faust
e4abcbec1d [conflict] Merge "Fix errorprone warnings that should be errors" am: 677d6cd780 am: f9df26ae3c am: d3c499dabc
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2256563

Change-Id: I84d67fdfcc99f9f6fca218d4264ab8e0bc1f1653
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-15 19:47:41 +00:00
Cole Faust
d3c499dabc Merge "Fix errorprone warnings that should be errors" am: 677d6cd780 am: f9df26ae3c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2256563

Change-Id: I8090e254f06a3b5fc7e9b23fdae6c5bd3db230c5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-15 19:37:15 +00:00
Cole Faust
f9df26ae3c Merge "Fix errorprone warnings that should be errors" am: 677d6cd780
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2256563

Change-Id: I0e9c5077610407a117ee34ff688b40b52e161a03
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-15 19:11:55 +00:00
Ruslan Tkhakokhov
a3da65d1e5 Merge "Make BackupRestoreEventLogger methods void" 2022-11-15 14:57:09 +00:00
Jing Ji
4826749a10 Implement the foreground service type enforcement
Currently it's warning only.

To test with it:
adb shell am compat enable FGS_TYPE_PERMISSION_CHANGE_ID \
    com.my.package.name
adb shell am compat enable FGS_TYPE_DATA_SYNC_DISABLED_CHANGE_ID \
    com.my.package.name

Bug: 246792057
Bug: 254662046
Test: atest CtsAppFgsTestCases
Change-Id: I87a112dc9f254e5ea3231bddaf7f542a19cb7604
2022-11-15 05:18:27 -08:00
Jing Ji
8e4ffc82c2 Introduce foreground service type enforcement
All foreground services are required to declare a type now, or
it'll get a ForegroundServiceTypeNotAllowedException if the app's
target SDK level is Android U or later.

Upon starting the foreground service, the app is required to
have been granted with the proper permissions which are required
by the foreground service types it's starting with.

Deprecated the type "none" and "dataSync", introduced new types:
"heath", "remoteMessaging", "systemExempted" and "specialUse".

The implementation of the enforcement will be in a follow up CL.

Bug: 246792057
Bug: 254662338
Test: atest CtsAppFgsTestCases
Change-Id: I54e60b443df8134653379a6ff13e00ed14d3f194
2022-11-15 05:18:24 -08:00
Jing Ji
69027e0b0e Merge changes If2245681,I943a6df6
* changes:
  Introduce the ForegroundServiceTypeNotAllowedException
  Add internal APIs to check if a given app has USB permission or not
2022-11-15 13:15:08 +00:00
Manjeet Rulhania
9ae00a02ad Merge "Add health connect read/write app-op" 2022-11-15 05:42:30 +00:00
Cole Faust
7da659bb6c Fix errorprone warnings that should be errors
This commit is part of a large scale change to fix errorprone
errors that have been downgraded to warnings in the android
source tree, so that they can be promoted to errors again.
The full list of changes include the following, but not all
will be present in any one individual commit:

BadAnnotationImplementation
BadShiftAmount
BanJNDI
BoxedPrimitiveEquality
ComparableType
ComplexBooleanConstant
CollectionToArraySafeParameter
ConditionalExpressionNumericPromotion
DangerousLiteralNull
DoubleBraceInitialization
DurationFrom
DurationTemporalUnit
EmptyTopLevelDeclaration
EqualsNull
EqualsReference
FormatString
FromTemporalAccessor
GetClassOnAnnotation
GetClassOnClass
HashtableContains
IdentityBinaryExpression
IdentityHashMapBoxing
InstantTemporalUnit
InvalidTimeZoneID
InvalidZoneId
IsInstanceIncompatibleType
JUnitParameterMethodNotFound
LockOnBoxedPrimitive
MathRoundIntLong
MislabeledAndroidString
MisusedDayOfYear
MissingSuperCall
MisusedWeekYear
ModifyingCollectionWithItself
NoCanIgnoreReturnValueOnClasses
NonRuntimeAnnotation
NullableOnContainingClass
NullTernary
OverridesJavaxInjectableMethod
ParcelableCreator
PeriodFrom
PreconditionsInvalidPlaceholder
ProtoBuilderReturnValueIgnored
ProtoFieldNullComparison
RandomModInteger
RectIntersectReturnValueIgnored
ReturnValueIgnored
SelfAssignment
SelfComparison
SelfEquals
SizeGreaterThanOrEqualsZero
StringBuilderInitWithChar
TreeToString
TryFailThrowable
UnnecessaryCheckNotNull
UnusedCollectionModifiedInPlace
XorPower

See https://errorprone.info/bugpatterns for more
information on the checks.

Bug: 253827323
Test: m RUN_ERROR_PRONE=true javac-check
Change-Id: I8446f9076a45ebf7e7ffa06cb0d4ddb1001b6c00
2022-11-14 17:57:30 -08:00
Nate Myren
efac4661cf Use chain start token in performOpTransaction
Bug: 258672042
Test: atest CtsPermission4TestCases
Change-Id: I1d484ed7c72d4ae73f4cbec47522a18ae9088f6e
2022-11-14 10:07:31 -08:00
Nate Myren
07f9a09965 Merge "Convert app op long[] bit BitSet" 2022-11-14 16:57:30 +00:00
Manjeet Rulhania
fdf43f3d27 Add health connect read/write app-op
Bug: 248587258
Test: manual
Change-Id: I19c35fde65677abd1a852971d1dae9ad12781373
2022-11-14 05:40:30 +00:00
Martynas Petuška
faab3ea858 wipeData/wipeDevice API!
Bug: 242193913
Test: Trigger wipeData via TestDPC

Change-Id: I1f03fe90b960e8a464aee0041d2514894cdb8495
2022-11-12 11:24:09 +00:00
Nate Myren
83743cc6c4 Convert app op long[] bit BitSet
Create a bitset that is a wrapper over a long[], that will expand as
app ops are added.

Fixes: 257138766
Test: presubmit
Change-Id: I1cb4411ec23ee5820ef32963f3c71fd5fc966786
2022-11-11 15:52:39 -08:00
Ruslan Tkhakokhov
731dede388 Make BackupRestoreEventLogger methods void
The return value does not provide much benefit. If a logging attempt is
rejected, the caller can't do anything to reverse this.

Bug: 252762060
Test: atest BackupRestoreEventLoggerTest
Change-Id: I321b8693489b0b92c3f6965dab79c56aecbf1a0f
2022-11-11 20:11:22 +00:00
TreeHugger Robot
9c8a7fd66e Merge "ClientTransaction: don't transport IApplicationThread." 2022-11-10 18:35:15 +00:00
Jeff Sharkey
e018c90fe6 Merge "Expand UiAutomation OWNERS to include IUiAutomation AIDL." am: 709357213d am: ae4b67dc4e am: d5251a46f2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2295981

Change-Id: If0c5c595429d9910f76cfc61dad1ee30fe162903
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-10 17:26:23 +00:00
Jeff Sharkey
d5251a46f2 Merge "Expand UiAutomation OWNERS to include IUiAutomation AIDL." am: 709357213d am: ae4b67dc4e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2295981

Change-Id: I408d368796c06c495ae26308474a5f34136bae8d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-10 16:54:24 +00:00
Jeff Sharkey
ae4b67dc4e Merge "Expand UiAutomation OWNERS to include IUiAutomation AIDL." am: 709357213d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2295981

Change-Id: I5c9ab1046ca79be349f7989fa6788cfd4c3da96f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-10 16:12:37 +00:00
Jeff Sharkey
709357213d Merge "Expand UiAutomation OWNERS to include IUiAutomation AIDL." 2022-11-10 15:46:10 +00:00
Jeff Sharkey
afbf69bef1 ClientTransaction: don't transport IApplicationThread.
This object is only needed for local in-process calls, and should
never be transported across process boundaries.

This change was made so that we have fewer custom implementations of
IApplicationThread to chase for OWNERS when adding new methods.

Bug: 257972988
Test: TH
Change-Id: I2ab7681cd812ed3ffb9dfb01f6d464fcd0ea81d6
2022-11-10 15:34:35 +00:00
Xiang Wang
ef40ef4380 Merge "Add owners to GameMode* files" am: 4ca2015e9f am: 644aaa561e am: 9599675847
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2292606

Change-Id: I8971bcf00991f921b162be6d0c75a70b8d959260
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-10 13:34:15 +00:00
Xiang Wang
9599675847 Merge "Add owners to GameMode* files" am: 4ca2015e9f am: 644aaa561e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2292606

Change-Id: Ia06103f0326c05fd8cef8e0e6a9e90e47ba10c7e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-10 13:00:09 +00:00
Jing Ji
91662e3f6d Introduce the ForegroundServiceTypeNotAllowedException
Bug: 254662240
Bug: 246792057
Test: CtsAppFgsTestCases from follow-up CLs
Change-Id: If2245681ed2d0ed76d956e3c5542bf99b287ba07
2022-11-09 23:15:36 -08:00
Bill Yi
3760f9b7db Merge "Merge TP1A.221105.002 to aosp-master - DO NOT MERGE" 2022-11-09 22:54:28 +00:00
Daniel Norman
686c971ece Expand UiAutomation OWNERS to include IUiAutomation AIDL.
Change-Id: I4cb112a47309d66be2c578740861004b505fda29
2022-11-09 22:13:03 +00:00
Xiang Wang
644aaa561e Merge "Add owners to GameMode* files" am: 4ca2015e9f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2292606

Change-Id: I73fb98159634a2f21df790e7cd1d84706276ff2d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-09 19:52:12 +00:00
Xiang Wang
4ca2015e9f Merge "Add owners to GameMode* files" 2022-11-09 19:18:55 +00:00
Chris Poultney
8e0eb90b06 Merge "Lock screen live wallpaper: add home/lock screen flag as argument." into tm-qpr-dev am: ff75ef23a2 am: 9d4472b7e8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20404658

Change-Id: Ie96cc874515754d956496be62bf6dd5fc8313586
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-09 16:45:17 +00:00
Chris Poultney
9d4472b7e8 Merge "Lock screen live wallpaper: add home/lock screen flag as argument." into tm-qpr-dev am: ff75ef23a2
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20404658

Change-Id: Ia1a2de7c9ac9c26c3768b3dc0b6586c2ffcfa4b5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-09 16:11:36 +00:00
Chris Poultney
ff75ef23a2 Merge "Lock screen live wallpaper: add home/lock screen flag as argument." into tm-qpr-dev 2022-11-09 15:46:08 +00:00
Bill Yi
0de01a9871 Merge TP1A.221105.002 to aosp-master - DO NOT MERGE
Merged-In: I7caa2e966bae2ec146ca77b36d2a467d746e2531
Merged-In: I361e8838571ab7b3f19778833b820f0b1b584d94
Merged-In: I361e8838571ab7b3f19778833b820f0b1b584d94

Change-Id: Ic9224a1948b26c8703a272aa3b26337e0586f3e3
2022-11-09 06:33:42 +00:00
Xiang Wang
1f24e88039 Add owners to GameMode* files
Bug: b/243448953
Test: n/a
Change-Id: I8f5dd5e01a16afea8d0d9c8133dd096287469fc8
2022-11-08 18:09:47 -08:00
Chris Poultney
ad3d3b20ec Lock screen live wallpaper: add home/lock screen flag as argument.
Adds home/lock screen flag to getWallpaperComponent methods. These
implementations are stubs and will be implemented in master.

Bug: 253481667
Test: TreeHugger
Change-Id: Ia032b78cfa3acb1895e9d74f1793859ef8468c20
2022-11-08 18:58:38 +00:00
Joanne Chung
cca384ebb2 Merge "Dump App exit reason if the remote service died." into tm-qpr-dev am: 055796e826
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20392455

Change-Id: I83fa75898fcd5894e4dcc8d659e5035b4afce60d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-08 11:15:12 +00:00
Jeff Sharkey
5c6533ce82 Merge "Add OWNERs for the android.app.ForegroundService*" am: 793ebebfe1 am: 946f42e249 am: 27fdefde74
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2290479

Change-Id: I1f25dcec3535ca2db1a7d85951c074e4c3c26231
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-08 00:29:08 +00:00
Jeff Sharkey
27fdefde74 Merge "Add OWNERs for the android.app.ForegroundService*" am: 793ebebfe1 am: 946f42e249
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2290479

Change-Id: Ia6a2f1a3f4a7c5bf0fbc094c6c54673f637fc706
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-07 23:39:37 +00:00
Jeff Sharkey
946f42e249 Merge "Add OWNERs for the android.app.ForegroundService*" am: 793ebebfe1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2290479

Change-Id: I2fa90b84a5bcdfb1d3f3d537e9f7ef08863734c0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-07 23:12:20 +00:00
Jing Ji
78e6de07b0 Add OWNERs for the android.app.ForegroundService*
Test: m
Change-Id: If7acf753b3bd9cbe2a6f07518e4a88ef552c379d
2022-11-07 14:16:05 -08:00
Joanne
908ee5ed9d Dump App exit reason if the remote service died.
We received many bugs the ContentCaptureService entered zombie
state but we don't know the reason why the process died. The issue
timing didn't be captured in bugreport.

Currently, the AbstractRemoteService will enter an odd state if the
service cannot be reconnected. This state does not allow the requests
be sent until the service be reconnected again on an unknown timing.
In some cases, it is expected the service will not be reconnected.
e.g. app stop from settings. We should fix the problem in the
AbstractRemoteService but before doing this, we try to add debugging
signal in bugreport to help us understand if the existing issues come
from this odd state for reasonable reasons.

The change was merged in master so skip automerge. The minor change
here will have a seperate change in master.

Bug: 248218072
Bug: 250859760
Test: disable app and dumpsys content_capture
Change-Id: Ia33462006a3925754001562b0d80540b9b0bc45d
Merged-in: Ia33462006a3925754001562b0d80540b9b0bc45d
(cherry picked from commit d060ed5697)
2022-11-07 12:40:48 +00:00
Sudheer Shanka
df26ea80c8 Merge "Deliver DEVICE_IDLE_MODE_CHANGED broadcasts as non-ordered." 2022-11-07 06:58:54 +00:00
Aaron Labiaga
8522d85bce Merge "Update setSourceRectHint documentation" 2022-11-04 17:51:38 +00:00
Josh Hou
6222869674 Merge changes from topic "clear_applocale_master"
* changes:
  [Panlingual] Clear per-app locales setting when the LocaleConfig is removed
  [Panlingual] Backup and restore the package name of per-app locales set from a delegate selector
2022-11-04 15:55:40 +00:00
Sudheer Shanka
c7e66035bb Deliver DEVICE_IDLE_MODE_CHANGED broadcasts as non-ordered.
They are currently being sent as ordered in order to receive
the finish callback. Since the modern broadcast queue supports
a finish callback with the need for the broadcasts to be ordered,
don't send these broadcasts as ordered anymore.

Bug: 256597397
Bug: 256597171
Bug: 253226131
Test: treehugger
Change-Id: I00a0dec0df99892b2d0f4a023efcc965a2061379
2022-11-04 03:58:11 -07:00
Alex Johnston
4ee7ff8072 Merge "Add forced app standby and app standby exemption app-ops to AppOpsManager" 2022-11-03 09:54:33 +00:00