Commit Graph

9378 Commits

Author SHA1 Message Date
Svetoslav Ganov
8fb897acef Merge "Prepare AttributionSource to expose to native" into sc-dev am: 720add59c7
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14381260

Change-Id: I14f40269541872bf807f669283da9a6f3d722f97
2021-05-05 23:44:49 +00:00
Svetoslav Ganov
720add59c7 Merge "Prepare AttributionSource to expose to native" into sc-dev 2021-05-05 23:23:54 +00:00
Songchun Fan
df98c1d295 Merge "[incremental] report new metrics from Incremental Service" into sc-dev am: e749b4b2c4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14426986

Change-Id: Ib67a318d1a1c8d2e4d95d83576aecfe582a19894
2021-05-05 00:17:57 +00:00
Songchun Fan
e749b4b2c4 Merge "[incremental] report new metrics from Incremental Service" into sc-dev 2021-05-05 00:09:59 +00:00
Songchun Fan
0dc7772746 [incremental] report new metrics from Incremental Service
BUG: 184844615
Test: atest service.incremental_test
Change-Id: Ibbfe68851a4adfd620db9652f1fda550a3c6fb2c
2021-05-04 15:14:34 -07:00
Corina Grigoras
74007b883e Merge "Revert "Restore file truncation where expected."" into sc-dev am: df2e7b8839
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14425891

Change-Id: I01155a267163a02d09ea8232b4fce5e0bcbc8dc4
2021-05-04 20:03:14 +00:00
Corina Grigoras
df2e7b8839 Merge "Revert "Restore file truncation where expected."" into sc-dev 2021-05-04 19:53:57 +00:00
Zimuzo Ezeozue
86f8c415ed Merge "Reduce log severity for transcode fd conversion failure" into sc-dev am: 4bd44ce7aa
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14424423

Change-Id: I9557d62b276f065a6bd931c28f770af68ed9c30e
2021-05-04 16:34:58 +00:00
Zimuzo Ezeozue
4bd44ce7aa Merge "Reduce log severity for transcode fd conversion failure" into sc-dev 2021-05-04 16:28:49 +00:00
Inseob Kim
f6af5c4bd7 Merge "Add an api for platform sepolicy version to vintf" am: 3ea60e26f5 am: 5c50929036 am: 77b8f5858f am: 0bc6f0f6be
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1689587

Change-Id: I6604d6d951bf838faa55180ee94720cfe93629d8
2021-05-04 16:28:17 +00:00
Inseob Kim
0bc6f0f6be Merge "Add an api for platform sepolicy version to vintf" am: 3ea60e26f5 am: 5c50929036 am: 77b8f5858f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1689587

Change-Id: I540e6e54f2a345372dd2e95a2eaeecb32afe747b
2021-05-04 16:21:02 +00:00
Inseob Kim
77b8f5858f Merge "Add an api for platform sepolicy version to vintf" am: 3ea60e26f5 am: 5c50929036
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1689587

Change-Id: I88e2475ed84a11cb88995dc1cc33c9398a217507
2021-05-04 15:59:50 +00:00
Corina Grigoras
3fcb12e221 Revert "Restore file truncation where expected."
Revert "Restore file truncation where expected."

Revert submission 14173486-rwt

Reason for revert: b/186862362 - breaks ContentResolverWrapTest
Reverted Changes:
I41bc298af:Restore file truncation where expected.
Iacec49164:Restore file truncation where expected.

Bug: 186862362
Change-Id: I2afe5e2334cff60c4e7220267095042a60909185
2021-05-04 15:39:40 +00:00
Inseob Kim
4055ce5313 Add an api for platform sepolicy version to vintf
PLATFORM_SEPOLICY_VERSION will be the latest version in system's
compatibility matrix. This change adds a function
getPlatformSepolicyVersion, which ultimately gets
PLATFORM_SEPOLICY_VERSION, just like getSepolicyVersion for vendor.

This will be used from the SELinux CTS.

Bug: 186596569
Test: atest CtsSecurityHostTestCases:android.security.cts.SELinuxNeverallowRulesTest
Change-Id: Ic7863ece9413b9a6a4a91ff42d3121935823fe8b
2021-05-04 12:53:52 +00:00
Zim
741868b354 Reduce log severity for transcode fd conversion failure
Converting a transcode fd to the original fd might fail for the more
common reason that the fd is already original.

