Commit Graph

277 Commits

Author SHA1 Message Date
Gopinath Elanchezhian
3745571a06 Add collector library in multi user per test apk.
Enable permissions needed to write the trace file in the device.

Bug: b/155805394

Test: make MultiUserPerfTests
Change-Id: I650307133c5325aa92aa6e12f2a77566f314f174
2020-06-16 15:09:08 -07:00
Riddle Hsu
9b1843eae3 Avoid unexpected screen off during perf testing
The plugged-in type may be BATTERY_PLUGGED_AC in test environment.
And the precondition of the device may have set stay-on with any
type, then it is enough to keep device interactive. Previously
the usb type doesn't match the current state that causes device to
sleep if the screen off timeout has occurred.

Bug: 131727899
Test: atest WmPerfTests
Change-Id: Ia76a0f55e967a2d52fc4b1057b19a8af921260f3
2020-06-12 22:42:12 +08:00
Riddle Hsu
b078bc1b9c Move window manager perf test to a new package
To isolate the test environment.

Bug: 155404627
Test: atest WmPerfTests

Change-Id: I1d9eda840056efc6c2d0696952ece55fd22b1547
2020-05-06 00:52:51 +08:00
lumark
04bceb99f1 Trigger onTaskAppeared when a task started from recents becomes ready.
In quick switch flows, launcher will first swipe task snapshot
through recents animation, and then start new task with custom animation
options through startActivityFromRecents after gesture finish detected,
and then finish recents animation finally.

But that way user may experience flickering before the new task launch
and recents animation finish.

To improve quick switch flickering, we ignore the new task's custom
animation from recents and generate task remote animation target,
and then trigger a callback for launcher to control/animate this
task surface, more like a part of RecentsAnimation,

Also, adding removeTask method for launcher can flexibility remove the
new task animation target once no need to animate, so that launcher
can decide when to finish recents animation.

Bug: 152480470
Test: manual as below steps:
  1) Doing quick switch task.
  2) Make sure launcher can receive onTaskAppeared callback.
  3) Make sure launcher calls removeTask successfully.
  4) Make sure launcher can finish recents animation after 3).
Change-Id: I0692a280a49719229fa8871509bad37a1343a00f
2020-04-10 02:20:03 +08:00
Tiger Huang
0426a33650 Update controls after addToDisplay/relayout before dispatching insets
A window might request to control insets before it is added to WM and
expect the first dispatched WindowInsets as requested.

The first insets state returned from addToDisplay or relayout might be
not expected if the window just become thecontrol target in the
function.

With this CL, WM can return controls from addToDisplay and relayout, so
that the client can apply controls immediately, and update controlled
insets sources before dispatching the insets to the view hierarchy. This
enaures the insets dispatched are up-to-date.

Fix: 150756571
Test: atest WindowInsetsControllerTests RelayoutPerfTest
            WindowAddRemovePerfTest
Change-Id: Ib78c24beb7af5a54ad78935c3ddb260ef9645212
2020-04-07 16:05:40 +08:00
Winson
727da64be5 Gate stricter manifest enforcement on targetSdk R
Two package parsing issues have been promoted to failures in R:
a missing <application>/<instrumentation> tag, and an empty
"android:name" attribute. The latter due to a bug in the parsing
code.

These need to be gated by targetSdkVersion so that APKs built for
previous versions can still scan/install properly. This change
introduces support for this through a framework that leverages
@ChangeId to introduce individually toggle-able errors, in
case a developer needs to install an app that isn't completely
migrated for a new SDK version yet.

The ignoreError method was removed from ParseResult as the errors
it was used for were manually compared to PackageParser and it's
likely they can be hard errors without breaking anything.

This also adds tests for general ParseInput/Result behavior.

Exempt-From-Owner-Approval: AppIntegrity already approved in older PS.

Bug: 150776642

