Commit Graph

4836 Commits

Author SHA1 Message Date
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
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
TreeHugger Robot
c67b49af3f Merge "Javadoc and un@hide ContentResolver#refresh and ContentProvider#refresh." 2016-11-15 21:11:07 +00:00
Sudheer Shanka
2250d56a0b Rename MountService to StorageManagerService.
Bug: 30977067
Test: Existing tests pass
Change-Id: Ieac0f11c2b249dcd60441b14c1f391e6f8131d42
2016-11-15 12:43:37 -08:00
Todd Kennedy
01ad0c7e40 Implement 2-phase resolution
Bug: 25119046
Test: build & install the sample resolver and run 'adb shell am start -a android.intent.action.VIEW -c android.intent.category.BROWSABLE -d "https://www.tripadvisor.com/Tourism-g33020-San_Jose_California-Vacations.html"'
Change-Id: I624b9028061aad35db80e0d51bfe0a39fb81806c
2016-11-14 15:05:21 -08:00
Ben Lin
2b64a88274 Javadoc and un@hide ContentResolver#refresh and ContentProvider#refresh.
Test: CTS Tests part of same topic.

Bug: 31647485
Change-Id: Iad7f19b6b54f72736fbb7e477f67cf541d838903
2016-11-14 14:30:59 -08:00
Sudheer Shanka
dc589ac82b Update usage of ActivityManagerNative.
- Remove references to ActivityManagerProxy.
- Add isSystemReady to ActivityManager.

Bug: 30977067
Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test android.server.cts
      adb shell am instrument -e class com.android.server.am.ActivityManagerTest,com.android.server.am.TaskStackChangedListenerTest \
          -w com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
Change-Id: I07390b6124fb1515821f5c0b37baf6ae74adc8fa
2016-11-14 11:27:12 -08:00
Tony Mak
46aabe5ef4 Allow cross profile call between DO and PO
Allow DO to bind service of PO in managed profile and vice versa.
DO and PO must be the same package.

Bug: 31895999

Change-Id: I3ce2943aebd1249401d5814757a0ce25b9f85279
Test: cts-tradefed run cts --module DevicePolicyManager --test com.android.cts.devicepolicy.CorpOwnedManagedProfileTest
2016-11-14 14:20:11 +00:00
Makoto Onuki
890a14d399 App Shortcut: Clarify which attributes must be resources am: 104f805337 am: 2a3fe7d979 am: b0fd5ba122
am: 7e1b835a4e

Change-Id: I767dcbe980a60af1a3076acdf9234f4241ab7ca1
2016-11-11 23:54:51 +00:00
Makoto Onuki
7e1b835a4e App Shortcut: Clarify which attributes must be resources am: 104f805337 am: 2a3fe7d979
am: b0fd5ba122

Change-Id: I4780d09f8b692dbe76f1726a436f9693281fd488
2016-11-11 23:36:04 +00:00
Ben Lin
1cf454fcb6 Adding ContentProvider#refresh and ContentResolver#refresh.
Original CL is from ag/1568530.

Bug: 31647485
Change-Id: Ib45fc995a361b8c75cd3600f638910b18a263d51
2016-11-10 13:53:27 -08:00
Dianne Hackborn
e07641d4fb Start implementing background restrictions for eph apps.
This implements the additional intended path for checking
allowed background operations, APP_START_MODE_DISABLED, which
doesn't allow an app to launch in the background at all.

Also change the semantics of delivering broadcasts to manifest
receivers to always restrict those, not changing based on
whether the app is currently idle.  This is the desired intended
behavior for apps as they explicitly update to work with
bg check.

And now that we have ephemerality associated with the uid state
in the activity manager, we can propagate this through the
relevant callbacks in IUidObserver so things watching these
changes can immediately determine whether they should do their
more aggressive shut down work for the uid rather than having
to walk through all their state looking for package associated
with that uid and whether they should be shut down.

Also remove the "lenient" bg check mode, since that was
just an early experiment that we won't actually use.

Add a new "make-idle" activity manager command to immediately
put a uid into the idle state (if possible) to make it easier
to test.

Test: manually against an eph app
Change-Id: I43a138ff281f69a9251d3f29ab6e13f48cff8ad6
2016-11-10 12:01:20 -08:00
TreeHugger Robot
00f42c3b28 Merge "Initial implementation of the Auto-Fill Framework classes." 2016-11-09 19:19:32 +00:00