Commit Graph

4986 Commits

Author SHA1 Message Date
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
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
Romain Guy
c9ba559021 Add wide color gamut and HDR resource qualifiers
Bug: 32984164
Test: Config_test, AaptConfig_test and aapt2_tests
Change-Id: Ie9c82bfe2d36b1d6180ee223250ab5bb2ce90dd4
2017-01-19 18:44:00 -08:00
TreeHugger Robot
a2b1774d75 Merge "Grant access to ephemeral metadata" 2017-01-20 01:23:36 +00:00
TreeHugger Robot
54df14956e Merge "Disable moving 3rd party apps to internal if not allowed." 2017-01-20 00:57:36 +00:00
Christopher Tate
42a386b771 Enable background restrictions
Apps that target O+ are always subject to background restrictions.
Legacy apps' background restriction is subject to the OP_RUN_IN_BACKGROUND
app op.

Apps with these properties are exempted from background restrictions:
  - persistent process
  - currently on the idle battery whitelist
  - global whitelist for things like bluetooth services

Bug 30953212

Change-Id: Icc19b2fbc05f40dcf8c3fc4abf718c373dc8d4f6
2017-01-19 16:23:02 -08:00
Makoto Onuki
0c28071032 requestPinShortcut for pinned shortcut still notifies launcher
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

Bug: 34391829
Change-Id: Iac652790f2aa02dab6afbe52f2e40be99543f325
2017-01-20 00:12:25 +00:00
Yao Chen
022b8eaa1d Disable moving 3rd party apps to internal if not allowed.
ag/1633903 added config_allow3rdPartyAppOnInternal flag to specify
whether 3rd party apps are allowed on internal storage. We need to
respect the flag when moving apps between storages.

Bug: 30980219

Test: Added ApplicationPackageManagertest

Change-Id: I0f8e76467b5071d70f40da28c2087e689c049c06
2017-01-19 15:32:41 -08:00
Todd Kennedy
0e989d00ed Grant access to ephemeral metadata
When an ephemeral application explicitly accesses an
installed application, it grants access to its package
metadata. The ephemeral application effectively stays
hidden if it doesn't explicitly connect to any activity,
service or provider [i.e. implicit connections using
an ACTION_VIEW/CATEGORY_BROWSABLE intent will not expose
its metadata].

Bug: 34123112
Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.EphemeralTest
Change-Id: I7e1680902599b3ada0d4fba5998af30566017051
2017-01-19 15:26:21 -08:00
Sunny Goyal
970d4b4626 Fixing dimensions for AppWidgetProviderInfo not getting updated properly
for PinItemRequest

Test: Manually tested on device
Change-Id: I7bbf7e93e052ef25c2a4a98ff0795ef500f68cc0
2017-01-19 15:12:47 -08:00
Adam Lesinski
8f3b174d90 Merge "Teach apps to refresh AppInfos without restarting" 2017-01-19 18:30:43 +00:00
Polina Bondarenko
80909ce333 Make TelephonyManager#get/setAllowedCarriers system api
Make TelephonyManager#get/setAllowedCarriers system api under
PackageManager#FEATURE_TELEPHONY_CARRIERLOCK feature flag.

Bug: 33480084
Test: cts

Change-Id: I1ce77a9e3801bd4003b52887d0a36866e5a5b81a
2017-01-19 17:53:55 +01:00