Commit Graph

4848 Commits

Author SHA1 Message Date
Makoto Onuki
ab99c11c55 Merge "ShortcutManager: direct pin shortcut support." 2016-12-15 17:59:39 +00:00
Lenka Trochtova
73aeea2da2 Make master clear constants system APIs.
This is needed for unbundling of the OobConfig apk.

Test: gts-tradefed run gts -m GtsGmscoreHostTestCases --test com.google.android.gts.devicepolicy.DeviceOwnerUserRestrictionTest#testFactoryReset_disallowFactoryReset

Bug: 32974361

Change-Id: I71e7270bb4c3234ec0516382b18a2ca35aab4c81
2016-12-15 13:25:09 +01:00
TreeHugger Robot
a9db0faecd Merge "Delay SharedPreferences.apply() by 50 ms" 2016-12-15 03:13:39 +00:00
Philip P. Moltmann
3349644872 Delay SharedPreferences.apply() by 50 ms
... so that multiple applies can be combined into a single write.

Do do this I replaces the executor in the QueuedWork by a more Android-y
handler.

Test: Ran shared preferences CTS tests. Looked at log and saw a lot of
      skipped writes
Bug: 33385963

Change-Id: I8f33df717be7091532930ccf6ca8c48940e4edd4
2016-12-14 15:48:39 -08:00
Michal Karpinski
e093a98925 Merge "Fix javadoc for PackageManager#getNameForUid()" 2016-12-14 11:44:02 +00:00
Ruben Brunk
58369e3d53 Prevent crash on uninstall. am: 12ab5e1d70
am: a1501095cf

Change-Id: I62bbc3c8e228b6dcda8d8edcb22d29634cabf271
2016-12-14 00:41:45 +00:00
Ruben Brunk
a1501095cf Prevent crash on uninstall.
am: 12ab5e1d70

Change-Id: I8301d17bb0bbd16a4adeaadb7b7bd04ad7159407
2016-12-14 00:34:59 +00:00
Rob Carr
b8eac24ff2 Merge "Correct error in Configuration.updateFrom" 2016-12-13 22:34:30 +00:00
Michal Karpinski
cb67dc9ead Fix javadoc for PackageManager#getNameForUid()
Change-Id: Ia4fbd6948ab0703c7df9dceae99170ffb8c96ddb
2016-12-13 18:20:23 +00:00
Makoto Onuki
2d895c3efd ShortcutManager: direct pin shortcut support.
Test: Manual test and all the unit tests:
adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest1 -w com.android.frameworks.servicestests
... to test8

Bug 32908854

Change-Id: I11b81656959cccfb4efa83f08380b915e6eb84a6
2016-12-13 09:56:03 -08:00
TreeHugger Robot
cf4d2ce358 Merge "Introduce TextClassificationManager." 2016-12-12 21:42:19 +00:00
Abodunrinwa Toki
8158af53e8 Introduce TextClassificationManager.
This handles smart selection and language detection features.
This CL only contains code to integrate the TextClassificationManager.
Implementation will be added in a follow up CL.

Test: Test will be added when TextClassificationManager is added.
Bug:32503402
Change-Id: I5f22150ff998156fbc91b51c733d93478efaa51f
2016-12-12 19:52:31 +00:00
TreeHugger Robot
72d633f430 Merge "Scope package manager queries for ephemeral apps" 2016-12-12 19:11:38 +00:00
Todd Kennedy
7bc3a70966 Scope package manager queries for ephemeral apps
Ephemeral apps can only see their own components or those components
exposed via the "visibleToEphemeral" XML attribute.

Normal apps can only see other normal apps. There is no way to expose
ephemeral components to normal apps.

Bug: 33458220
Test: Manually install ephemeral/normal apps and ensure they can only see appropriate components
Change-Id: I6ae65fd2a6ddc9aa9691f02cd55d4953048966b0
2016-12-12 08:01:25 -08:00
TreeHugger Robot
e15e208ad0 Merge "Make MATCH_ANY_USER system api" 2016-12-09 22:36:39 +00:00
TreeHugger Robot
61bde4d40c Merge "Replace ContentProvider SQL args w/ Bundle & Constants." 2016-12-09 22:25:29 +00:00
Steve McKay
ea93fe7539 Replace ContentProvider SQL args w/ Bundle & Constants.
Test: cts-tradefed run cts-dev -m CtsContentTestCases
Bug: 30927484
Change-Id: Idb9dbc2b80896e9f8474a0db71353b7a3810d597
2016-12-09 12:31:44 -08:00
Todd Kennedy
b771768249 Add system API to install ephemeral apps
Test: manual; install using "adb install --ephemeral"
Change-Id: Idce214779fea5f3c4a0121542319044f9f0e0a42
2016-12-08 14:51:43 -08:00
Amith Yamasani
475f9a3d42 Make MATCH_ANY_USER system api
to allow for some privileged apps to use it.

