Commit Graph

6093 Commits

Author SHA1 Message Date
TreeHugger Robot
96a30ab84c Merge "Improve shortcut backup & restore." 2017-10-11 23:55:33 +00:00
Makoto Onuki
a4f89b1251 Improve shortcut backup & restore.
From http://go/p-shortcut-restore :

Currently on pre-P builds, there are 6 cases where shortcuts won't be restored.

Launcher issue:
A: Launcher is downgraded
B: Launcher has allowBackup="false"
C: Launcher's signature changed.
A-C would result in not restoring any shortcuts from any apps.

App issue:
D: App is downgraded
E: App has allowBackup="false"
F: App's signature changed.
D-F would result in not restoring any shortcuts from individual apps.

In P, we'll restore all pinned shortcuts anyway except in case B and C.

The new behavior would be:
A: We'll restore all pinned shortcuts anyway even if the launcher is downgraded.
B: If the launcher doesn't support backup&restore, we still don't restore shortcuts.
C: If the launcher has a different signature, we still don't restore shortcuts.

D, E, F: All pinned shortcuts will be restored, but are disabled.

In case of D, E, F, shortcuts would be:
1. ShortcutInfo.isEnabled() will return false. They are not launchable.
2. If it's case D (downgrade), shortcuts will be re-enabled once a publisher app
is updated to the original version or higher.
3. getDisabledMessage() will return a special, canned message explaining why
they're disabled.
4. A new API getDisabledReason() will return one of the following values:
 - DISABLED_REASON_NOT_DISABLED (for non-disabled shortcuts)
 - DISABLED_REASON_BY_APP (for shortcuts disabled by apps)
 - DISABLED_REASON_APP_CHANGED (for shortcuts disabled when a manifest shortcut is gone.)
 - DISABLED_REASON_VERSION_LOWER (case D)
 - DISABLED_REASON_BACKUP_NOT_SUPPORTED (case E)
 - DISABLED_REASON_SIGNATURE_MISMATCH (case F)
 - (DISABLE_REASON_OTHER_RESTORE_ISSUE for future use)
Launcher can opt to use this API to show a custom error message, rather than
using the canned system message from getDisabledMessage().

5. This spec change is completely transparent to publisher apps.
In case D,E,F, the disabled shortcuts will only be visible to the launcher,
and from the publisher app's point of view, they still don't exist.
APIs such as getPinnedShortcuts() will not return them, and updateShortcuts()
will not affect them. The enableShortcut() will not enable them either.

Bug 62451035
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest1 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest2 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest3 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest4 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest5 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest6 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest7 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest8 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest9 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest10 -w com.android.frameworks.servicestests
Test: cts-tradefed run cts-dev --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -l INFO -m CtsShortcutManagerTestCases
Test: cts-tradefed run cts-dev --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -l INFO -m CtsShortcutHostTestCases

Change-Id: Ib4d73aa44a0395f5e37c8ad0c9cd041a9038fb66
2017-10-11 14:50:38 -07:00
TreeHugger Robot
7c3c3c8bf8 Merge "Expose API for heavy-weight apps and get it working again." 2017-10-11 18:36:06 +00:00
Dianne Hackborn
70c95c5674 Expose API for heavy-weight apps and get it working again.
Still very rough UI, but basically does what is intended.
Also add two tests apps for manual tests (CTS test will
be coming).

Bug: 63937884
Test: manual

Change-Id: I45a6a2b122a75f8125510a2027bb1faf57c6956d
2017-10-10 17:57:22 -07:00
Hyunyoung Song
a91a0c5dc4 Merge "Wrap StackOverflowError in NotFoundException. Bug: 67462465 Test: builds and tested using faulty apk with recursive drawable. Change-Id: I47691343dae892beb5ed8c1c66c33edefade321e" into oc-mr1-dev am: 384689934d
am: 3702ce391d

Change-Id: I2ca8d4fb271245e3fc9b7f406456e3dc54dd96cd
2017-10-10 22:42:02 +00:00
Hyunyoung Song
3702ce391d Merge "Wrap StackOverflowError in NotFoundException. Bug: 67462465 Test: builds and tested using faulty apk with recursive drawable. Change-Id: I47691343dae892beb5ed8c1c66c33edefade321e" into oc-mr1-dev
am: 384689934d