Test: atest android.content.pm.parsing.result.ParseInputAndResultTest
Test: atest com.android.server.pm.parsing.PackageParsingDeferErrorTest
Test: atest com.android.server.integrity.AppIntegrityManagerServiceImplTest
Test: atest com.android.server.pm.parsing

Change-Id: Id53a2e65f6e5e4dee9a41cc77007275b3a220ac3
2020-04-01 05:42:52 +00:00
Tony Mak
293bdf360a Remove local text classifier and related tests.
1. libtextclassifier and libtextclassifier-java are no longer built
   into framework/base.
2. Removed local text classifier code
3. Removed local text classifier test code.
   All of them should be already moved to libtextclassifier/tcs side.
4. Unify all the TC related log tags to "androidtc".

BUG: 147412216

Test: mts-tradefed run mts-extservices
Test: atest frameworks/base/core/java/android/view/textclassifier
Test: Sanity test: Smart selection

Change-Id: Icb1076153f51d5674c8a6c58681ffed5aa772149
2020-03-16 20:16:17 +00:00
Sudheer Shanka
c95e8472c4 Merge "Add @TestApis getLeasedBlobs() and getLeaseInfo()." into rvc-dev 2020-03-14 04:35:03 +00:00
Sudheer Shanka
c6c7994c0f Add @TestApis getLeasedBlobs() and getLeaseInfo().
+ Rename AccessorInfo to LeaseInfo.

Bug: 150619869
Test: atest --test-mapping apex/blobstore
Change-Id: I257b784350aa8bcf39847a3fd1a91977e4ff174a
2020-03-12 22:32:49 -07:00
Philip P. Moltmann
12ac3f406f Rename featureId -> attributionTag
In the core functionality this changes everything including aidl's and
field names:
- Context
- ContentProvider
- AppOps*
- Package parsing

For the rest, this is a shallow change to only change to the changed
APIs. This keeps the change small-ish

Exempt-From-Owner-Approval: Rename
Fixes: 148792795
Test: TH
Change-Id: I2a2245fe76e09e62cb13d5785d2efb4a304ba54a
Merged-In: I2a2245fe76e09e62cb13d5785d2efb4a304ba54a
2020-03-12 19:26:10 +00:00
Patrick Baumann
aa3a470151 Merge "Modify PackageManagerPerfTest to work by itself agian" into rvc-dev 2020-03-04 18:42:32 +00:00
Winson Chiu
f5f588e032 Merge changes I815bb92e,I1777f84c into rvc-dev
* changes:
  Adjust AndroidPackage String interning
  Add package parsing v1 vs v2 benchmark
2020-03-03 18:06:37 +00:00
Patrick Baumann
1e7536372e Modify PackageManagerPerfTest to work by itself agian
This change modifies PackageManagerPerfTest to work in isolation while
we work through an alternative per b/150624323

Test: atest PackageManagerPerfTest
Bug: 150624323
Change-Id: Iac1e040d4463e0e9609d1a7a6d88c9431bef2926
2020-03-02 13:53:53 -08:00
Winson
04fd0366bd Add package parsing v1 vs v2 benchmark
Creates benchmarks for package parsing v1 vs v2, with variants
for cached vs non-cached and sequential vs parallelized.

The code used is copied from PackageCacher and the old PackageParser
implementation, since they are not accessible to the test class.

Bug: 141922546

Test: atest PackageParsingPerfTest

Change-Id: I1777f84cb54d1ad5ae0dfd32a3461c1b07eef8e0
2020-02-25 14:09:56 -08:00
Patrick Baumann
d3990130cb Disable caches for perf tests
Bug: 140788621
Test: atest PackageManagerPerfTest
Change-Id: Idba8ea4c53ceacd9e07a06717c44d5411aef45d8
2020-02-24 14:57:54 +00:00
Sudheer Shanka
285848d88f Re-enable BlobStorePerfTests.
+ Add a shell command to delete a blob.