Also fixed the javadoc to mention the correct permission.

Test: API already exercised by Settings and PackageInstaller
Bug: 31000380
Change-Id: I5fc810dfe9f8d2b64d01bbaaa0bd26ebef4e8de1
2016-12-08 09:54:35 -08:00
Robert Carr
df259d3021 Correct error in Configuration.updateFrom
When updating the non direction members of screenLayout
we check that they are not in total undefined, before
accepting the new value in full. This was enough for LONG/SIZE
which are always undefined or set together. It seems we have paths
now where SCREENLAYOUT_ROUND however can be undefined and the others
will be set. In this case if we pass a configuration with
SCREENLAYOUT_ROUND_UNDEFINED but LONG/SIZE set to updateFrom then
we will overwrite our previous SCREENLAYOUT_ROUND value.
This triggers extra configuration changes. We take extra care with
SCREENLAYOUT_COMPAT_NEEDED as it doesn't have an undefined value.

Bug: 33098677
Test: bit FrameworksCoreTests:android.content.res.ConfigurationTest
Change-Id: I6e7d123d5444f93c511aeb6e0f3adfea2a480352
2016-12-07 20:33:05 -08:00
skuhne@google.com
322347ba58 Adding orientation preserving resizing
Adding freeform resizing to activities which require
a certain orientation. This is needed for e.g. ARC++.

Bug: 33267688
Test: runtest frameworks-services -c com.android.server.wm.TaskPositionerTests
Test: Visually on ARC++
Change-Id: If708c1602cb2ff464174389af4648ad767b0b079
2016-12-07 20:01:19 -08:00
Wale Ogunwale
929a81b81d Merge "Revert "Correct error in Configuration.updateFrom"" 2016-12-07 16:09:10 +00:00
Wale Ogunwale
64145dcbeb Revert "Correct error in Configuration.updateFrom"
Change is preventing the device from showing the lock screen
after the boot animation.

This reverts commit 4647acb60e.

Bug: 33098677
Change-Id: If7ecb04b74d5b626c7c3517e7e8d1dc1566ccb17
2016-12-07 16:00:53 +00:00
TreeHugger Robot
892c750f17 Merge "Correct error in Configuration.updateFrom" 2016-12-06 22:38:20 +00:00
Robert Carr
4647acb60e Correct error in Configuration.updateFrom
When updating the non direction members of screenLayout
we check that they are not in total undefined, before
accepting the new value in full. This was enough for LONG/SIZE
which are always undefined or set together. It seems we have paths
now where SCREENLAYOUT_ROUND however can be undefined and the others
will be set. In this case if we pass a configuration with SCREENLAYOUT_ROUND_UNDEFINED
but LONG/SIZE set to updateFrom then we will overwrite our previous SCREENLAYOUT_ROUND value.
This triggers extra configuration changes.

Bug: 33098677
Test: bit FrameworksCoreTests:android.content.res.ConfigurationTest
Change-Id: I6eb321d27011a2af2134d0ed5b6864d4cd902dc3
2016-12-06 12:34:35 -08:00
Narayan Kamath
988149c925 PackageParser: Add support for caching parse results on the file system.
The exact scheme for serializing parse results is left undefined, and
will be implemented in a follow-up change.

Also adds a unit test for this functionality.

Test: PackageParserTest
Bug: 30792387

Change-Id: I5be6a3f97b5688d0a1aa9e024e946d590ad92c13
2016-12-06 11:35:18 +00:00
Tomasz Mikolajewski
e4ba777a18 Merge "Add CATEGORY_TYPED_OPENABLE for ACTION_SEND[_MULTIPLE]." 2016-12-05 03:20:29 +00:00
John Reck
f32adf4475 Clean up ApplyStyle JNI
Bug: 32573798

Mark input uint32_t[] as const. Use Read-only JNI
array access for input as it's faster than critical access.

Use non-movable arrays for TypedArray so that the address can
be resolved and stored, avoiding the need to do JNI array
access for the output.

