Commit Graph

5222 Commits

Author SHA1 Message Date
Chad Brubaker
06ca1e0873 Allow Instant Apps access PackageInfo of exposed apps
Instant Apps can only see apps that explicitly expose a component via
android:visibleToInstantApp.

Bug: 34087569
Test: cts-tradefed run commandAndExit cts-dev -m
CtsAppSecurityHostTestCases -t android.appsecurity.cts.EphemeralTest
Change-Id: Ibcba43597f545966abc883e90008369fb20d61ae
2017-03-16 18:42:00 -07:00
TreeHugger Robot
2bd3c49eb4 Merge "Add feature tag android.hardware.vr.headtracking." 2017-03-16 20:28:03 +00:00
Craig Donner
279dd66dfd Add feature tag android.hardware.vr.headtracking.
Different versions of this feature specify different levels of
headtracking capability.

Bug: 36294374
Test: build
Change-Id: I00273c9093321661b5ca519d7cd065ae0105c3b2
2017-03-16 11:48:27 -07:00
Jeff Sharkey
b30ee8d025 Merge "Create new BroadcastBehavior annotation." 2017-03-16 17:06:39 +00:00
TreeHugger Robot
c2d761a445 Merge "Adapt unpaged cursors to paged requests." 2017-03-15 23:59:26 +00:00
Steve McKay
e5f868fd31 Adapt unpaged cursors to paged requests.
Allow all client targeting Android O to assume paging
    support for any provider.
Adds a new PageViewCursor that adapts an unpaged cursor
    to a paged request.
Updates ContentProviderNative to perform wrapping on
    unpaged results.

Bug: 30927484
Change-Id: I4e225dc16761793c85ef8a195bf049113c79cd20
Test: Added for new class. Run info @ frameworks/base/core/tests/coretests/README
2017-03-15 15:29:52 -07:00
TreeHugger Robot
5fff20cac1 Merge "Clean up public FontConfig APIs" 2017-03-15 18:52:04 +00:00
Seigo Nonaka
ac873c9f25 Clean up public FontConfig APIs
This CL contains following clean up:

- Hide unnecessary constructors.
- Change List<XX> to XX[] since actually all fields are immutable.
- Change font's variant type from String to int.
- Decouple resource related members to FontResourcesParser.
- Add NonNull/Nullable to all fields.

Test: ran android.content.res.FontResourcesParserTest

Change-Id: If456266ffff86d41342572a19662cc8f3cd13181
2017-03-15 10:16:55 -07:00
TreeHugger Robot
be4cf58436 Merge "Add API to mark apps that have an update available" 2017-03-15 17:04:22 +00:00
Todd Kennedy
ab53289c59 Add API to mark apps that have an update available
Ostensibly for instant apps, we allow play to mark an app as having
an update available. This will trigger instant app resolution even
if the instant app is already installed on device.

Bug: 35143464
Test: Manual; launch URI of installed instant app, see it runs w/o resolution. set bit. launch URI of installed instant app, see it runs resolution
Change-Id: I511df2b2a3eab39377167c770255ccbe02d5dad2
2017-03-15 07:31:09 -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
Jeff Sharkey
3fcba6afde Merge "Move PackageInstaller over to AppFuse." 2017-03-13 21:44:40 +00:00
Chad Brubaker
ebf3a0d57f Merge changes from topic 'receiver_IA'
* changes:
  Enforce visibleToInstantApps for receivers
  Only send exposed broadcasts to Instant Apps
2017-03-13 20:52:18 +00:00
Jeff Sharkey
02d4e3441b Move PackageInstaller over to AppFuse.
When PackageInstaller was originally written, we needed a way to
ensure that untrusted apps were fully hands-off of any opened
FileDescriptors before we could proceed with certificate checks.

The best way to satisfy this security constraint was to build
a utility called FileBridge which was a (terribly slow) RPC
mechanism that could be cut off when needed.

However, a new feature called "AppFuse" offers to create a "proxy"
FileDescriptor which relays file operations back into userspace, and
it's much more performant than FileBridge.  (Local benchmark tests
that deliver a 64MB APK show that AppFuse is about 45% faster than
FileBridge.)  Because userspace is still involved in every operation,
we can still "revoke" access at any time to deliver on our security
requirements.

This change adds support for AppFuse, while keeping around FileBridge
as the default for now.  An upcoming flag-flip CL can be used to
easily switch between the two modes.

Test: builds, boots, benchmarking, stress tests
Bug: 35728404, 31332379, 25510838
Change-Id: I2a70c0ca922a5ba468ffdef7b2fd8ab79f7cfefd
2017-03-13 13:59:12 -06:00
Ben Lin
3e57595674 Merge "Stop DocumentsContract from consuming Exceptions if app is targetting O or above." 2017-03-13 17:27:22 +00:00
Jeff Sharkey
179d6b3f0c Deprecate storage "low" and "ok" broadcasts.
These broadcasts resulted in a terrible user experience where dozens
of apps would wake up and try deleting everything they possibly can,
meaning that we'd thrash between showing/hiding the low space
notification to users.

