1928 Commits

Author SHA1 Message Date
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
TreeHugger Robot
5c34fa8ae7 Merge "Initialize bootanimation sound on separate thread" 2017-02-01 15:46:01 +00:00
Geoffrey Pitsch
a917353da0 Initialize bootanimation sound on separate thread
Blocks when it's time to play the first sound.
Bug: 30189706
Test: on marlin
Change-Id: Ib3666fbfb5f109c633ed59edad4a283b8ada8ae2
2017-01-31 15:49:06 -08:00
Robert Carr
db7ecbe699 Correct Screencap utility code.
Screenshot interface now takes signed parameters.

Bug: 34758075
Test: None
Change-Id: I884456ce7f22a9e57990371ad66f6bb55d09e999
2017-01-31 11:02:58 -08:00
Shukang Zhou
bb44e42de9 [Frameworks] Add an 'am' cmd option to enable streaming in profiling.
Add option '--streaming' to 'am start' and 'am profile' commands.
If the option is given, the output of method trace profiling
will be streamed into the specified file, so the output is no
longer limited by the buffer size.

Test: m -j48 test-art-host;
m -j48 ART_TEST_TRACE=true ART_TEST_TRACE_STREAM=true test-art-host;
I also tested manually. Tried all 8 combinations of
    sampling/instrumention
    streaming/non-streaming
    'am start --start-profiler' / 'am profile start'
The output files are all in expected shape.

Bug: 33300765

Merged-In: I8a5136a1c7330c8260b7c6c8da63f42a73aee275

Change-Id: I8a5136a1c7330c8260b7c6c8da63f42a73aee275
2017-01-30 13:07:40 -08:00
Shukang Zhou
221e58fe95 Merge "[Frameworks] Add an 'am' cmd option to enable streaming in profiling." am: e924640c4b
am: b0f03a64ea

Change-Id: I35fa80e43cd4f6af76099848714f838f217b7989
2017-01-27 19:01:44 +00:00
Treehugger Robot
e924640c4b Merge "[Frameworks] Add an 'am' cmd option to enable streaming in profiling." 2017-01-27 18:49:45 +00:00
Elliot Waite
0ce4b0e4c3 Fix @links in reference docs. am: 54de77470d am: ab978c035e am: 28ba4722a9
am: 9b21265b2c

Change-Id: If246ebdb36cf2832d5a6c42cbe752e290b6fb6e8
2017-01-26 04:49:33 +00:00
Elliot Waite
9b21265b2c Fix @links in reference docs. am: 54de77470d am: ab978c035e
am: 28ba4722a9

Change-Id: I98177a8cf0a20677e140406bb7371474ca259e5b
2017-01-26 04:44:54 +00:00
Elliot Waite
28ba4722a9 Fix @links in reference docs. am: 54de77470d
am: ab978c035e

Change-Id: If0d0613362e0ea95cf48eaf9a16d3eea48b589ea
2017-01-26 04:39:57 +00:00
Elliot Waite
ab978c035e Fix @links in reference docs.
am: 54de77470d

Change-Id: Id38c30bad13d6b61ed504a06471b9f197b360f7b
2017-01-26 04:34:57 +00:00
Elliot Waite
54de77470d Fix @links in reference docs.
Change-Id: I40cea46efd80c448640ff69753698fe8404da40b
2017-01-25 17:00:55 -08:00
Shukang Zhou
6ec0b7e21d [Frameworks] Add an 'am' cmd option to enable streaming in profiling.
Add option '--streaming' to 'am start' and 'am profile' commands.
If the option is given, the output of method trace profiling
will be streamed into the specified file, so the output is no
longer limited by the buffer size.

Test: m -j48 test-art-host;
m -j48 ART_TEST_TRACE=true ART_TEST_TRACE_STREAM=true test-art-host;
I also tested manually. Tried all 8 combinations of
    sampling/instrumention
    streaming/non-streaming
    'am start --start-profiler' / 'am profile start'
The output files are all in expected shape.

Bug: 33300765

Merged-In: I8a5136a1c7330c8260b7c6c8da63f42a73aee275

