1954 Commits

Author SHA1 Message Date
Makoto Onuki
b4c2e6f468 Merge ""bmgr restore" really should wait until operation finishes." into oc-dev 2017-04-12 21:10:37 +00:00
Makoto Onuki
a56ba60c94 "bmgr restore" really should wait until operation finishes.
Test: manual test
Bug 37246838

Change-Id: Ice381dc250e2d2a59cff48152dd3c8d6897d0804
2017-04-12 11:08:49 -07:00
Johan Toras Halseth
9d5f8e11e1 Add helptext to bu command.
bu is used by adb backup/restore, but since flags passed to these adb
commands are just forwarded to bu, we have no guarantee that the help
text for adb shows an up to date description of what bu can do. We
therefore add the help text to bu, such that it is easier to keep in
sync.

Test: adb shell bu help

Bug: 36170696
Change-Id: I8155d17b5c942ce19b981f4a157e7cc7810490ce
2017-04-11 11:49:34 +01:00
Keun-young Park
b706bb7e52 ignore RemoteException from pm if shutdown is already on-going
- In new shutdown flow, adb is guaranteed to be alive while system server
  is alive.
- power manager can be killed before system server is killed.
- This leads into RemoteException for shutdown request to power manager.
- If shutdown is already on-going (=sys.powerctl set), the RemoteException
  should be ignored.

bug: 37096155
Test: adb shell svc power reboot|shutdown and check output to adb
Change-Id: Ia90a900d55123bd7c1bf57c90c49d35332ebfdf5
2017-04-10 20:55:03 +00:00
Johan Toras Halseth
4b8c7f67ac Change flag from -includekeyvalue to -keyvalue/-nokeyvalue
The original flag was added in ag/1946677. As pointed out
in ag/2065837 we ought to stick to the syntax used for
other flags.

Test: adb backup -keyvalue -all
Change-Id: Ie2c7ee3d85740abadaa4119d23470cd9470bd981
2017-04-05 20:45:32 +01:00
Keun-young Park
d1794cdbb4 show different timing log for shutdown animation
bug: 36873098
Test: reboot and check log
Change-Id: Ic3adaba383cc29dba039a7fb5adcb01d4c0c963b
2017-04-04 22:21:32 +00:00
Keun-young Park
b593842063 support shutdown animation from bootanim
- init will set sys.powerctl property and run bootanim.
- Use /oem/media/shutdownanimation.zip or
  /system/media/shutdownanimation.zip for animation file.
  If none of them exist, android animation will be used.
- Disable audio playing for shutdown animation.
- Disable TimeCheckThread for shutdown animation. It
  accesses /data partition and can block umount.

bug: 36526187
Test: many reboots

Change-Id: If02c73cda2015317d88d056cd45201208da49946
2017-04-03 14:43:14 -07:00
Karthik Ravi Shankar
74db2a3667 Add vr persistent mode enable/disable
Persistent vr mode toggle control is needed sometimes from command line.
This also adds the infrastructure for future vr commands.

Bug: 36071574
Test: adb shell vr set-persistent-vr-mode-enabled true
      adb shell dumpsys vrmanager
      >> Persistent VR mode is currently: enabled
      adb shell vr set-persistent-vr-mode-enabled false
      adb shell dumpsys vrmanager
      >> Persistent VR mode is currently: disabled

Change-Id: I47a858e0696a907e746d50e2c6ca3d18197864a7
Signed-off-by: Karthik Ravi Shankar <karthikrs@google.com>
2017-03-31 08:37:12 -07:00
Jeff Sharkey
72ba815ca4 Merge "Add a new "virtual disk" feature." 2017-03-27 15:22:52 +00:00
Jeff Sharkey
e53e2d9576 Add a new "virtual disk" feature.
It's extremely difficult to test storage related logic on devices
that don't have physical SD card slots.  So to support better
debugging and testing, add a new "virtual disk" feature which mounts
a 512MB file through loop device.

Also move ParcelFileDescriptor.open() over to using Os.open() so
that it gets StrictMode treatment.