Now, we log as DEBUG instead of WARNING

Test: m
Bug: 186672282
Change-Id: Ifd0b3cef901ae1c2f467ace06dca590dff8ffb04
2021-05-04 12:44:31 +00:00
Svet Ganov
4bf102ae26 Prepare AttributionSource to expose to native
Separate the internal state of AttributionSource from the
class to make it a simple AIDL we can translate automatically
to native - keeping Java and native parts in sync. This
would allow writing a thin native lib for checking attribution
source permissions which would be used to teach camera and
audio about attributions.

Deinfe an AIDL interface for passing around an attribution
source and opr performing permission checker oprations allowing
native and Java permission checks on attribution chains to be
handled. The Java side permission checker functions are in a dedicated
permisison checker service on top of which sits the PermissionChecker.
We expose similar PermissionChecker native APIs sitting on top
of the same remote interface. The nice thing is that we have
native and Java permisison checkers in sync sharing remoting
code and being close in shape.

For now the PermissionChecker in Java is divorced from the
PermissionManager but in T we will consider how to unify them,
either by an extension object on the PermmissionManager or
APIs on the PermissionManager, or another approach, and then
migrate clients off the PermissionChecker APIs.

Sync app ops were not tracked across multiple binder calls which
prevents moving the permission checks in the system server as
this adds one more hop. Now sync ops are propagated backed the
call stack and only the ops for the package are dispatched to
it and the rest are propagated back to the caller, recursively.

bug: 158792096

Test: atest CtsPermission5TestCases
      atest CtsAppOps2TestCases
      atest CtsPermissionTestCases
      atest CtsPermission2TestCases
      atest CtsPermission3TestCases
      atest CtsPermission4TestCases
      atest CtsPermission5TestCases

Change-Id: Ia5cbd2eb20a2da172a5960afdddd7e467f4bcb0d
2021-05-04 07:42:45 +00:00
Dmitri Plotnikov
8caa905595 Merge "Use battery capacity estimates provided by Health HAL" into sc-dev am: 1d211e046e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14372226

Change-Id: Ic7aa7af6e61ce33a42833db108c415b582afa1fa
2021-05-04 04:22:03 +00:00
Dmitri Plotnikov
f7faf95827 Merge "Remove SystemBatteryConsumer" into sc-dev am: acc4e1454e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14393698

Change-Id: I30985e6f846ac83335d353250e2e2b267f4118d9
2021-05-04 02:49:11 +00:00
Dmitri Plotnikov
daa86f4f6a Use battery capacity estimates provided by Health HAL
Bug: 186807039
Test: atest FrameworksCoreTests:com.android.internal.os.BatteryChargeCalculatorTest
Change-Id: I4eb1606843ca1f2f2c0589e0abe6408f6be149c5
2021-05-03 18:50:32 -07:00
Dmitri Plotnikov
79e65de313 Remove SystemBatteryConsumer
which has been superceded by AggegateBatteryConsumer

Bug: 186006876
Test: atest FrameworksCoreTests:com.android.internal.os.BatteryStatsTests
Test: Use BatteryStatsViewer to verify that it's still functional
Change-Id: I2e4fe36ff310b6d68923fcecdfd22ce865b1f32d
2021-05-03 16:03:39 -07:00
Dmitri Plotnikov
86cafdd5f6 Merge "Aggregate power data in AggregateBatteryConsumers" into sc-dev am: 012689e349
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14318489

Change-Id: Ic34d153f827023fc179f81576cde67781ba944fb
2021-05-03 20:47:41 +00:00
Dmitri Plotnikov
012689e349 Merge "Aggregate power data in AggregateBatteryConsumers" into sc-dev 2021-05-03 20:40:25 +00:00
Eran Messeri
9fbb74e0d5 Merge "Document access to device identifiers on managed devices" into sc-dev am: 84b3b6fb99
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14251404

Change-Id: If7656df1f2dcecb055c6ab5f68297f434e765ae2
2021-05-03 07:40:18 +00:00
Eran Messeri
84b3b6fb99 Merge "Document access to device identifiers on managed devices" into sc-dev 2021-05-03 07:27:22 +00:00
Dmitri Plotnikov
d354520023 Aggregate power data in AggregateBatteryConsumers
as opposed to SystemBatteryConsumers, which will be removed
in a follow-up CL