Indicies is always non-null, so remove the optional checks.

Eliminate unused return value.

Benchmark results:
twelveKeyInflate 4963us -> 4713us
simpleViewInflate 73us -> 60us

Test: Device boots, benchmarks show faster

Change-Id: Ic3bde5aee31407d8903913f97f2218daf074499a
2016-12-02 12:49:20 -08:00
Makoto Onuki
5436546589 Merge "ShortcutManager: Floating shortcuts shouldn't have target activities." 2016-12-02 16:34:59 +00:00
TreeHugger Robot
e8c963984f Merge "Disallow sharedUserId in Ephemeral apps" 2016-12-02 02:01:16 +00:00
Chad Brubaker
32d07dce7a Disallow sharedUserId in Ephemeral apps
Test: adb install --ephemeral apk fails with a shareduid defined
Change-Id: I2e03d89b983b99e35ea799618f6830b309c09b49
2016-12-01 16:17:40 -08:00
Makoto Onuki
106ff7a0a1 ShortcutManager: Floating shortcuts shouldn't have target activities.
Previously, even floating shortcuts (pinned but not dynamic nor
manifest) had target activities.  Now we're going to allow headless
apps to have pinned shortcuts, in which cases shortcuts won't have
target activities, let's just always remove target activities
from floating shortcuts.

Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest1 -w com.android.frameworks.servicestests
... to Test8.

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 CtsShortcutManagerTestCases
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

Change-Id: I10e5b87338cafb90e6566b3526f892c5330c73e9
2016-12-01 23:09:52 +00:00
Jeff Sharkey
fb833f38a0 Detect content:// leaving apps without grants.
Developers regularly put content:// Uris into Intents, but they can
easily forget to add FLAG_GRANT_READ_URI_PERMISSION to actually
extend a permission grant to the receiving app.

Also fix NPE when path is missing.

Test: builds, boots, common actions work without triggering
Bug: 32447617, 31900890
Change-Id: Ic6054b1d73de50967cf7fe66abc293c60a41b97e
2016-12-01 15:01:19 -07:00
Amith Yamasani
0d1fd8d091 Secure MATCH_UNINSTALLED_PACKAGES across users
Introduce a new internal flag MATCH_ANY_USER for genuine uses
of searching through all apps on the device.

Some temporary accommodations for Launchers that reach across
to the work profile until we have a new LauncherApps API to do
that officially.

Bug: 31000380
Test: CTS tests added
Change-Id: I2e43dc49d6c2e11814a8f8d1eb07ef557f31af34
2016-11-30 13:24:53 -08:00
Kenny Guy
02c8990bd6 Allow overriding max profile in debugable builds.
Support a system property on debugable builds to
override the max number of managed profiles to
allow easier dogfooding of multiple profiles.
Support 3 different badge colours for managed profiles.

Bug: 30473760
Test: runtest -c com.android.server.pm.UserManagerServiceCreateProfileTest frameworks-services
Test: runtest -c com.android.server.pm.UserManagerServiceUserInfoTest frameworks-services
Test: manual - attempting to create 2 profiles with adb fails, passes once I set the property.
Change-Id: Ie7fb19048a04a01572666f229283152254d0ffc3
2016-11-29 14:09:37 +00:00
Tomasz Mikolajewski
28a815c737 Add CATEGORY_TYPED_OPENABLE for ACTION_SEND[_MULTIPLE].
This category should be set when any virtual files are passed
via an Intent.

Test: CTS coming.
Bug: 28409713
Change-Id: I28eaecb3b8e9b604818adbdaf7fdaef1b4f9a564
2016-11-24 04:55:31 +00:00
Neil Fuller
3dfca02da4 Merge "Change EXTRA_TIME_PREF_24_HOUR_FORMAT from boolean to int" 2016-11-22 11:55:27 +00:00
Ian Pedowitz
4fe2517732 Revert "Lists returned from OS aren't mutable."
This reverts commit 97449fa389.

Bug: 33034458
Bug: 33032977
Bug: 27856974
Change-Id: If913e587ce4a48b9ed1c7c0a811bc39ce4e31d3c
2016-11-21 15:09:54 +00:00
Neil Fuller
b7146fec0d Change EXTRA_TIME_PREF_24_HOUR_FORMAT from boolean to int
... on Intent.ACTION_TIME_CHANGED.