Bug: 34903607
Test: builds, boots, virtual disk works
Change-Id: I072a3a412cfcc8a2a3472919b7273a1ed794fd98
2017-03-25 23:26:21 -06:00
Johan Toras Halseth
b59a4b85ad Add support for key-value packages to adb backup/restore.
For adding CTS tests for packages having key-value backup agents, we add
support for key-value backups to the adb backup/restore command.
Previously, packages not supporting fullbackup would just be skipped on
this command. Now, by adding the -keyvalue flag to the adb backup command,
packages supporting key-value will also be added to the resulting
tarball. Similarly, if the tarball being supplied to adb restore
contains data from key-value packages, it will be restored.

This will later be utilized for writing CTS tests for such packages.

Test: adb backup -includekeyvalue -all && adb restore backup.ab

Change-Id: I7b4ccfb7072d01d29a888952145d7cce90a4f59e
2017-03-24 23:51:48 +00:00
Felipe Leme
24d5893b25 Added a UserManager.DISALLOW_AUTOFILL restriction.
bug: 35710740

Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases -t android.autofillservice.cts.LoginActivityTest#testUserRestriction
Test: cts-tradefed run commandAndExit cts-dev -m CtsDevicePolicyManagerTestCases -t com.android.cts.devicepolicy.MixedDeviceOwnerTest#testDisallowAutofill_allowed
Test: cts-tradefed run commandAndExit cts-dev -m CtsDevicePolicyManagerTestCases -t com.android.cts.devicepolicy.MixedProfileOwnerTest#testDisallowAutofill_allowed
Test: cts-tradefed run commandAndExit cts-dev -m CtsDevicePolicyManagerTestCases -t com.android.cts.devicepolicy.MixedManagedProfileOwnerTest#testDisallowAutofill_allowed

Change-Id: I41b2bf9fe3bc8df627c6650960bd11346c430a7e
2017-03-22 17:20:48 -07:00
Adam Lesinski
1665d0f028 Add support for configForSplit
Applications with the android:isolatedSplits="true" attribute in
their AndroidManifest.xml would have their Split APKs loaded in
isolation of each other, based on a set of dependencies.

Configuration Splits generated for a Feature split would not be properly
loaded before, so this change, along with a tools change, fixes this
issue and completes support for isolatedSplits.

Bug: 30999713
Test: CTS test coming (depends on some tool changes)
Change-Id: Ia4e7b0e69168a9d6637867558e306f7031720fb3
2017-03-16 15:45:10 -07:00
Jaekyun Seok
0434289c45 Apply static RRO
Static RRO package is designed to support resource overlay for system
server and they shouldn't be disabled or changed by a user.
The design details are in go/treble-static-rro.

Selection method for static RROs will be applied later when its design
is determined.

Test: building succeeded and tested on sailfish.
Bug: 35742444
Change-Id: I8cbf2fd37a73a24bf6ad291e2c5cf75a0fc757fc
2017-03-15 00:07:34 +09:00
Andrii Kulian
8ee7285128 Move rotation tracking to DisplayContent
This CL moves rotation tracking from WindowManagerService to
DisplayContent. This way displays can be rotated independently and
rotation of the main display won't affect rotation of secondary
ones.

Bug: 34242678
Test: android.server.cts.ActivityManagerDisplayTests
Test: testRotationNotAffectingSecondaryScreen
Change-Id: Ic46aaa523482b31ff5ec77f0c2908ceda1156fc0
2017-03-10 18:34:18 -08:00
Scott Main
2ba0df0374 Merge "update uiautomator doclava build to use new location for templates as per: https://googleplex-android-review.git.corp.google.com/#/c/1524290/" 2017-03-08 21:59:13 +00:00
Scott Main
bd401a77f8 update uiautomator doclava build to use new location for templates
as per:
https://googleplex-android-review.git.corp.google.com/#/c/1524290/

Change-Id: Ib8588f01005a691474622e6ca81f63234f796f82
2017-03-08 11:21:03 -08:00
Jaekyun Seok
7de2f9c73f Reinstate codes to enable RRO on system server
Test: building succeeded and tested with sailfish
Bug: 35742444
Change-Id: I99d0f1d097525d3eb46255d6cf823f6ae2a02385
2017-03-03 07:23:23 +09:00
Sunny Goyal
6d7cb23236 Sending explicit broadcast to the launcher when a package is installed
Test: Manually tested on device and add CTS tests
Bug: 32920609
Change-Id: Ic23c077a469fb41d6c4e123d4bc022899f634198
2017-02-28 12:55:59 -08:00
Mårten Kongstad
2e0d0f3111 OMS: integrate OverlayManagerService into framework
Hand over ownership of overlays to OverlayManagerService.