Bug: 149324953
Test: atest apct-tests/perftests/blobstore/src/com/android/perftests/blob/BlobStorePerfTests.java
Change-Id: Id83086614bd71335fdd461387a84f761b0d9edb7
2020-02-17 16:33:38 -08:00
Daniel Bright
094913c577 Revert "Move base resources to telephony"
Revert "Remove overlapping resources"

Revert submission 10319574-telephony_res_cleanup

Reason for revert: build issue
Reverted Changes:
I5caec1dc3: Remove overlapping resources
I6b389f4f1: Move base resources to telephony

Change-Id: Ib42ce5983bb158e6680e5da5fa85faedbcbe0a64
2020-02-15 23:01:41 +00:00
Daniel Bright
25f1022eb1 Move base resources to telephony
* Removes all base resources that exist also in telephony so
that there is not overlap.
* Overlays are coming in the next CL (the build doesn't break
even with overlays missing overlays.)

Bug: 149401237
Test: TeleServiceTests
Change-Id: I6b389f4f155c9d5a6f23a7ca3ff47db0e5a93208
2020-02-14 13:58:38 -08:00
Philip P. Moltmann
0946037764 Merge "Revert "Revert "Activity start: Send featureId from context->AppOpsManager""" 2020-02-12 18:52:23 +00:00
Philip P. Moltmann
ee29509ecd Revert "Revert "Activity start: Send featureId from context->AppOpsManager""
This reverts commit e7421e92d9.

Exempt-From-Owner-Approval: revert-revert and only piping anyway
Test: 1:1 revert-revert
Bug: 136595429
Change-Id: I44e5fa2019f5604c6e2c08bdd1967129c64a90a7
2020-02-12 18:51:53 +00:00
Sudheer Shanka
bffb8ef774 Temporarily disable BlobStorePerfTests.
Bug: 149324953
Test: atest ./apct-tests/perftests/blobstore/src/com/android/perftests/blob/BlobStorePerfTests.java
Change-Id: I4d012106ff86ddc0391b32e888a784eafb42c494
2020-02-11 13:36:43 -08:00
Philip P. Moltmann
41308eced1 Merge "Revert "Activity start: Send featureId from context->AppOpsManager"" 2020-02-10 16:31:33 +00:00
Philip P. Moltmann
e7421e92d9 Revert "Activity start: Send featureId from context->AppOpsManager"
Revert "Adjust monkey to changed internal APIs"

Revert "Test featureId is correctly used in startActivity"

Revert submission 10111030-activityStarter_featureId

Reason for revert: presubmit test breakage
Reverted Changes:
Ic7056b492: Activity start: Send featureId from context->AppOp...
I8e2a07da7: Adjust monkey to changed internal APIs
I7a6af6fb1: Test featureId is correctly used in startActivity

Change-Id: I48c55a962c990b22ea49e923baa7c73b121d179b
2020-02-10 16:14:12 +00:00
TreeHugger Robot
d0db68c890 Merge "To add new marker to support long edge cutout" 2020-02-10 06:53:49 +00:00
TreeHugger Robot
bd9ffc9c76 Merge "Reduce unnecessary object creation in relayout test" 2020-02-10 02:39:07 +00:00
Philip P. Moltmann
6e406c8ae7 Merge "Activity start: Send featureId from context->AppOpsManager" 2020-02-08 22:54:50 +00:00
Philip P. Moltmann
9c5226fe36 Activity start: Send featureId from context->AppOpsManager
The expected usage pattern for noteOp is to get the
Context#getOpPackageName() and Context#getFeatureId() in the calling app
and the call

noteOp(callingPackageName, Binder.getCallingUid(), callingFeatureId)

As the featureId parameter is new this parameter has to been piped all
through from the ...Manager classes running in the app all way deep into
the bowels of the system server.

There is a special featureId==null for the "default" feature. This is
used in two cases:
- In case the system server (packageName == null || packageName ==
  "android") makes a call