Change-Id: Id4885fe270e24d54830d6858e37487de551a3f52
2017-10-10 22:30:23 +00:00
Hyunyoung Song
dc92d925d8 Wrap StackOverflowError in NotFoundException.
Bug: 67462465
Test: builds and tested using faulty apk with recursive drawable.
Change-Id: I47691343dae892beb5ed8c1c66c33edefade321e
2017-10-10 12:41:05 -07:00
TreeHugger Robot
faa5840f06 Merge "Move mPermissionTrees to permission settings" 2017-10-10 17:49:18 +00:00
Mady Mellor
4575aa52d7 First version of SliceView (hidden for now)
Very basic template support

Test: to be added
Change-Id: Ie5720345e23909dd12d0b0c2facfee687da2ae1a
2017-10-07 11:41:26 -07:00
Todd Kennedy
c842393bc5 Move mPermissionTrees to permission settings
Move more state / logic into the permission sub-package. We're
close to being able to wholesale move large amounts of code from
package manager into the permission manager.

Bug: 63539144

Test: Manual. Builds and runs
Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.PermissionsHostTest
Test: cts-tradefed run commandAndExit cts-dev -m CtsPermissionTestCases
Test: cts-tradefed run commandAndExit cts-dev -m CtsPermission2TestCases
Test: bit FrameworksServicesTests:com.android.server.pm.PackageManagerSettingsTests
Change-Id: Id292441ff22b14665fd77f700ad934bf2c5a3357
2017-10-06 07:08:23 -07:00
TreeHugger Robot
625a64c243 Merge "First version of Slice data APIs (hidden for now)" 2017-10-05 18:36:45 +00:00
TreeHugger Robot
e0fa2c0408 Merge changes I616184fa,Ibc1500f5
* changes:
  Move mPermissions from package settings
  Move DefaultPermissionGrantPolicy
2017-10-05 18:30:33 +00:00
Jason Monk
d9edfa94b0 First version of Slice data APIs (hidden for now)
Doesn't handle the viewing side, that will come separately.

Test: CTS once unhidden
Change-Id: I78f167bd72fe0be1e0577f8f969a7ffcbcbab666
2017-10-05 12:47:21 -04:00
Todd Kennedy
0eb9738d17 Move mPermissions from package settings
Create a settings class only for use with permissions. It's
subservient [and should only be accessed directly by] package
settings or the permission manager. The rest of the permission
related data needs to be moved to permission settings. At
which point we can start pulling the permission methods out of
the package manager service and into the permission manager.

We still have a somewhat tight relationship between package
manager and the permission manager. It's unclear how far we need
to separate them and if relying entirely on an internal
interface is sufficient.

Bug: 63539144
Test: Manual. Builds and runs
Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.PermissionsHostTest
Test: cts-tradefed run commandAndExit cts-dev -m CtsPermissionTestCases
Test: cts-tradefed run commandAndExit cts-dev -m CtsPermission2TestCases
Test: bit FrameworksServicesTests:com.android.server.pm.PackageManagerSettingsTests
Change-Id: I616184fa2135a11687e4ce615884f861466fdebe
2017-10-05 07:18:10 -07:00
Felipe Leme
e541b65c03 Merge "Sets AutofillClient on attachBaseContext()" into oc-mr1-dev am: 6d17d9d0cf
am: 63b45a87d5

Change-Id: Ib7ae51cf0336c4cea8ff90d60995816d43b3fa36
2017-10-04 22:42:29 +00:00
Felipe Leme
63b45a87d5 Merge "Sets AutofillClient on attachBaseContext()" into oc-mr1-dev
am: 6d17d9d0cf

Change-Id: I4b1d2a4e308a91d15282ae99ee158b7004b91211
2017-10-04 22:25:18 +00:00
Felipe Leme
bb567ae6c0 Sets AutofillClient on attachBaseContext()
When an activity overrides attachBaseContext(), the attached context must share
the same AutofillCient, otherwise it will break autofill in the activity.

Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases -t android.autofillservice.cts.AttachedContextActivityTest
Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases

Fixes: 67350639

Change-Id: I6b0c4c2fab5fa68eb6ee0714e107ca0816efb2cb
2017-10-04 12:23:23 -07:00
Todd Kennedy
82b0842051 Move DefaultPermissionGrantPolicy
Move this class to the permission sub-class. No longer depends upon
PackageManager's lock and adds some internal interfaces so it can
get back to the PackageManager.

Bug: 63539144
Test: Manual. Builds and runs
Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.PermissionsHostTest
Test: cts-tradefed run commandAndExit cts-dev -m CtsPermissionTestCases
Test: cts-tradefed run commandAndExit cts-dev -m CtsPermission2TestCases
Change-Id: Ibc1500f56cfb67722e68b258ea59118603508912
2017-10-03 16:57:11 -07:00
Etan Cohen
5b8273e465 Merge "[RTT2] Add API for testing whether feature exists on platform" 2017-10-03 20:14:31 +00:00
TreeHugger Robot
48ffde7ed0 Merge "[RTT2] New (v2) Wi-Fi RTT framework" 2017-10-03 15:48:31 +00:00
Etan Cohen
692e68e7a2 [RTT2] Add API for testing whether feature exists on platform
Add PackageManager API which allows apps to test whether the platform
officially supports the Wi-Fi RTT API.

Only start the RTT service if the device supports it.

Bug: 65014628
Test: integration tests pass
Change-Id: Ie88bd29ccd592e9a29ff24e8cc346afc360f03b0
2017-10-03 07:01:05 -07:00
Etan Cohen
17ba47254c [RTT2] New (v2) Wi-Fi RTT framework
Replace existing Wi-Fi RTT manager framework. Creating new framework
in parallel since there's code using the new framework - will be
switched over once new version ready.

New version is AIDL-based.

Bug: 65014552
Test: unit tests and integration tests
Change-Id: Id468c9b2a3c94eb30959f5ac5e4b1688fb8fc633
2017-10-03 07:01:01 -07:00
TreeHugger Robot
c92d97c450 Merge "Shortcut: Avoid long lines in dumpsys" 2017-10-03 01:38:47 +00:00
Makoto Onuki
6208c675fd Shortcut: Avoid long lines in dumpsys
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest1 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest2 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest3 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest4 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest5 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest6 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest7 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest8 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest9 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest10 -w com.android.frameworks.servicestests
Change-Id: Iaf758860cb492436685f177fcc9dc68cb341a462
2017-10-02 16:20:35 -07:00
TreeHugger Robot
e5f03a6607 Merge "Move BasePermission to own package" 2017-09-29 14:31:05 +00:00
Jeff Sharkey
f8bb2445ff Finish removing ASEC.
Awhile back we explicitly blocked any new ASEC installs, with the
expectation that we'd eventually remove the logic entirely.  We've
had them disabled for about a week now without incident, so let's
rip out the remaining code.

Test: bit FrameworksCoreTests:android.content.pm.PackageHelperTests
Test: bit FrameworksCoreTests:android.content.pm.PackageManagerTests
Bug: 32913676
Change-Id: I1ecc35487420731f5c4bdf03bca5751548ce51b3
2017-09-28 11:32:57 -06:00
Todd Kennedy
91a39d126d Move BasePermission to own package
This is the first of many changes. Moving permissions to their own package.

Change-Id: I60e94e2da3c96788fc165e97e813ab5b9ee51586
Bug: 63539144
Test: Manual. Builds and runs
Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.PermissionsHostTest
Test: cts-tradefed run commandAndExit cts-dev -m CtsPermissionTestCases
Test: cts-tradefed run commandAndExit cts-dev -m CtsPermission2TestCases
2017-09-27 14:57:24 -07:00
nharold
a61d0899de Merge changes from topic "re-enable-ipsec" am: 680525c742 am: 8d306cd78a am: 80107540bb
am: 80b90ed99a

Change-Id: Idffe4296539c6f0db00ce3ec2e5241224ece39b4
2017-09-26 22:49:36 +00:00
nharold
80b90ed99a Merge changes from topic "re-enable-ipsec" am: 680525c742 am: 8d306cd78a
am: 80107540bb