This is to better represent the possible settings values for
the "use 24 hour format" setting. These are "12" (use 12 hour
formatting), "24" (use 24 hour formatting), unset
(use locale default formatting).

The EXTRA_TIME_PREF_24_HOUR_FORMAT for the ACTION_TIME_CHANGED
is now an int, not a boolean. 0 means "12", 1 means "24" and
2 means "use locale default". This is not a backwards compatible
change but the EXTRA_TIME_PREF_24_HOUR_FORMAT is not public
and so should only affect platform code that generates or
consumes the intent like settings code.

There are associated changes to Settings code to update the source
of the Intent.

The related underlying code that is triggered in response to the
intent and previously assumed a boolean now takes a Boolean.

Other changes:

The ActivityManagerService now only sends a binder notification
to running services if the EXTRA_TIME_PREF_24_HOUR_FORMAT
is present. There is an example of ACTION_TIME_CHANGED
being sent from the platform (AlarmManagerService, when the system
clock is noticed to have changed independently of the RTC) that
does not set the extra and would previously have misinterpreted
to mean "user wants 12 hour formatting", which would have been a
bug.

i.e. the code from ActivityManagerService that would interpret the
missing extra as false:

final int is24Hour =
        intent.getBooleanExtra(
                Intent.EXTRA_TIME_PREF_24_HOUR_FORMAT, false) ? 1 : 0;

Some methods and constants have be renamed to better reflect their
use.

Bug: 32761619
Bug: 32933009
Test: Manual testing
Change-Id: Ie7e9c62ce65e7e3a056b2751b45fe6cb9de86498
2016-11-21 12:22:32 +00:00
Jeff Sharkey
97449fa389 Lists returned from OS aren't mutable.
Data returned via ParceledListSlice is a snapshot of data from the
system, and should not be mutated directly.

In particular, this can cause developer confusion if they call
Collection.remove(), which doesn't actually mutate the value in the
system.  There are other mutation APIs that developers should be
using instead, such as JobScheduler.cancel().

Test: builds, boots, common operations work
Bug: 27856974
Change-Id: I72528dee4d79e483aa295bd91d1ed80d0d72d21c
2016-11-18 11:06:06 -07:00
Bartosz Fabianowski
1133424c2b Wire up PM.getInstalledApplicationsAsUser(flags, userId) as hidden API
Settings needs to access a variant of getInstalledApplications() which
takes a |userId| argument. Since this is not currently exposed by
PackageManager, Settings calls into PackageManagerService directly. This
is ugly and breaks the regular abstraction layer hierarchy.

The CL fixes the problem by exposing the required variant of
getInstalledApplications() as a hidden API, analogously to what was done
before with getInstalledPackages().

Bug: 32692748
Test: Will be CTS-verifier-tested together with Settings
Change-Id: Id9c4e8e18524d312159821f1a4d5527263c7e950
2016-11-17 20:49:16 +01:00
Todd Kennedy
3e12f413d4 Merge "Implement 2-phase resolution" 2016-11-16 23:05:34 +00:00
TreeHugger Robot
2eb0a8b4d5 Merge "Fixing typo in method comment." 2016-11-16 22:31:56 +00:00
Chad Brubaker
da153f5af4 Merge "Shift ApplicationInfo private flags" 2016-11-16 21:46:23 +00:00
Kweku Adams
86f39a4287 Fixing typo in method comment.
Test: none

Change-Id: I5583e4de17da0ddd28b12ee879b27a24734906fb
2016-11-16 21:01:27 +00:00
Jeff Sharkey
f2f406cade Merge "Treat everyone the same, redux." 2016-11-16 17:58:24 +00:00
TreeHugger Robot
26c48fac73 Merge changes I99813278,I6285042b
* changes:
  Fix copypasta error.
  Aggressively clear cached data when forgetting.
2016-11-16 03:21:17 +00:00
Jeff Sharkey
13deeafe46 Treat everyone the same, redux.
Test: builds
Bug: 29746499
Change-Id: Id2a9aacf0db40cdd053d203897e792662c6d3cd0
2016-11-16 01:12:13 +00:00
Jeff Sharkey
a3a43b09fe Fix copypasta error.
Test: builds
Bug: 29087651
Change-Id: I99813278bc37fa332730144f821b33ae6bd35650
2016-11-15 17:54:23 -07:00
Sudheer Shanka
bae5ca1490 Merge "Rename MountService to StorageManagerService." 2016-11-15 23:34:15 +00:00