Commit Graph

4998 Commits

Author SHA1 Message Date
TreeHugger Robot
bcf3b70371 Merge "Adding an api for apps to check whether they can install apps" 2017-01-26 07:35:33 +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
Suprabh Shukla
aef2513c71 Adding an api for apps to check whether they can install apps
Some apps may want to check whether they are trusted to install apps on
the device, so they can prompt the user to go to settings and mark them
as trusted before they do an intensive operation like downloading an
apk.

Test: cts-tradefed run cts -m CtsExternalSourcesTestCases

Bug: 31002700
Change-Id: Icd9d04daa157e6733decba245ec251ce4acd4122
2017-01-25 17:26:02 -08:00
Elliot Waite
54de77470d Fix @links in reference docs.
Change-Id: I40cea46efd80c448640ff69753698fe8404da40b
2017-01-25 17:00:55 -08:00
TreeHugger Robot
a92c180107 Merge "Also parse "1" as true for ContentValues#getAsBoolean" 2017-01-25 20:19:11 +00: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
Ralph Nathan
9d3d90a22f Merge "Add FEATURE_EMBEDDED to PackageManager" 2017-01-25 01:32:54 +00:00
TreeHugger Robot
e84ad491c8 Merge "Add color mode to activity/window" 2017-01-25 01:20:28 +00:00
Romain Guy
4832745b84 Add color mode to activity/window
The color mode lets an application request a wide color gamut for
a specific window. This will also be used in the future to request
HDR. The color mode is currently either default (sRGB) or an undefined
wide gamut color space chosen by the platform. These attributes could
later be used to choose a specific color space if we deem this important
or useful.

This change also renames the various "colorimetry" attributes and
constants to "color mode" for consistency. These symbols were
added in O and can be safely renamed.

Test: CtsColorModeTestCases
Bug: 32984164
Change-Id: I4d4691dd12dbe3f3aa6a5cf893cff39aa16c739e
2017-01-24 15:55:09 -08:00
Makoto Onuki
454a9777b8 Merge "Add client package name to WTF message" 2017-01-24 23:42:31 +00:00
Matthew Snider
c755fb64f6 Merge "Introducing clear package data intent" 2017-01-24 23:31:12 +00:00
Ralph Nathan
b8e0dee9af Add FEATURE_EMBEDDED to PackageManager
This CL adds FEATURE_EMBEDDED to PackageManager to identify Android
Things devices.

BUG: 34644059
Test: built using make update-api

Change-Id: Ife4430e4a445f6afdd969e94db5fe5c9098ee145
2017-01-24 15:30:50 -08:00
Winson Chung
6d2fe9e96d Merge "Remove dependency on resizable activity to enter PiP." 2017-01-24 22:26:47 +00:00
msnider
3c191b8bd9 Introducing clear package data intent
Clear data Intent can be called from any application and
executes in the PackageInstaller. The user will be asked
to verify that they truly want to clear package data via
an AlertDialog.

This was initially intended to be @SystemApi, but
conversations with API-Review led to it be public.

Test: Covered by a gts-test ag/1806256 and manually tested
by calling from com.android.vending (Play Store).

bug: 33017941
bug: 31008483

Change-Id: Ibeae6620303ba52cc2ebf0383756c9380d3fa013
2017-01-24 13:39:52 -08:00
TreeHugger Robot
5a5afca936 Merge "Add versionCode" 2017-01-24 20:36:40 +00:00
Makoto Onuki
3a2541e6da Add client package name to WTF message
Bug 34650921
Test: manual tests with GEL launcher with work profile
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest1 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest2 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest3 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest4 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest5 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest6 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest7 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest8 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest9 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest10 -w com.android.frameworks.servicestests

Test: cts-tradefed run cts --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -m CtsShortcutHostTestCases -t 'android.content.pm.cts.shortcuthost.ShortcutManagerMultiuserTest#testManagedUser'
Test: cts-tradefed run cts --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -m CtsDevicePolicyManagerTestCases -t 'com.android.cts.devicepolicy.LauncherAppsProfileTest'
Change-Id: I68f72f0798b752690e4e8d32360fd1d15bedef31
2017-01-24 11:55:51 -08:00
Todd Kennedy
316c2f2079 Add versionCode
We need to specify the version code to use when installing
splits since the version on the device might be different
from the latest on the server.

Bug: 25119046
Test: manual
Change-Id: I4ad21f9e5924fcf76a39780e6d98e8d7a1fef5d4
2017-01-24 11:01:27 -08:00
Winson Chung
d339538a67 Remove dependency on resizable activity to enter PiP.
- Removing the requirement for activities to have both the
  resizeableActivity and supportsPictureInPicture attribute
  to enter PiP.  The activity may still be resized when
  entering picture-in-picture.