Change-Id: I13a7134864a648aff9338fda044b3bffd653119e
2017-09-26 22:39:01 +00:00
nharold
8d306cd78a Merge changes from topic "re-enable-ipsec"
am: 680525c742

Change-Id: Ia1d1f3981a9dd1eb8f60631d318211daf135d575
2017-09-26 22:13:20 +00:00
nharold
680525c742 Merge changes from topic "re-enable-ipsec"
* changes:
  Re-Expose IpSecService API Surface
  Re-Enable Starting of the IpSecService
2017-09-26 21:46:39 +00:00
Jorim Jaggi
7ace43b538 Merge "Improve window manager layout attribute dumping" 2017-09-25 15:11:30 +00:00
Jorim Jaggi
484851b914 Improve window manager layout attribute dumping
Test: adb shell dumpsys window
Change-Id: I9c76e6a6950265b49667cc19998282ef0c682815
2017-09-25 13:31:04 +02:00
Christopher Schuster
8c238c5a7d Merge "fixed handling of data URI schemes in Intent.toUri" am: c3d3cf5666 am: 928b7cba47 am: 067cfb369d
am: ef34f7b35d

Change-Id: I9c5a3706850706053d26ecdadf602ab2fafe3e8d
2017-09-22 20:15:29 +00:00
Christopher Schuster
ef34f7b35d Merge "fixed handling of data URI schemes in Intent.toUri" am: c3d3cf5666 am: 928b7cba47
am: 067cfb369d

Change-Id: I811b1b7e0b62d4143292a94fd4b5478f74cdec24
2017-09-22 20:00:45 +00:00
Kweku Adams
a9a755b2a5 Merge "incidentd: Adding Notification Listener and Disabling Effects Data to NotificationManager proto output." 2017-09-22 18:08:00 +00:00
Christopher Schuster
928b7cba47 Merge "fixed handling of data URI schemes in Intent.toUri"
am: c3d3cf5666

Change-Id: Id4b8ef16f7a428e6c3d8b382387cf575d05926ad
2017-09-22 15:02:03 +00:00
Kweku Adams
93304b6850 incidentd: Adding Notification Listener and Disabling Effects Data to NotificationManager proto output.
RankingHelper will be done in another CL...that's likely a large CL on
its own.

BUG: 65750824
Test: flash on device and check incident.proto output
Change-Id: I740166aed6ac6769ee3e013cf2bd403256eb77dc
2017-09-21 12:46:49 -07:00
Christopher Schuster
42c3a6e6af fixed handling of data URI schemes in Intent.toUri
Data URIs in intents can use schemes with digits and some special
characters (see RFC 2396 and 3986). This patch fixes how these
data URIs are handled by Intent.toUri to support these schemes.

Bug: 63930680
Test: run cts android.content.cts.IntentTest#testUris
Change-Id: I0dbb72325f59f372abba83be9e14c59d5665a053
Signed-off-by: Christopher Schuster <levjj@google.com>
2017-09-21 15:20:16 +00:00
Steven Timotius
4346f0a15c Convert ActivityManager dumpsys to protobuf
Also adding ActivityInfo.RESIZE_MODE_RESIZEABLE to TestApi

Test: cts-tradefed run commandAndExit cts-dev --module CtsActivityManagerDeviceTestCases

Change-Id: I958aa155b266799840ece1ca07feed8593724449
2017-09-20 11:30:59 -07:00
Adam Bookatz
43b272e20c Merge changes I82fe220e,Iff324c73,I3bd73acd
* changes:
  indexed priority queue for AnomalyMonitor
  StatsCompanionService connection to Statsd
  Set up StatsCompanionService.java
2017-09-20 14:01:49 +00:00
Michael Wright
1985976b66 Improve WMP dumpsys readability.
It's hard enough to read bugreports without having to decipher all of
the various IntDef's littered around; let's go ahead and just translate
them to something readable.