Change-Id: I8a5136a1c7330c8260b7c6c8da63f42a73aee275
2017-01-25 16:53:41 -08:00
Adam Lesinski
4e8628157a Add support for Split APK dependcies
Apps can now declare in their base APK AndroidManifest.xml
that they want to have their split APKs loaded in isolated
Contexts. This means code and resources from the split
get loaded into their own ClassLoader and AssetManager.

<manifest xmlns:android="..."
          ...
          android:isolatedSplits="true"
          ...

In order to make this more useful, splits can declare dependencies
on other splits, which will all get pulled in to the Context
and run as expected at runtime.

A split declares its dependency on another split by using the
tag <uses-split> in its AndroidManifest.xml:

<manifest xmlns:android="...">
    ...
    <uses-split android:name="feature_split_1" />
    ...

A split can have a single parent on which it depends on. This is
due to the limitation of having a single ClassLoader parent.
All splits depend on the base APK implicitly.

PackageManager verifies that no cycles exist and that each dependency
is present before allowing an installation to succeed.

The runtime will then load splits based on the dependencies.

Given the following APKs:

base <-- split A <-- split C
  ^----- split B

If an Activity defined in split C is launched, then the base,
split A, and split C will be loaded into the ClassLoader defined
for the Activity's Context. The AssetManager will similarly be loaded
with the resources of the splits.

A split can be manually loaded by creating a Context for that split, defined
by its name:

Context.createContextForSplit("my_feature_split_1");

All installed Activities, Services, Receivers, and Providers are accessible
to other apps via Intent resolution. When they are instantiated, they are
given the appropriate Context that satisfies any dependencies the split they
were defined in stipulated.

Test: WIP (CTS tests to come)
Change-Id: I8989712b241b7bc84381f2919d88455fcad62161
2017-01-24 18:34:08 -08:00
Frank Barchard
39a1fce439 media volume allow --get to be combined with --set and --adj
Bug: 33819516
Test: adb shell media volume --stream 3 --adj lower --get
Change-Id: Ie30f5c0ea54bfac59c2e05513da61a98658f7d0e
2017-01-24 23:47:19 +00:00
Shreyas Basarge
865303fce5 API to select backup transport
This cl adds an API to select a backup
transport by its component name and
receive a callback when BackupManager
is bound to the transport. Calling this API
will make BackupManager bind to the transport
if it isn't already bound to it.

Also fixes the issue where BackupManager would
detect only one transport per package.

Ref: go/backup-transport-switching

Bug: 33616220
Test: Manually tested. GTS tests will be put up shortly.

Change-Id: I8c23bdbb84ceb05eb1fad9b3a8b9c4441cb06c74
2017-01-24 17:28:48 +00:00
Paul Duffin
762b31f7a4 Merge "Prepare for removal of legacy-test from default targets (Part 2)" am: 5a3a3d298a am: a07f9d522b
am: 5aa7e5b46f

Change-Id: I6aede1f1e2216233493cebe3efba43686aa3ad0d
2017-01-24 16:18:43 +00:00
Paul Duffin
5aa7e5b46f Merge "Prepare for removal of legacy-test from default targets (Part 2)" am: 5a3a3d298a
am: a07f9d522b

Change-Id: I758123e58a78ac515fb4ed0ce8e1647cfd1a3dc8
2017-01-24 16:12:57 +00:00
Paul Duffin
4190f233f9 Prepare for removal of legacy-test from default targets (Part 2)
In preparation for removing junit classes from the Android API
the legacy-test target will be removed from the
TARGET_DEFAULT_JAVA_LIBRARIES. This change adds explicit
dependencies on junit and/or legacy-android-test to ensure that
modules will compile properly once it is removed.

Bug: 30188076
Test: make checkbuild
Merged-In: If507b641624a2933e722f61e815890fcdf442265
Change-Id: Icdcad50f1cc32e900bc9e882f1db2867ea170fbf
2017-01-24 15:26:42 +00:00
Svet Ganov
6788212d17 Platform support for static shared libraries
This change adds support for static shared libraries that
emulate static linking allowing apps that statically link
against the same library version to share a common
implementation. A library is hosed by a package in a standard
APK.

Static shared libraries have a name and a version declared
by a dedicated manifest tag. A client uses also a new tag
to refer to the static library it uses by specifying the
lib name, version, and the hash of the signing certificate.
This allows two apps to rely on two different library versions
and prevents impersonation of the shared library by a side-loaded
app with the same package name.