- In the case there is no caller. In this case I left annotations in the
  code to make clear that the default feature is used

Raw binder interfaces (defined in AIDL files) are not supposed to be
used by apps. Still historically this has happened and we ended up with
@UnsupportedAppUsage tags in these files. Also AIDL does not support
two methods with the same name but different parameters. I.e. in the
case when I had to add a paramater to a method tagged as UnsupportedAppUsage I
- created a new method ...WithFeature with the additional paramter
- set a maxTargetSDK for the old method and mention the public API to
  use in the deprecation method
This is really not pretty. Once there is no more app using the old
internal API this hack can be removed.

Additionally this change removed all internal calls to
AppOpsService.noteOperation and AppOpsService.checkOperation and
replaces them with the public API equivalent. This sometimes means to
move the resolution of the mAppOpsManager to be lazy.

Exempt-From-Owner-Approval:: Just piping through arguments
Bug: 136595429
Test: atest --test-mapping frameworks/base/services/core/java/com/android/server/am/
      atest CtsAppOpsTestCases added test to cover activity start
      atest WmTests
Change-Id: Ic7056b492cb1c9a79158e6c2b4864898a0eb5b2a
2020-02-08 22:53:43 +00:00
TreeHugger Robot
207454b9fa Merge "Adds app enumeration varations to perf tests" 2020-02-07 19:20:24 +00:00
Patrick Baumann
88c1e2acdf Adds app enumeration varations to perf tests
This change modifies the Package Manager tests to run on top of a device
with a complicated set of packages that declare visibility of one
another. New tests were added to test getInstalledPackages as well as a
new test for each existing to test with the app enumeration feature
turned on.

This change also fixes the PlatformCompatGating test to run with the
actual system and so adds the required permissions to the shell
manifest.

Bug: 141922841
Test: atest PackageManagerPerfTest PlatformCompatGatingTest
Change-Id: I386a6f82b05b4ea0b2a8885d55b6ca67a3f2dcf8
2020-02-07 08:50:09 -08:00
Felka Chang
489cf260aa To add new marker to support long edge cutout
Currently, the cutout only exists in short edge of a display. It means
that the cutout only locates in short edge of the display in portrait
mode. The method to parse the cutout only supports top boundary or bottom
boundary cutout.

To modify the parser of cutout specification supports the long edge cutout
feature. CutoutSpecification handles the parsing rulers extracted from
DisplayCutout.

In order to make parsing faster, it doesn't use regular expression to parse
specification and String.split.

Test: atest \
    FrameworksCoreTests:android.view.DisplayCutoutTest \
    FrameworksCoreTests:android.view.CutoutSpecificationTest \
    SystemUITests:com.android.systemui.ScreenDecorationsTest \
    CorePerfTests:android.view.CutoutSpecificationBenchmark

Bug: 146875639
Change-Id: Ice3ad28ef29a6f11875c4946cf4a60ee792f1270
2020-02-07 16:30:05 +08:00
Joanne Chung
f90cdd8f79 Merge "Ported TextClassificationManagerPerfTest from Settings to DeviceConfig." 2020-02-07 02:34:54 +00:00
Sudheer Shanka
25bfe747de Add a missing TODO.
Test: atest cts/tests/BlobStore/src/com/android/cts/blob/BlobStoreManagerTest.java
Change-Id: Ib7f48d845cf7984469c5f67e34f9cbca80823bf0
2020-02-06 10:29:10 -08:00
Riddle Hsu
64d8bcc891 Reduce unnecessary object creation in relayout test
Also change to use STAY_ON_WHILE_PLUGGED_IN for keeping
device awake. That eliminates the toggle of wakelock by
showing and hiding a window with FLAG_KEEP_SCREEN_ON.