Changes to a package's overlays are propagated using the activity life
cycle. Affected activities will be recreated as needed. This provides a
well-defined point to modify an application's assets while the
application is paused.

Consolidate how overlays targeting the system and overlays targeting
regular applications are handled. Previously, system overlays were
handled as a special case. Now, everything is handled identically. As a
side effect, the call to idmap --scan during Zygote boot has become
obsolete and is removed.

Information on what overlays to use is recorded in
ApplicationInfo.resourceDirs. The PackageManagerService is responsible
for the creation of ApplicationInfo objects. The OverlayManagerService
is responsible for informing the PackageManagerService in advance about
what resourceDirs to use.

When launching an application, the ApplicationInfo is already populated
with up-to-date information about overlays.

When enabling or disabling an overlay for a running application, the
OverlayManagerService first notifies the PackageManagerService about the
updated resourceDirs. It then tells the ActivityManagerService to push
the new ApplicationInfo object to the application's ActivityThread.
Finally the application requests its ResourcesManager to create new
ResourcesImpl objects based on the updated paths.

Change-Id: Ib8afa05ccab4e2db558f89ce4423983c086bb61a
Co-authored-by: Martin Wallgren <martin.wallgren@sonymobile.com>
Signed-off-by: Zoran Jovanovic <zoran.jovanovic@sonymobile.com>
Bug: 31052947
Test: run tests from 'OMS: tests for OverlayManagerService'
2017-02-23 14:01:38 -08:00
Guang Zhu
df0824ad4c Merge "Revert "OMS: integrate OverlayManagerService into framework"" 2017-02-23 07:36:16 +00:00
Guang Zhu
9545980692 Revert "OMS: integrate OverlayManagerService into framework"
Bug: 31052947
Bug: 35697944

This reverts commit 21a3d1ad686dee97b9cf0ed80389ee2ab0d48013.

Change-Id: I2d86931020301524c26cf8c8e80d557c97fdd6c3
2017-02-23 07:35:39 +00:00
TreeHugger Robot
0f09817859 Merge "OMS: integrate OverlayManagerService into framework" 2017-02-23 03:59:01 +00:00
Mårten Kongstad
21a3d1ad68 OMS: integrate OverlayManagerService into framework
Hand over ownership of overlays to OverlayManagerService.

Changes to a package's overlays are propagated using the activity life
cycle. Affected activities will be recreated as needed. This provides a
well-defined point to modify an application's assets while the
application is paused.

Consolidate how overlays targeting the system and overlays targeting
regular applications are handled. Previously, system overlays were
handled as a special case. Now, everything is handled identically. As a
side effect, the call to idmap --scan during Zygote boot has become
obsolete and is removed.

Information on what overlays to use is recorded in
ApplicationInfo.resourceDirs. The PackageManagerService is responsible
for the creation of ApplicationInfo objects. The OverlayManagerService
is responsible for informing the PackageManagerService in advance about
what resourceDirs to use.

When launching an application, the ApplicationInfo is already populated
with up-to-date information about overlays.

When enabling or disabling an overlay for a running application, the
OverlayManagerService first notifies the PackageManagerService about the
updated resourceDirs. It then tells the ActivityManagerService to push
the new ApplicationInfo object to the application's ActivityThread.
Finally the application requests its ResourcesManager to create new
ResourcesImpl objects based on the updated paths.

Co-authored-by: Martin Wallgren <martin.wallgren@sonymobile.com>
Signed-off-by: Zoran Jovanovic <zoran.jovanovic@sonymobile.com>
Bug: 31052947
Test: run tests from 'OMS: tests for OverlayManagerService'
Change-Id: Idc96dae6fc075d5373aa055bbf50e919136d7353
2017-02-21 14:29:43 -08:00
TreeHugger Robot
ed4cd7a1ba Merge "Log pm install time and package name" 2017-02-21 21:01:20 +00:00
Fyodor Kupolov
4b4ce6fa17 Log pm install time and package name
Bug: 32559349
Test: manual
Change-Id: Ibfbea8cab2ab085109ee4d5a248bfacf82cdfbbb
2017-02-17 16:30:00 -08:00
TreeHugger Robot
8c9a6b0089 Merge "Revert "Revert "Per user setting for instant app""" 2017-02-17 20:46:12 +00:00
Jerry Zhang
9c78253b75 Merge changes from topic 'svcusb' am: 5e2a2ee39e am: 6f44072d03 am: 35f8d6cfd0
am: fba74d6c61