Bug: 65563703
Test: adb shell dumpsys window policy
Change-Id: Iea6cd309eb3411a65e54217fef814a66107a8e31
2017-09-18 21:21:47 +01:00
Wale Ogunwale
0d5609ba8c Added WindowConfigurationProto and friends
Also added WindowContainerProto and ConfigurationContainerProto
Will be used by cts tests in upcoming CLs that replace StackId APIs.

Test: adb shell dumpsys window --proto
Bug: 64146578
Change-Id: Id6ca2a93e3d15ac696ab54cb241870e973985967
2017-09-18 07:23:23 -07:00
Svet Ganov
087dce20e3 Add new OEM permission flavor
The new OEM permission flavor of signature protected perissions
can be granted only to apps on the OEM partition if they are:

 1. Signed as the one declaring the permission

 2. The requesting app is on OEM partition of the system image and
    declares the permission used and the OEM explicitly granted this
    permission by adding an entry in /oem/permission/*.xml
    with the following format:

    <permissions>
        <oem-permissions package="foo.bar.baz">
            <permission name="android.permission.ACCESS_FOO" granted="true"/>
        </oem-permissions>
    </permissions>

All OEM permissions requested by any app on the OEM partition
must be declared granted or not to force the OEM making a well
though out explicit choice. If that condidtion is not met the
system server restarts - this prevents shipping a device with
OEM permissions for which no opition was explicitly expressed.

Normal apps requesting an OEM permission has no effect, i.e the
permission is only granted on a signature match.

Change-Id: I345bb0b56368ee03e4bd768faab540ee4e0571ae
Bug: 65497745
Test: Manual
2017-09-14 11:48:45 -07:00
Nathan Harold
d999d225a8 Re-Expose IpSecService API Surface
Note, This reverts commit bd62d6aff2.

Bug: 64800246
Test: compilation
Change-Id: I709d4c476647cfe9f6b982fc373f8d76018b3922
2017-09-12 19:25:13 -07:00
Bookatz
9472641287 Set up StatsCompanionService.java
Introduces StatsCompanionService.java and sets it up as a system service.

This service is a helper for statsd. It will be responsible for setting
and cancelling alarms related to polling stats and anomaly detection.

It currently does not have selinux permission, so must be started
manually (or with selinux temporarily disabled).

Test: disable enforcing selinux, then set and cancel alarms and make
sure they work.

Change-Id: I3bd73acdd998ee424696cce40965134c14220d8f
2017-09-12 14:56:54 -07:00
Paul Duffin
0a22778237 Remove org.apache.http.legacy from bootclasspath
Updated data/etc/platform.xml to make the org.apache.http.legacy library
usable by applications. The runtime location of the
org.apache.http.legacy library is
/system/framework/org.apache.http.legacy.boot.jar not
/system/framework/org.apache.http.legacy.jar.

Stop removing org.apache.http.legacy from the required and optional
shared library lists and instead add it to the required list if it is
not present in either and the package is targeted at SDK
version <= O_MR1.

Bug: 18027885
Test: make FrameworksCoreTests, install and run
Change-Id: I686e3c20f5860e58825e1b88f220f9b8c335849c
2017-09-11 11:28:41 +01:00
Calin Juravle
acef92cde7 Merge "Handle configuration splits when creating the class loader context" into oc-mr1-dev am: ed54b41e3c
am: b2e1a3cbc2

Change-Id: I9c36d6cd44a6f65a3bbd6ea89f1f328e7fbfcfc6
2017-09-09 00:29:41 +00:00
Calin Juravle
ed54b41e3c Merge "Handle configuration splits when creating the class loader context" into oc-mr1-dev 2017-09-08 21:55:28 +00:00
Calin Juravle
da09815e2c Handle configuration splits when creating the class loader context
Configuration splits have no dependencies which can lead to exceptions
when computing their class loader context.

In general, we do not need to compute the class loader context for apks
without code.

This CL addresses the issue by ignoring "code" paths with no actual code.

Bug: 65159159
Test: adb install-multiple config_splits
      runtest -x
services/tests/servicestests/src/com/android/server/pm/dex/DexoptUtilsTest.java

Change-Id: Ida1eb901eecba4a4266de73022f6ee4659367873
2017-09-06 23:31:53 -07:00