Internally apps providing static libs use synthetic package
name generated from the manifest package name and the library
version. This allows having different "versions" of the same
package installed at the same time.

An application cannot be installed if a static shared lib it
depends on is missing. A used shared library cannot be uninstalled.
Shared libraries can rotate certificates like normal apps. The
versions of these libs should be ordered similarly to the version
codes of the hosting package. Such libs cannot use shared user
id, cannot be ephemeral, cannot declare other libraries, cannot
rename their package, cannot declare child-packages. They must
target O SDK. Also they cannot be suspended or hidden or their
uninstall blocked. Generally, speaking policy regarding code in
static shared libs should be applied to the packages using the
library as it could have just statically linked the code.

We now have APIs to query information about the shared libraries
on the device in general. To clients static shared libraries are
presented as multiple versions of the same package which is how
they are declared and published. Therefore, one can have two
versions of the same package which means we need way to query
for and uninstall a specific version of a package. Also static
shared libs can depend on other static shared libs which are
versioned packages. To ease representation we add the concept
of a versioned package which should be used in the case of
static shared libs.

A client can see only the static shared libs it depends on and
more specifically only the versions it depends would be retrieved
by using the standard package manager APIs. There is a new
dedicated API to get info about all shared libraries which
would provide data about all static shared lib versions. Also
these libraries must use v2 signing scheme.

Test: CTS tests pass

bug:30974070

Change-Id: I4f3d537ee7a81f880950377b996e1d9d4813da5c
2017-01-22 14:05:15 -08:00
Paul Duffin
1d0244a846 Prepare for removal of legacy-test from default targets
In preparation for removing junit classes from the Android API
the legacy-test target will be removed from the
TARGET_DEFAULT_JAVA_LIBRARIES. This change adds explicit
dependencies on junit and/or legacy-android-test to ensure that
modules will compile properly once it is removed.

Bug: 30188076
Test: make checkbuild
Change-Id: If507b641624a2933e722f61e815890fcdf442265
2017-01-20 09:00:33 +00:00
Shreyas Basarge
38e7486d38 Non incremental backup flag for requestBackup
This cl adds a new requestBackup API to
BackupManager that takes in an int flag
to indicate whether the caller wants the
entire key value set to be passed to the
transport and not just a diff.

Change-Id: Ia225797a58c4431fe742f2f116b257d006b30cd1

Bug: 33749084
Ref: go/request-backup-api-changes
Test: GTS Test at ag/1774002
2017-01-19 22:13:01 +00:00
Paul Duffin
43267b4b9e Merge "Prepare for removal of legacy-test from default targets" am: c74ccf1588 am: ab62fd67d8
am: 56a2ae1056

Change-Id: I0ede6895eb25f72a74af3ac4431a21960500bec5
2017-01-19 11:49:28 +00:00
Paul Duffin
56a2ae1056 Merge "Prepare for removal of legacy-test from default targets" am: c74ccf1588
am: ab62fd67d8

Change-Id: I923de1762a15fca7dc255f9dfe0ecce6f54d333c
2017-01-19 11:44:56 +00:00
Paul Duffin
ccb0445027 Prepare for removal of legacy-test from default targets
In preparation for removing junit classes from the Android API
the legacy-test target will be removed from the
TARGET_DEFAULT_JAVA_LIBRARIES. This change adds explicit
dependencies on junit and/or legacy-android-test to ensure that
modules will compile properly once it is removed.

(cherry picked from 6387604f9e672ece85e07c4bcbd7be396867f06f)

Bug: 30188076
Test: make checkbuild
Merged-In: I13e88297731253420e4e5f5291d503f13a39a156
Change-Id: I58446eb8c45d8ac2bcdbc9fa40d1321e811bdd4b
2017-01-19 09:43:05 +00:00
Paul Duffin
648abd31e8 Merge "Prepare for removal of legacy-test from default targets" 2017-01-19 09:34:19 +00:00
Josh Gao
ed5444ba4f app_process: don't use PR_SET_NO_NEW_PRIVS. am: 92517e4c03 am: b6025a2be1 am: f442f1bd66
am: 19c0d60d14

Change-Id: I839f9762c6705c3422c0e286600241943f88f348
2017-01-19 00:43:47 +00:00