Instead, if apps have data that they're okay being purged when the
system is chronically low on space, we want to strongly encourage
them to rely on the much-improved getCacheDir() behaviors in OC.

Test: builds, boots
Bug: 35406598
Change-Id: I74abfba1b8d3948363b79f8b66ca0ad60faac756
2017-03-12 17:31:20 -06:00
Ben Lin
8ea8200fed Stop DocumentsContract from consuming Exceptions if app is targetting O
or above.

Test: Builds properly.
Bug: 36023174
Change-Id: I455d358672f35fbeb5678c965b25268229ed4882
2017-03-10 10:48:31 -08:00
TreeHugger Robot
642028fccd Merge "Replaced auto-fill by autofill to keep it consistent with API style." 2017-03-10 07:05:41 +00:00
Felipe Leme
640f30a776 Replaced auto-fill by autofill to keep it consistent with API style.
This change will affects 2 types of apps: autofill service implementations
and apps that use autofill APIs.

Since just the former is known to be used at the moment, we're not trying
to keep backward compatibility with the latter.

Bug: 35956626
Test: CtsAutoFillServiceTestCases pass
Test: android.provider.SettingsBackupTest pass

Change-Id: Ia720083508716deae9e887f9faa7ae7c5a82f471
2017-03-09 08:14:49 -08:00
TreeHugger Robot
6e2026c348 Merge "Fix stale data due to stopped loader." 2017-03-09 15:13:09 +00:00
Jeff Sharkey
32ee8eefd7 Create new BroadcastBehavior annotation.
This will be used to help document the expected behavior of various
broadcast actions defined by the OS.

Also add logic to PackageParser that will then yell at developers
whose manifests are making bad assumptions about which broadcasts
they'll receive.

Test: builds, boots
Bug: 35925551
Change-Id: I059c2bf8aa3ce53d9ff18dcc263db7620cd14bd6
2017-03-08 20:19:31 -07:00
TreeHugger Robot
c66b2d2313 Merge "Add OverlayManagerService#setEnableExclusive" 2017-03-09 03:14:57 +00:00
George Mount
899ca3236d Fix stale data due to stopped loader.
Bug 33185424

When stopping an CursorLoader while data is being loaded,
the load task will be canceled. This CL marks the data as
changed if the cancel is called while the loader is stopped.

Test: I63b48210a25be72d13a2a6182eb1757cbe6a1949
Change-Id: Ibf9c5facdcc5160f6ed146c5fdd063549ac2a7a8
2017-03-08 15:29:27 -08:00
Jeff Sharkey
60f95aa00a Move lagging users over to new storage API.
Over the last month we've been moving everyone over to the new
StorageStatsManager public APIs, but we missed these users.

The ApplicationsState changes are straightforward, but we had to
completely rewrite StorageMeasurement to use the new fast-path
quota APIs.

Test: builds, boots, UI using StorageMeasurement works.
Bug: 36056120
Change-Id: If02177c95bf8c96ae4eceac4d631a168f99bef84
2017-03-08 13:57:29 -07:00
Chad Brubaker
816c83bf03 Enforce visibleToInstantApps for receivers
Instant apps can only send broadcasts to receivers that are declared in
the manifest with android:visibleToInstantApps=true or if the app
registers a receiver at runtime using the new methods that take
visibleToInstantApps.

Bug:33350280
Test: Manually sending broadcasts from Instant Apps only goes to
receivers with visibleToInstantApps set to true.
Test: Receiving a broadcast from within the same app does not require
visibleToInstantApps to be set.

Change-Id: I54d79a502ba9c5fd03ede3c09e08afc88fe2775f
2017-03-07 15:28:03 -08:00
TreeHugger Robot
aae1cc597d Merge "Expose Instant App API defined in MR1" 2017-03-07 23:20:53 +00:00
Daniel Nishi
8603ad42df Merge "Use the fast track for the AppCollector." 2017-03-07 22:55:20 +00:00
Jason Monk
929ed8d2f4 Add OverlayManagerService#setEnableExclusive
This lets settings use one call to set the current theme overlay
for the "android" package.

Test: Change theme in Settings -> Display
Change-Id: Ia566e58c5479dedb7184f4218151f8080f8ebc0f
2017-03-07 16:01:20 -05:00
Todd Kennedy
9c9fdf27ff Expose Instant App API defined in MR1
These were created in MR1 but couldn't be submitted because
they were defined too late [after API freeze].

Change-Id: Ie6884236776bd26e9d0b557fd125b8c77b0ad93b
Fixes: 34890162
Fixes: 35193180
Fixes: 35193418
Test: manual
2017-03-07 11:40:59 -08:00
TreeHugger Robot
a61627935e Merge "Support non-system Font Providers" 2017-03-07 18:17:15 +00:00
TreeHugger Robot
c7eefdbda7 Merge "Framework: Avoid string allocations" 2017-03-07 16:02:54 +00:00
Clara Bayarri
3c4be77db9 Support non-system Font Providers
To do this, the developer must specify the set of certificate
hashes that represent the authority's app. This allows us to
verify that the authority we find is indeed the one intended
by the developer.