Test: atest RelayoutPerfTest InternalWindowOperationPerfTest
Bug: 131727899
Change-Id: Ib4608aa1a60c7560b39011cfd2e4740680b3c884
2020-02-06 22:40:56 +08:00
Joanne Chung
ff33c168ec Ported TextClassificationManagerPerfTest from Settings to DeviceConfig.
We dropped legacy Settings after ag/9852595, we should change to use
DeviceConfig here. No performance issue observed after appling change.

Bug: 148831327
Test: frameworks/base/apct-tests/perftests/textclassifier/run.sh
and make sure the config is set to default after test.

Change-Id: I2c95d12561373f8711fc548a4a9050a0bc5a0377
2020-02-06 11:21:07 +08:00
Sudheer Shanka
d4ea5e142f Add perf test to measure duration of blob store digest computation.
+ Move BlobStoreTestUtils from cts/ to frameworks/base/tests/.

Bug: 148898557
Test: atest ./apct-tests/perftests/blobstore/src/com/android/perftests/blob/BlobStorePerfTests.java
Change-Id: I2de155d0c0c1fb602c57353ba4819bdc9cda8c0a
2020-02-05 16:30:44 -08:00
Ryan Mitchell
1e80cd76ed Merge changes from topic "res-loader"
* changes:
  Refactor ResourcesLoader Tests
  Refactor ResourcesLoader APIs
2020-01-29 06:57:47 +00:00
Ryan Mitchell
6115858c21 Refactor ResourcesLoader Tests
This change refactors the tests for ResourcesLoaders to support the
new concept of loaders owning providers.

Bug: 147359613
Test: atest ResourceLoaderTests
Change-Id: Id61dc27bf5876afe10c25ed57333541131e910b7
2020-01-28 15:35:17 -08:00
Robert Carr
2e20bcd65e WM: Defer transactions for BLAST Surfaces too.
For switching on BLAST we are implementing deferred transactions for
compatibility. Presently the BLAST Surface is constructed by the ViewRootImpl
and so the WM has no reference to pass when using it as a barrier layer for
deferTransactionUntil. To resolve this we construct and hold a reference to
the BLAST Surface on the server side, and pass it down to the client in relayoutWindow.
We don't use the WindowStateAnimator surface directly as both the BLAST Adapter and
the WindowStateAnimator would then be setting crops on it.

Bug: 146598493
Test: Builds, existing tests pass.
Change-Id: I6513e0442f5c75f01eb8dde5f1924dd7b636163c
2020-01-27 16:47:33 -08:00
Valerie Hau
3036055686 Preserve intended width/height for Blast adapter layers
Some surfaces may be a different size from the requested width/height.
Pass back calculated width/height from WindowStateAnimator back to
ViewRootImpl

Bug: 147674215, 147689472
Test: build, boot, manual
Change-Id: Ib557a4769d79e6414b9bebab8cb006adfb551e4d
2020-01-17 07:49:32 -08:00
jovanak
288a18ff21 Adding more granular startUser perf benchmarks.
Fixes: 146154399
Test: atest UserLifecycleTests
Change-Id: Ie781edc70a8a2fc0635e74350c139b5c09441dca
2019-12-19 14:34:35 -08:00
Jing Ji
8412131362 Add performance test for OomAdjuster
Bug: 140254153
Test: atest -c ActivityManagerPerfTests:OomAdjPerfTest#testOomAdj
Change-Id: Id12667c71300e6fe4dc063c83807834bbdb5e62a
2019-12-13 14:51:41 -08:00
Adam Bookatz
b9a57da94c Merge "Introduce user types" 2019-11-15 19:15:37 +00:00
Bookatz
029832a951 Introduce user types
Introduces the notion of 'user types' to UserManager.
Previously, users only had properties, set by UserInfo flags. We now
solidify some of these as formal user types. Each user must be of
precisely one user type. The configuration of each type is defined
in a UserTypeDetails object.

Prior 'types' - namely Guest, Restricted, ManagedProfiles, Demo, and
'normal' - that were set via UserInfo flags are now controlled via
UserType. Previous UserInfo flag methods for categorizing these are
still supported as long as no user of of more than one type.