Change-Id: I190467cba81aca56f32a0a6ff6d8e798e1e7ac30
2017-02-17 04:41:32 +00:00
Jerry Zhang
fba74d6c61 Merge changes from topic 'svcusb' am: 5e2a2ee39e am: 6f44072d03
am: 35f8d6cfd0

Change-Id: I10c0be37b583f1670cb98e926aefb9dc8b986843
2017-02-17 02:24:44 +00:00
Jerry Zhang
35f8d6cfd0 Merge changes from topic 'svcusb' am: 5e2a2ee39e
am: 6f44072d03

Change-Id: Ic30bca41e088c2d077dc5aa09e373a02acb60be6
2017-02-17 02:16:11 +00:00
Jerry Zhang
ca1663a093 Add data unlock argument to set function command.
This allows automated switches into file transfer mode,
which makes automated Mtp testing possible.

Test: adb shell svc setFunction mtp true
Bug: 25596495
Change-Id: I67be58853b002789dc22b75d82af9eb6cfb7a361
2017-02-16 13:14:50 -08:00
Todd Kennedy
be0b8896d1 Revert "Revert "Per user setting for instant app""
This reverts commit be9ffa15af9e1906e9ffb505768328d62d4a3793.

Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.EphemeralTest
Change-Id: Ib21321cf157a79890de487060a093840f7182047
2017-02-16 12:43:37 -08:00
Sudheer Shanka
7a627206d4 Merge "Use correct packageName for checking if it belongs to callingUid." 2017-02-16 00:51:49 +00:00
Guang Zhu
be9ffa15af Revert "Per user setting for instant app"
Bug: 35390781

This reverts commit 2f5811dcfd840e149851a9333e27ef3cdddf7a46.

Change-Id: Ibb1c8dacbdc6908fc7fa2bc5dca664f2455162bf
2017-02-15 21:43:48 +00:00
Sudheer Shanka
f88ebeb250 Use correct packageName for checking if it belongs to callingUid.
In AccountManagerService.getAccountsAsUser, we check if opPackageName
belongs to calling uid by calling AppOpsManager.checkPackage. But when
AccountManagerService.getAccountsAsUser is called from
AccountManagerService.addSharedAccountsFromParentUser, we're using the
opPackageName from system context instead of calling context.

Bug: 35258008
Test: cts-tradefed run singleCommand cts-dev --module CtsMultiUserHostTestCases \
      -t android.host.multiuser.CreateUsersPermissionTest#testCanCreateRestrictedUser
Change-Id: I5c425d9314beb86f7c64a5b5c64b7d879711879a
2017-02-14 18:35:05 -08:00
Todd Kennedy
2f5811dcfd Per user setting for instant app
The same application can run as either an instant app or an installed
app. Store this setting per-user instead of based upon the install
location.

Bug: 25119046
Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.EphemeralTest
Change-Id: Iff565bb1ac10d631499f0bd0f69b401cb073c10e
2017-02-14 13:42:01 -08:00
Shreyas Basarge
c3704427c9 BackupManager#cancelBackups() API
Introduces a cancelBackups() API for
BackupManager. When this function returns,
it is guaranteed that currently running
backup operations won't interact with
the active transport.

Bug: 34760860

Ref: https://docs.google.com/document/d/18MnfwkDfKNtXQBPRmL8vpVgfLgSWJsDja1Nm1QV5hOw/edit#heading=h.9p6yo0wx44k3

Test: GTS tests at ag/1893365

Change-Id: I67f78699bbe763ea71c85937fbc01a5b48694eed
2017-02-14 13:51:59 +00:00
Stefanot
f4e237c685 Add instrumentation for BackupManager during restore.
This CL adds more instumentation to
backup/restore operation in the BackupManager. For more details please
point to:
https://docs.google.com/document/d/1sUboR28LjkT1wRXOwVOV3tLo0qisiCvzxIGmzCVEjbI/edit#
This first Cl introduces 3 events that we sent to the monitor.
The base cl is ag/1835775