Bug: 34256643
Test: android.server.cts.ActivityManagerPinnedStackTests
Change-Id: If6bd4721c53072e5518f554a8c7598705517c132
2017-01-24 10:56:33 -08:00
TreeHugger Robot
425a129f1b Merge "add "splitName" attribute" 2017-01-24 15:13:51 +00:00
Abodunrinwa Toki
1f50fa6df5 Merge "Update TextAssistant interface." 2017-01-24 15:04:29 +00:00
Abodunrinwa Toki
f001fefff3 Update TextAssistant interface.
Rename to TextClassifier
Move to android.view.textclassifier package
Adds getTextClassifierInfo(...)
Changes addLinks(...) to getLinks(...)

This CL also integrates this interface with framework components
and passes a context to TextClassificationManager.

Test: Tests will be added with implementation.
Bug: 34661057
Change-Id: If9e90f034ebb702c1f78e72b6a844f39eebf738f
2017-01-24 15:01:24 +00:00
Christopher Tate
bdc394118c Document dependency between Intent symbols and dumpstate
Bug 34594835

Test: N/A
Change-Id: I4494c224bc6341c7a41b79361ba599befc408341
2017-01-23 18:15:27 -08:00
Todd Kennedy
e9d0d2758b add "splitName" attribute
Attribute is availble on activity, provider and service components. Allows
specifying which split contains that component.

Test: built test app with attribute
Change-Id: Ibc615321035f76a71d0dce5a6fae3f3ef4c3e762
2017-01-23 13:56:10 -08:00
TreeHugger Robot
4a65687b85 Merge "Expose fonts.xml via public API with a service" 2017-01-23 19:57:23 +00:00
Jeff Schumacher
b16bddca89 Merge "Opened some App Links APIs to @SystemApi" 2017-01-23 18:50:16 +00:00
Polina Bondarenko
308bcec713 Merge "Make TelephonyManager#get/setAllowedCarriers system api" am: 6d064d8780 am: cf176500e6
am: b46a93ff04

Change-Id: I8f17bef7ccde5953f5b810bd806fc51a4c69e194
2017-01-23 17:20:58 +00:00
Polina Bondarenko
b46a93ff04 Merge "Make TelephonyManager#get/setAllowedCarriers system api" am: 6d064d8780
am: cf176500e6

Change-Id: Ic278e3a9bd7c9c99345150228c6e87343737079e
2017-01-23 17:14:35 +00:00
Clara Bayarri
04d72abde1 Expose fonts.xml via public API with a service
This change creates a new FontManagerService, in charge of providing
font management data. It exposes a public API to retrieve the
information in fonts.xml without accessing it directly. To do this,
it also refactors FontListParser's internal classes into a new public
FontConfig class holding all the font data.

getSystemFonts() returns all the available information in fonts.xml
as well as file descriptors for all the fonts. This allows us to
share the memory consumed by these files between all clients.

Bug: 34190490
Test: See attached CTS change in topic
Change-Id: I0e922f8bcc9a197a1988d04071eb485328d66fb7
2017-01-23 15:02:23 +00:00
TreeHugger Robot
83d577581b Merge "Expose Resources.getFont" 2017-01-23 13:31:33 +00:00
Clara Bayarri
18e9f9f377 Expose Resources.getFont
Based on the work already done in aapt2, load a Font from a
resource id.

Test: WIP
Change-Id: Idc06bfbfd16452a328bfcc6ea9dcfb723b633f0c
2017-01-23 11:18:09 +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
Chad Brubaker
9d8e0fc679 Merge "Rename visibleToEphemeral to visibleToInstantApps" 2017-01-21 04:38:55 +00:00
TreeHugger Robot
c49f2e5d88 Merge "Add ClipData.addItem(Item, ContentResolver)" 2017-01-21 01:09:28 +00:00
Vladislav Kaznacheev
8e7b940f8d Add ClipData.addItem(Item, ContentResolver)
Unlike the existing addItem(Item), this method updates
the MIME type list in the ClipDescription.

Bug: 28750744
Test: cts-tradefed ... -m CtsContentTestCases
  --test android.content.cts.ClipboardManagerTest