Bug: 186006876
Test: atest FrameworksCoreTests:com.android.internal.os.BatteryStatsTests

Change-Id: Ie4166217be211d92293c2a107762801a7d3c206f
2021-04-30 13:09:32 -07:00
Roshan Pius
3d8a9d18a7 Add a UWB subsystem uid
Bug: 186788640
Test: Compiles
Change-Id: I6b67c2f7243c50c83cb159c50519a318892f6941
2021-04-29 15:25:12 -07:00
Jeff Sharkey
deacbdbb7d Merge "Restore file truncation where expected." into sc-dev am: 02b741f883
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14266167

Change-Id: I5270dddb6f3daa79f4dbff6101497a8303f2c482
2021-04-29 15:36:49 +00:00
Jeff Sharkey
02b741f883 Merge "Restore file truncation where expected." into sc-dev 2021-04-29 15:31:16 +00:00
Eran Messeri
e192379833 Document access to device identifiers on managed devices
Document when, on a managed device or profile, the DPC can
read hardware identifiers, and when it must use the new
enrollment-specific ID.

Bug: 172636282
Test: m docs
Change-Id: I783725853d0654d49518a38d8d8d04b3ca7e3ab0
2021-04-29 10:33:07 +01:00
Jeff Sharkey
fe738fbd0d Restore file truncation where expected.
Several years ago ParcelFileDescriptor.parseMode() was fixed to match
the behavior of fopen(), since developers expect consistent behavior
between managed and native code.  FileUtilsTest.testTranslateMode()
verifies that all these modes are correctly translated.

However, this unintentionally changed the behavior of
ContentResolver.openOutputStream(), which only sends the 'w' mode
to the remote process.  Developers expect this API to behave like
the FileOutputStream constructor, which always truncates the file
unless opened with the append mode.

Since some remote providers may not be prepared to handle the 't'
mode, this change carefully uses Os.ftruncate() to restore this
expected behavior in all cases.

For other APIs that return opened files, this strategy is applied
to restore the original behavior, but only when the target SDK of
the app is expecting this truncation to take place.  The reason for
this is that moving forward our goal should always enable
ContentInterface APIs to be a transparent conversation between apps
without attempting to alter the behavior.  Apps talking with older
providers can apply the Os.ftruncate() logic themselves, if
desired, once they target Android Q or higher.

Bug: 157888856, 180680924
Test: atest CtsContentTestCases:ContentResolverTest
Change-Id: Iacec49164c4ce3891db0270635e9f458dea7becd
2021-04-28 14:25:46 -06:00
TreeHugger Robot
7f42a00afa Merge "Fix NPE on VibratorInfo.getPrimitiveDuration" into sc-dev am: f10473c64c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14327227

Change-Id: I70735db28f8fca0782fd3faf18b98a508dd51a2d
2021-04-27 18:13:44 +00:00
TreeHugger Robot
f10473c64c Merge "Fix NPE on VibratorInfo.getPrimitiveDuration" into sc-dev 2021-04-27 18:12:51 +00:00
Lais Andrade
a97407bcc8 Fix NPE on VibratorInfo.getPrimitiveDuration
Fix: 186469012
Test: VibratorInfoTest
Change-Id: I2145bd95ad23040a583a347e9a1f4cff2a40e8c2
2021-04-27 14:55:45 +00:00
Songchun Fan
c490387b03 Merge "[incremental] expose more metrics fields" into sc-dev am: 03c3c1bbad
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14295877

Change-Id: Ie626839170c933ddba6f2aeb20ad90722eef30c5
2021-04-27 01:01:45 +00:00
Songchun Fan
03c3c1bbad Merge "[incremental] expose more metrics fields" into sc-dev 2021-04-27 00:34:08 +00:00
Dmitri Plotnikov
c1e48fa54a Merge "Use POWER_COMPONENT_ constants instead of TIME_COMPONENT_... constants" into sc-dev am: 840f73e773
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14298098