If a user was (e.g.) previously both Guest and Demo, it is now
invalid and will be prevented from upgrading. This should not be a
problem in AOSP, where these 'types' were assumed mutually exclusive.

UserTypeDetails is sufficiently general to support future non-managed
profiles. To this end, the logic for specifying badges and their
colors/labels is contained by UserTypeDetails, and therefore
UserManager is responsible for delivering the corresponding badge
information.

Bug: 142151520

Test: added new test class UserManagerServiceUserTypeTest
Test: added additional tests in UserManagerServiceUserInfoTest
Test: added additional tests in UserManagerTest
Test: added additional tests in UserManagerServiceCreateProfileTest
Test: created UserTests to run the various pm.User*Test's

Test: atest \
  com.android.server.pm.UserTests \
  UserLifecycleTests \
  ManagedUserContentResolverTest \
  CtsDevicePolicyManagerTestCases \
  CtsMultiUserHostTestCases \
  com.android.server.devicepolicy.DevicePolicyManagerTest \
  com.android.server.am.UserControllerTest \
  CreateManagedProfileTaskTest

Test: atest com.android.server.pm.UserManagerServiceCreateProfileTest
   using adb shell getprop persist.sys.max_profiles # for 5 and -1

Change-Id: Id1183a76055e9a7610965cf40b256d1392afe6f8
2019-11-14 10:00:50 -08:00
Jorim Jaggi
5b80fbe00e Merge "Kill overscan insets and outsets" 2019-11-13 11:19:39 +00:00
Jorim Jaggi
f081f06a48 Kill overscan insets and outsets
Also remove WindowManagerStressTest because that has been replaced
with proper perf test.

Test: Boots
Bug: 143255833
Change-Id: I1d293cda7c82d0aa1c3a6cc694c74bf7d10cc974
2019-11-12 17:49:51 +01:00
Riddle Hsu
4a725004fc Capture method tracing for window test
It will generate method profiling trace data on the last 2
iterations that won't be counted in result metrics.

Bug: 131727899
Test: atest WindowAddRemovePerfTest

Change-Id: Ifd6f594481785deed2ebeb6e1d198f6f8728d3f4
2019-11-12 15:13:07 +08:00
Riddle Hsu
6df7f0aca5 Fix missing renaming of PerfTestActivity
1be1dd6 renamed StubActivity to PerfTestActivity.

Bug: 131727899
Test: atest PackageManagerPerfTest
      atest AutofillPerfTests:LoginTest

Change-Id: I90ad0f28ab6a3c152b16f7587c5434e6fddf18a3
2019-10-17 16:53:41 +08:00
Riddle Hsu
f5622d25a0 Add trace based window manager perf test
This may be temporary solution that parses the output of
atrace in text format on the device side. Once the perfetto
processing infrastructure is available (b/139542646) for
generic test environment, we can migrate to use that.

Bug: 131727899
Test: atest InternalWindowOperationPerfTest
Change-Id: Ic0304c292e42159fb11dee37152867290808f281
2019-10-15 22:19:51 +08:00
Riddle Hsu
1be1dd6bbf Rename StubActivity to PerfTestActivity
The activity is real.

Bug: 131727899
Test: atest CorePerfTests
Change-Id: I7fdb41aa5447329c0b1b6960f9e3d808be69648d
2019-10-15 22:10:25 +08:00
Ryan Mitchell
4043ca78ea Add Resources Perf Tests
This changes adds benchamrks for Resources, ResourcesManager,
OverlayManager, and Resources.Theme.

Bug: 136085555
Test: atest OverlayManagerPerfTest
Test: atest ResourcesManagerPerfTest
Test: atest ResourcesPerfTest
Test: atest ResourcesThemePerfTest

Change-Id: I6a3b3275399c161e55ff6ce34e7bc2ae5556edf1
2019-09-26 14:15:26 -07:00