Test: TODO

BUG: 34873525
Change-Id: I127fe739a7522078eecce2ae689a4607203a98da
2017-02-10 13:52:02 +00:00
Stefanot
b1f573dca3 Add monitoring to backup in BackupManager.
This is the first CL of many that will add instumentation to
backup/restore operation in the BackupManager. For more details please
point to:
https://docs.google.com/document/d/1sUboR28LjkT1wRXOwVOV3tLo0qisiCvzxIGmzCVEjbI/edit#
This first Cl introduces 3 events that we sent to the monitor.

Test: ag/1858962 (same topic)

BUG: 34873525

Change-Id: I6c338b6fd9f4d7c8670dac201897250b6b170677
2017-02-10 11:03:08 +00:00
Tyler Gunn
00f033f234 Merge "Add support for wait-on-handlers command." am: da6d683caa am: a3b4985ad4 am: 3e086be542
am: 8d2d9d758f

Change-Id: Ib2373609eb15e65ae86e14e081c72909d1fd5808
2017-02-08 20:37:32 +00:00
Paul Duffin
c02f6bb64b Merge "Replace com.android.internal.util.Predicate with java.util.function.Predicate" am: 78a20be77a am: 9e99b9ee45
am: 9250814fd2

Change-Id: Ifd924bdb62102657bf0c6d4b07ab919cf0f96c0c
2017-02-08 20:18:34 +00:00
Tyler Gunn
8d2d9d758f Merge "Add support for wait-on-handlers command." am: da6d683caa am: a3b4985ad4
am: 3e086be542

Change-Id: Ib704d3d5c67b987e4daa375c6ca7f2b1a5d8fdbb
2017-02-08 20:16:15 +00:00
Paul Duffin
9250814fd2 Merge "Replace com.android.internal.util.Predicate with java.util.function.Predicate" am: 78a20be77a
am: 9e99b9ee45

Change-Id: I289950cff0cdc6b5ad301936c7b55eadee5fd0f8
2017-02-08 18:30:17 +00:00
Tyler Gunn
3e086be542 Merge "Add support for wait-on-handlers command." am: da6d683caa
am: a3b4985ad4

Change-Id: I80669c442c53a49687974851dccf0c9c9b500e96
2017-02-08 18:27:37 +00:00
Paul Duffin
78a20be77a Merge "Replace com.android.internal.util.Predicate with java.util.function.Predicate" 2017-02-08 18:06:08 +00:00
Paul Duffin
ca4964ccbe Replace com.android.internal.util.Predicate with java.util.function.Predicate
Bug: 35089332
Bug: 30188076
Test: make checkbuild
Change-Id: I0a5b4bf520fc39b59d8d790b01e9cff0d54e6d21
2017-02-08 11:55:39 +00:00
Wei Wang
dbdda2b60e BootAnimation: change log format when animation starts
Bug: 34499826
Test: on marlin
Change-Id: I719485d399406abc08360620c09d90f4b87934a6
2017-02-07 18:59:58 -08:00
Paul Duffin
3e5fbca0c5 Replace com.android.internal.util.Predicate with java.util.function.Predicate
Bug: 35089332
Bug: 30188076
Test: make checkbuild
Merged-In: I0a5b4bf520fc39b59d8d790b01e9cff0d54e6d21
Change-Id: I58e4e35e7b7315033d893748f7c79e1ba6732f39
2017-02-07 16:57:54 +00:00
Tyler Gunn
18dfc36012 Add support for wait-on-handlers command.
Add support for wait on handlers adb telecom command.  Used in CTS
tests to ensure work is completed once all Telecom handlers have finished
their current work.

Test: CTS, Manual
Bug: 34159263
Change-Id: I14acc0a04710b445c172629c2327813ee73a5a55
2017-02-06 20:47:04 -08:00
Wei Wang
a90c54c90e BootAnimation: Add log when animation starts
Bug: 34499826
Test: on marlin
Change-Id: I04e4663daf4b30e2ab3c1ddda215127cf7faef9f
2017-02-02 20:17:54 -08:00