Change-Id: Ic85d6bdc9d39f242fb83d9d93f70d38fc2397f0e
2021-04-26 22:47:40 +00:00
Dmitri Plotnikov
840f73e773 Merge "Use POWER_COMPONENT_ constants instead of TIME_COMPONENT_... constants" into sc-dev 2021-04-26 22:44:26 +00:00
Songchun Fan
9471be56b4 [incremental] expose more metrics fields
Exposing more data loader states as per
go/incremental-crash-reports-1-pager.

BUG: 184844615
Test: atest service.incremental_test
Test: atest android.cts.statsdatom.incremental.AppErrorAtomTests
Change-Id: I532513453411b2ccdb21311d0bc3dee0641837db
2021-04-26 14:17:36 -07:00
Lais Andrade
50253445a3 Merge "Update javadoc for Vibrator.getPrimitiveDurations" into sc-dev am: fc0207696b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14272932

Change-Id: I2f23a558cab923ea9689689ff559b99ef9222b92
2021-04-26 15:08:00 +00:00
Lais Andrade
fc0207696b Merge "Update javadoc for Vibrator.getPrimitiveDurations" into sc-dev 2021-04-26 14:56:15 +00:00
Dmitri Plotnikov
70b37cbf6a Use POWER_COMPONENT_ constants instead of TIME_COMPONENT_... constants
Bug: 186006876
Test: atest FrameworksCoreTests:com.android.internal.os.BatteryStatsTests
Change-Id: Ie52616e8d7b0d5c848802af94aeb3d3780af117a
2021-04-23 14:39:28 -07:00
Kweku Adams
19128ee451 Merge changes I61392c55,I97e40d35 into sc-dev am: 2e2e94cc2c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14271905

Change-Id: Id1beea7676ecdb9c1a3c13cff1ea177aeb9305aa
2021-04-22 23:02:17 +00:00
Kweku Adams
2e2e94cc2c Merge changes I61392c55,I97e40d35 into sc-dev
* changes:
  Expand internal stop reasons.
  Rename "legacy" stop reasons.
2021-04-22 22:54:12 +00:00
Lais Andrade
0228bf8ae0 Update javadoc for Vibrator.getPrimitiveDurations
Link the method to the existing one arePrimitivesSupported.

Fix: 186120527
Test: N/A
Change-Id: Ibf128f851da977feef5f6822794c61cb31488cab
2021-04-22 17:01:26 +00:00
Saumya Pathak
ed8a8877ce Merge "Renaming sharesMediaWithParent on API feedback" into sc-dev am: 8bc88258ab
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14234548

Change-Id: Ifd6ceaf69a13ae2cfb406b3a39c31fbb7ebe8f62
2021-04-22 16:41:38 +00:00
Saumya Pathak
8bc88258ab Merge "Renaming sharesMediaWithParent on API feedback" into sc-dev 2021-04-22 16:15:55 +00:00
TreeHugger Robot
6a6753a157 Merge "Expose vibration primitives durations in Vibrator" into sc-dev am: 557f9e056e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14055005

Change-Id: I6117145eac5fc2a3c56f4bd5d885fd08479ce10a
2021-04-22 15:53:21 +00:00
TreeHugger Robot
557f9e056e Merge "Expose vibration primitives durations in Vibrator" into sc-dev 2021-04-22 15:44:10 +00:00
Kweku Adams
805535cc55 Rename "legacy" stop reasons.
There are some uses for the "legacy" stop reasons that the public API
stop reasons can't cover well. Since we'll be keeping the "legacy"
reasons around, renaming them to "internal" to help explain the
differentiation.

Bug: 141645789
Test: atest frameworks/base/services/tests/servicestests/src/com/android/server/job
Test: atest frameworks/base/services/tests/mockingservicestests/src/com/android/server/job
Test: atest ContentResolverTest (all)
Test: atest CtsJobSchedulerTestCases
Test: atest CtsSyncManagerTest
Test: atest SyncManagerTest
Test: atest SyncOperationTest
Test: atest SyncRequestTest
Change-Id: I97e40d35b79dbd012216bc22e90d649639614854
2021-04-22 07:56:48 -07:00
Steven Moreland
5acbb1913f Merge "ServiceManagerNative: update for updatableViaApex" am: 0da4dcceea am: b763d9fbb6 am: 50dda4bb15 am: 3b44e58145
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1682064

Change-Id: Iefc90715fd04f0a087a9f2b9cc9f94af9c81370c
2021-04-21 21:45:47 +00:00