Change-Id: Ida0477267d1319a31a738dfd704c0af71928dd2f
2017-01-20 15:39:12 -08:00
Makoto Onuki
75ca7b8edd Merge "Do not allow work profile apps to access main profile app." 2017-01-20 23:35:53 +00:00
Sunny Goyal
907b467e91 Merge "Fixing dimensions for AppWidgetProviderInfo not getting updated properly for PinItemRequest" 2017-01-20 23:07:22 +00:00
Dianne Hackborn
9544fe6039 Merge "Improve behavior of bg check." 2017-01-20 23:05:41 +00:00
Dianne Hackborn
85e35643ba Improve behavior of bg check.
There is a new APP_START_MODE_DELAYED_RIGID which means that
things discovering something is not allowed to start should
report a clear error back to the caller.  This is how apps
that opt in to bg check should behave, and will now
be used if the app op mode is set to ERRORED.

This (for now?) removes the code that allows services to
be started if the request is coming from a foreground process.
That behavior isn't in the current bg check spec, and
probably not what we want as the standard platform model (since
it makes knowing when a service can start even harder to
determine).  It was originally done for the experimental
bg check work in N to see how much we could avoid
breaking existing apps, so not relevant when apps need to
explicitly opt in.

Also report temporary whitelist changes to activity manager for
it to lift background restrictions temporarily for apps.  Being
on the whitelist is now part of UidRecord, preventing a uid from
going idle.

Test: Initial CTS test added.

Change-Id: I36fd906fa69de8b7ff360605ae17c088f182e172
2017-01-20 15:03:41 -08:00
Jiuyu Sun
417d30d88b Merge "Change the default behavior when MCC/MNC changes." 2017-01-20 22:58:25 +00:00
Chad Brubaker
699c771024 Rename visibleToEphemeral to visibleToInstantApps
Test: builds
Test: cts-tradefed run commandAndExit cts-dev -m
CtsAppSecurityHostTestCases -t android.appsecurity.cts.EphemeralTest
Change-Id: Ia173af181ec6206dfa8d1956eb2c4894c43c059e
2017-01-20 14:56:03 -08:00
Jeff Schumacher
6fd90ed961 Opened some App Links APIs to @SystemApi
This change promotes some of the APIs that Settings uses for the
"Open by default" screen from @hide to @SystemApi.

GTS tests are added in ag/1811536.

This change also changes the protection level for
Manifest.permission.SET_PREFERRED_APPLICATIONS to allow package verifiers
(e.g. the Play Store) to be granted it. This permission is used in the
PM.updateIntentVerificationStatusAsUser() and
PM.setDefaultBrowserPackageNameAsUser() APIs.

Bug:31008483
Test: Patch in ag/1811536 and follow the test instructions there.
Change-Id: I18b069de11eaa8fe97c151fb3cfb63854f1fd056
2017-01-20 14:51:47 -08:00
Holly Jiuyu Sun
b6d7695cf2 Change the default behavior when MCC/MNC changes.
By default, we don't restart the activity when MCC/MNC changes
even when they are not set in configChanges. If they want to
restart, set mcc or mnc in the new attribute restartOnConfigChanges.

Bug: 34258948
Test: Test in unit test(testGetActivityConfigChanges() in
      PackageParserTest.java) and on real device with
      changing the SIM card.

Change-Id: Icd6899597c9b8f2e5706e74373a0280d19150092
2017-01-20 13:50:51 -08:00
TreeHugger Robot
22e1cbad24 Merge "Make TelephonyManager#get/setAllowedCarriers system api" 2017-01-20 21:18:31 +00:00
Makoto Onuki
aecbd03751 Do not allow work profile apps to access main profile app.
Bug: 34340531

Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest1 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest2 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest3 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest4 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest5 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest6 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest7 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest8 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest9 -w com.android.frameworks.servicestests
Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest10 -w com.android.frameworks.servicestests

Test: cts-tradefed run cts --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -m CtsShortcutHostTestCases -t 'android.content.pm.cts.shortcuthost.ShortcutManagerMultiuserTest#testManagedUser'
Test: cts-tradefed run cts --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -m CtsDevicePolicyManagerTestCases -t 'com.android.cts.devicepolicy.LauncherAppsProfileTest'

Change-Id: I34e9f351d2a8addf65a5a928c3dd4363f08611dc
2017-01-20 18:41:44 +00:00
Bartosz Fabianowski
aaad776c2c Merge "Allow system to retrieve persistent preferred activities" 2017-01-20 18:16:00 +00:00
Makoto Onuki
444d64749d Merge "requestPinShortcut for pinned shortcut still notifies launcher" 2017-01-20 16:49:16 +00:00
TreeHugger Robot
a9da39cb64 Merge "Add wide color gamut and HDR resource qualifiers" 2017-01-20 04:10:04 +00:00
TreeHugger Robot
4c0659f531 Merge "Enable background restrictions" 2017-01-20 02:55:30 +00:00