Commit Graph

9204 Commits

Author SHA1 Message Date
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
df2e7b8839 Merge "Revert "Restore file truncation where expected."" into sc-dev 2021-05-04 19:53:57 +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
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
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
012689e349 Merge "Aggregate power data in AggregateBatteryConsumers" into sc-dev 2021-05-03 20:40:25 +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
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
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
03c3c1bbad Merge "[incremental] expose more metrics fields" into sc-dev 2021-04-27 00:34:08 +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
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
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
8bc88258ab Merge "Renaming sharesMediaWithParent on API feedback" into sc-dev 2021-04-22 16:15:55 +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
3b44e58145 Merge "ServiceManagerNative: update for updatableViaApex" am: 0da4dcceea am: b763d9fbb6 am: 50dda4bb15
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1682064

Change-Id: I7f25599c5ebe6759f7001194d401e0bbc191ffd9
2021-04-21 21:36:38 +00:00
Steven Moreland
50dda4bb15 Merge "ServiceManagerNative: update for updatableViaApex" am: 0da4dcceea am: b763d9fbb6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1682064

Change-Id: Ib717ea616df7947cb1b14fc583e60ea3c8407529
2021-04-21 21:14:24 +00:00
TreeHugger Robot
fc2b8f7e57 Merge "Expose SPIN and THUD vibration effects to public" into sc-dev 2021-04-21 20:28:25 +00:00
Steven Moreland
0da4dcceea Merge "ServiceManagerNative: update for updatableViaApex" 2021-04-21 20:17:44 +00:00
Lais Andrade
dd6027e5f1 Expose SPIN and THUD vibration effects to public
Fix: 167947207
Test: N/A
Change-Id: I0785ba8efbd8edea5813715e0891bda9341b5cea
2021-04-21 10:26:23 +00:00
Lais Andrade
8231960159 Expose vibration primitives durations in Vibrator
Fix: 182477149
Test: VibratorTest
Change-Id: I4dd500fe6551645454ac9af24499098a74fd866e
2021-04-21 10:26:13 +00:00
Tianjie Xu
ff38f2041d Merge "Catch security exceptions in RoR APIs" am: 27dcfb808c am: ffbcac67ab am: f14cfe0fc3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1651270

Change-Id: I966f41db7056be4452050f4a5a8f512f9974f790
2021-04-21 04:35:48 +00:00
Tianjie Xu
f14cfe0fc3 Merge "Catch security exceptions in RoR APIs" am: 27dcfb808c am: ffbcac67ab
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1651270

Change-Id: I034655978c746b2e824ab27d68d4fb5316aa1b3b
2021-04-21 04:06:56 +00:00
Tianjie Xu
27dcfb808c Merge "Catch security exceptions in RoR APIs" 2021-04-21 03:22:56 +00:00
Steven Moreland
021f3e3d3f ServiceManagerNative: update for updatableViaApex
See if a VINTF instance is updatable via APEX.

Bug: 185832616
Test: N/A
Change-Id: I3413707eb18beae1ac417a92e9082655f6d07f11
2021-04-21 00:28:53 +00:00
TreeHugger Robot
18ecd98109 Merge "[pm] remove incremental startable/unstartable code" into sc-dev 2021-04-20 22:03:22 +00:00
Jing Ji
a063e0f24a Merge "Update Kotlin sample code for CountDownTimer and Parcelable" am: 598675abef am: a61b23b89e am: 3d7210ee88
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1673235

Change-Id: I33967535b9da48028d895d51078c545329eda681
2021-04-20 00:33:32 +00:00
TreeHugger Robot
23292d7dee Merge "Check if idsig size is within IncFs limits." into sc-dev 2021-04-19 22:28:09 +00:00
Tony Mak
b004404a72 Merge "Add some TestAPIs for replacing some @hide API usages in ExtServices's test" into sc-dev 2021-04-19 21:07:41 +00:00
Jing Ji
3d7210ee88 Merge "Update Kotlin sample code for CountDownTimer and Parcelable" am: 598675abef am: a61b23b89e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1673235

Change-Id: Ia82738a244e73ea431280afa3bd5896b68ad6f28
2021-04-19 19:34:11 +00:00
Jing Ji
598675abef Merge "Update Kotlin sample code for CountDownTimer and Parcelable" 2021-04-19 19:23:06 +00:00
Dmitri Plotnikov
d215e29f75 Merge "Use BatteryStats instead of BatteryStatsImpl in BatteryUsageStatsProvider" into sc-dev 2021-04-19 18:09:31 +00:00
Saumya Pathak
b46e5f57f0 Renaming sharesMediaWithParent on API feedback
Test: atest android.multiuser.cts.UserManagerTest#testCloneUser, atest com.android.server.pm.UserManagerTest#testCloneUser
Bug: 185365969

Change-Id: I44a28bc6ed3e73674d77db497a15ec33b8244b05
2021-04-19 14:11:51 +00:00
Dmitri Plotnikov
a5163de7af Use BatteryStats instead of BatteryStatsImpl in BatteryUsageStatsProvider
This is being done in preparation for a switch of BatteryStats.dumpLocked
from BatteryStatsHelper to BatteryUsageStats

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

Change-Id: Ia8bf02116517c77f008b85c2012f68353b39c044
2021-04-16 17:47:04 -07:00
Alex Buynytskyy
c863792d62 Check if idsig size is within IncFs limits.
Bug: 152148243
Fixes: 152148243
Test: pm install-incremental <apk in the bug>
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest PackageManagerServiceTest ChecksumsTest
Change-Id: I33623a9240482ea36a8e1eeb97ec01294e7249ff
2021-04-16 12:28:41 -07:00
Songchun Fan
5ada1508c2 [pm] remove incremental startable/unstartable code
Also remove streaming health status reporting which could cause
startable state change because it is also not needed any more.

BUG: 171920377
Test: builds
Change-Id: I7284e7a63df79da7dbf3d16ff64302b3d1ce1348
2021-04-16 02:29:24 +00:00