Bug: 35025705
Test: runtest --path frameworks/base/core/tests/coretests/src/android/provider/FontsContractTest.java
runtest --path frameworks/base/core/tests/coretests/src/android/content/res/FontResourcesParserTest.java
CTS attached to topic
Change-Id: I605f9a93bbca8705936ead08efb4a5b4fdcc4882
2017-03-07 14:59:33 +00:00
TreeHugger Robot
8cfea13985 Merge "Move requestKeyboardShortcuts intent to com.android" 2017-03-07 03:59:47 +00:00
Andreas Gampe
e9a5262f2a Framework: Avoid string allocations
Avoid common string allocations for ":complete".

Test: m
Test: Device boots
Change-Id: I8c7a53346a4e1aa1beefd17429e13e20ab510f20
2017-03-06 17:27:09 -08:00
TreeHugger Robot
a485f71fd7 Merge "Refactor EphemeralResolverService" 2017-03-06 21:39:17 +00:00
Chad Brubaker
b7e34d5508 Only send exposed broadcasts to Instant Apps
In order to prevent Instant Apps from receiving potentially sensitive
broadcasts they will only receive those that the sender explicitly
exposes to Instant Apps by setting
Intent.FLAG_RECEIVER_VISIBLE_TO_INSTANT_APPS.

Bug:33350280
Test: `adb shell am broadcast` does not get delivered to Instant App
Test: `adb shell am broadcast -f 0x0x200000` gets delivered to Instant
App
Test: Verified that an Instant App can send a broadcast to itself
without FLAG_RECEIVER_VISIBLE_TO_INSTANT_APPS
Change-Id: Ie363448bf224abba530dd4caf69258939fff00af
2017-03-06 11:11:33 -08:00
Clara Bayarri
847d8683a0 Move requestKeyboardShortcuts intent to com.android
Test: none
Bug: 35307747
Change-Id: Ibaf260ebe75bc80d48167209af7d034c582160b7
2017-03-06 16:48:44 +00:00
TreeHugger Robot
64979aacb5 Merge "expose isSealed() from the installer session" 2017-03-04 00:47:36 +00:00
TreeHugger Robot
4992dbb6f7 Merge "Mark ACTION_VOICE_ASSIST as SystemApi" 2017-03-03 23:58:19 +00:00
Todd Kennedy
1fb3404b2b Refactor EphemeralResolverService
* Change name to InstantAppResolverService
* Left old service in place to handle existing client
  [to be removed prior to O launch]
* When resolving phase II, return a list instead of a single item

Bug: 34763730
Test: Build and verify resolution occurs w/ legacy & new resolver service
Change-Id: Ieccaf91538bd91c04f4be4e35d8264619d7cd6d7
2017-03-03 15:45:20 -08:00
Todd Kennedy
04cc191c3c expose isSealed() from the installer session
Change-Id: I5232a012fbee8931b0e3f584d6bb2e273a789dee
Fixes: 35948628
Test: Manual
2017-03-03 15:03:30 -08:00
TreeHugger Robot
e096df0063 Merge "Adding support for passing arbitrary extras when requesting to pin a widget. Also defining an extra constant for widget preview which can be used by developers to provide a snapshot of the widget with the pin request" 2017-03-03 22:26:49 +00:00
Amith Yamasani
1645203104 Mark ACTION_VOICE_ASSIST as SystemApi
.. since it is implemented by a system app. This allows the
CTS test that verifies android.* namespace intents to pass.

Change-Id: I083e1d12a79fa67e15158ca7390353303cd0e06e
Fixes: 35274957
Test: cts-tradefed run cts-dev -m CtsSignatureTestCases
2017-03-03 14:13:28 -08:00
TreeHugger Robot
2c66f192ca Merge "Add extra indicating honored query arguments." 2017-03-03 16:35:14 +00:00
TreeHugger Robot
8fb42cc3b2 Merge "Let ResourcesManager generate CompatResources" 2017-03-02 21:28:27 +00:00
TreeHugger Robot
c8f0100248 Merge "Adding platform constants for various install reasons." 2017-03-02 19:58:07 +00:00
Dianne Hackborn
594ea5f8b0 Merge "Implement issue #34842682: Add ability to limit permissions based on features" 2017-03-02 18:31:15 +00:00
Steve McKay
415f41ba20 Add extra indicating honored query arguments.
Rename QUERY_RESULT_SIZE to EXTRA_TOTAL_SIZE.

Change-Id: I18f1e0b77362c6f898bc4d5846e21dfb205be19a
Test: Manual
Bug: 30927484
2017-03-02 10:23:23 -08:00
Jason Monk
bd60e5bf2e Let ResourcesManager generate CompatResources
This will let the ResourcesImpl be updated and handle null cases
better.

Test: Select text while composing email.
Change-Id: Ia8aed22f02b040a202db9cbb2bc02687c693cfa1
Fixes: 34761805
Fixes: 35869547
2017-03-02 12:55:00 -05:00
Sunny Goyal
80af6a27fd Adding platform constants for various install reasons.
Bug: 33415829
Test: Not a  testable change
Change-Id: Ib0803e55f71a1c6b46e12b1a324db4e028a20529
2017-03-02 08:34:22 -08:00