Commit Graph

3921 Commits

Author SHA1 Message Date
Svetoslav Ganov
0f3431b616 Merge "Improve requestPermissions API docs and throw correct exception." into nyc-dev 2016-02-19 04:03:50 +00:00
Svet Ganov
f66381cd0d Improve requestPermissions API docs and throw correct exception.
bug:26220898

Change-Id: Iebda3fe13b963b10829de917fb00a9a14186b72c
2016-02-18 20:02:40 -08:00
Yohei Yukawa
5eb148bab6 Merge "Stop granting default Contacts permission to IMEs." into nyc-dev 2016-02-18 23:16:06 +00:00
Yohei Yukawa
726c45970e Stop granting default Contacts permission to IMEs.
This partially reverts the previous commit [1], which allowed special
components to be granted some pre-configured default permissions.

With this CL, we no longer grant Contacts permissions to pre-installed
IMEs.  Rationals are:

  1. Even without this CL, not the all pre-installed IMEs are granted
     Contacts permission by default, because it was done during the boot
     time where InputMethodManagerService is not yet completely
     initialized.  The current behavior is confusing not only for users
     but also for developers.
  2. In almost all the cases, IMEs are supposed to be able to work
     without Contacts permission.  Hence it is not too late to ask users
     to grant the permission to the IME after the initial setup is
     completed.
  3. It is difficult to add new features such as File-Based Encryption
     (FBE) with keeping the current implementation, because currently we
     dynamically call mSettings.setCurrentUserId(userId) just to
     enumerate what IMEs will be enabled for a given user.  Adding
     another condition (whether the user has already unlocked the device
     or not) would make things more complicated.

Note that LatinIME has already support the case where Contacts
permission is not granted by default.  It does not ask users for
anything until Setup-Wizard is completed, and requests Contacts
permission only when the user taps a message in the suggestion strip
that suggests users to use contacts name for typing suggestions.

 [1] If8b8cadbd1980ffe7a6fc15bbb5f54a425f6e8f9
     adc1cf4604

Bug: 24756974
Bug: 26743676
Change-Id: Ief2a40b5971b3eb97d765f934d20ce7f2ef25665
2016-02-18 13:46:12 -08:00
Christopher Tate
43fbc5f898 Add android:backupInForeground
An app can now declare that it really needs to be backed up
whenever possible even if it is currently engaged in foreground-
equivalent work.  Only applies to full-data backup clients: key/value
backups are not intrusive on normal lifecycle so they can already
happen in such circumstances.

Bug 26790411

Change-Id: Ia0ebcc7a53da888ae9ae4d63cd4bcab6e3a2e866
2016-02-18 20:47:36 +00:00
Jeff Sharkey
2c1ba9a961 Make BackupManager encryption aware.
Backup requires both CE and DE storage to be available, so delay
spinning up the backup system until the user is unlocked, since
that's when CE storage becomes available.  Note that devices without
FBE immediately transition USER_SYSTEM into the unlocked state,
since their CE is always available.

Offer to backup and restore files under both CE and DE.  Since DE
is effectively the same as CE, most logic is simply duplicated for
now, but it could be simplified in the future.  Since system apps
can force their default storage location to DE, we always build
explicit CE and DE paths.

Add getDataDir() to give clean access to the top-level private data
directory, but disclaim that apps shouldn't create files there.

Bug: 26279618
Change-Id: Ic34a4b330223725db93b1d0f5c9dffc88002c61f
2016-02-18 10:54:11 -07:00
Makoto Onuki
fc482c30b7 Merge "[framework] Don't allow apps on external storage to be active admin" into nyc-dev 2016-02-17 22:48:13 +00:00
Felipe Leme
014a0d11c7 Merge "Removed Intent.OPEN_EXTERNAL_DIRECTORY." into nyc-dev 2016-02-17 22:43:20 +00:00
Felipe Leme
3c3770d8fe Merge "Initial implementation of StorageManager.getVolumesList()." into nyc-dev 2016-02-17 22:42:40 +00:00
Felipe Leme
34a9d52719 Removed Intent.OPEN_EXTERNAL_DIRECTORY.
Such intent is now encapsulated by StorageVolume.createAccessIntent().

BUG: 26742218

Change-Id: I2e2bd71126ecd74981f77b0af7d069f51aaece74
2016-02-17 14:38:25 -08:00
Makoto Onuki
f34db0a17e [framework] Don't allow apps on external storage to be active admin
Bug 27149287

Change-Id: I6d959d2e66dc0b19f78e6135fbdcf45ca8551958
2016-02-17 14:24:25 -08:00
Felipe Leme
04a5d40cf3 Initial implementation of StorageManager.getVolumesList().
This change makes StorageManager.getVolumesList(),
StorageManager.getPrimaryVolume(),  and StorageVolume public and adds a
buildAccessIntent() in the latter to automatically generate the
ACTION_OPEN_EXTERNAL_DIRECTORY intent, but it doesn't change the
ACTION_OPEN_EXTERNAL_DIRECTORY implementation yet (i.e., it still takes an URI with the physical path of the directory, instead of a StorageVolume and
a directorny name).

BUG: 26742218

Change-Id: I36c59c42b6579e125ec7f03c3af141260875a491
2016-02-17 13:14:39 -08:00
Andrei Stingaceanu
eb84b1843a Suspend packages - one call for multiple packages
Refactor setPackageSuspended into setPackagesSuspended. The rationale
is that the consumers of this API are likely to want to remove
multiple packages at once. Rather than calling the API N times, call
it just once.

The good part is that we already have the broadcast intent for
suspended packages take an array so only one broadcast. Less stress
on the system.

Another good part is that (right now) we only have one consumer of
this API and it will be easy to make changes once this CL goes in.

As a shell command, for consistency only allowed one package at
a time.

Bug: 22776761
Change-Id: Ic8b8cf64d0a288ea3a282bb7b72f9d663b3b0049
2016-02-17 15:14:33 +00:00
Andrei Stingaceanu
5ae4e73ef0 Merge "Suspend packages - new API for retrieving the suspended status" into nyc-dev 2016-02-17 11:57:51 +00:00
Wale Ogunwale
b305e16051 Merge "Force resize pre-N apps that don't have fixed orientation." into nyc-dev 2016-02-16 17:54:33 +00:00
Andrei Stingaceanu
355b232d79 Suspend packages - new API for retrieving the suspended status
Instead of always rebuilding the full ApplicationInfo for a
package when callers are only interested in the suspended status
add a new fast API in Packagemanager (which only checks the
suspended user setting for the requested package and returns
a boolean) and change the appropriate caller code too.

Bug: 26794775
Bug: 22776761
Change-Id: Ide8428ef734479360d5a8a75fd8e0ed8ddf2da7a
2016-02-16 14:57:29 +00:00
Wale Ogunwale
508ff55e8c Force resize pre-N apps that don't have fixed orientation.
We were previously only doing it for SCREEN_ORIENTATION_UNSPECIFIED,
but there are other orientation settings that aren't fixed that we
need to handle.

Change-Id: If21fcd8312b6267407d94b6646158ac6eae44b44
2016-02-15 19:31:50 -08:00
Jeff Sharkey
115d2c189a Add feature versions for devices and apps.
We're starting to see more instances of device features that will
increment separately from the SDK API level, such as camera HAL,
GPU capabilities, Bluetooth, and other hardware standards.

This change adds the ability for device features to specify a
version, which is defined to be backwards compatible.  That is, apps
requesting an older version of a feature must continue working on
devices with a newer version of that same feature.

When a version is undefined, we assume the default version "0".

Bug: 27162500
Change-Id: If890bf3f3dbb715e8feb80e7059a0d65618482ea
2016-02-15 17:45:42 -07:00
Kenny Guy
b1b302660c Support FBE for managed profiles.
Allow launcher to see and attempt to launch non-crypto
aware application when profile is locked.
Hide unlock notification until parent user is unlocked.
Have unlock notitication use confirm credentials to unlock
the profile.
Updated notification strings as per suggestions in mocks
to make it clearer between users and profiles.

Bug: 27038260

Change-Id: If2d2c8148670d814544f4edd44193d15da32a289
2016-02-12 14:29:37 +00:00
Wale Ogunwale
567704bca2 Merge "Force pre-N apps to be resizeable." into nyc-dev 2016-02-11 18:55:50 +00:00
Wale Ogunwale
d829d36f09 Force pre-N apps to be resizeable.
We feel this experience is better than the 2-finger gesture.
Added ActivityInfo.RESIZE_MODE_FORCE_RESIZEABLE resizeMode
to indicate we are force resizing an app.

Bug: 27132829
Bug: 26847884
Change-Id: I65db2de0d9f3f171cc3bb136cc1282b3ef3549b0
2016-02-11 05:02:14 -08:00
Jeff Sharkey
8212ae0aee Consistent naming for internal storage APIs.
Also completely remove a few confusingly named deprecated APIs.

Change-Id: Ia7e4ea3190a97f0a7dfa9bebf2118da0866ec38f
2016-02-10 15:03:33 -07:00
Adrian Roos
691546e5b7 Isolate Keyguard from main thread badness
Adds a bindService variant to run the ServiceConnection callbacks
on a dedicated Handler.

Changes KeyguardService binding to use the foreground thread
instead of the main thread and changes state to the
KeyguardScrim on the UI thread.

Bug: 26954967
Change-Id: I9d7bd85382816cd0e23772b14ff6518266a9d232
2016-02-10 18:17:29 +00:00
Felipe Leme
d4c6582a60 Merge "Whitelisted ACTION_OPEN_EXTERNAL_DIRECTORY to use file:// URIs." into nyc-dev 2016-02-10 18:02:21 +00:00
Felipe Leme
52fe147602 Whitelisted ACTION_OPEN_EXTERNAL_DIRECTORY to use file:// URIs.
BUG: 27109099
BUG: 26742218
Change-Id: I4848b30e6efbda72ff04a6786bac32f34d528f84
2016-02-10 09:48:01 -08:00
Svetoslav Ganov
e0feadcaac Merge "Add an API to query the package name of the services shared lib" into nyc-dev 2016-02-10 03:00:09 +00:00
Svet Ganov
d7b1f41109 Add an API to query the package name of the services shared lib
The servcies shared lib contains components apps can invoke such
as services to bind to, activities to start, UI choosers, etc.
This lib is built from AOSP code but an OEM may chage its
package name. For example, Google renames the package names for
GMS apps from android.foo.bar to com.google.android.foo.bar.
While we have more than one shared lib that are a part of the
platform (currently shared and services libs) the serivces lib
is the only one clients need to start components in, thus need
to know its package name. This change adds an API to query the
package name of the services shared lib. The API is hidden as
currently the only clients are a part of the system.

Change-Id: Ied48fa4819024522791764b22b3336d4f4b42cc3
2016-02-09 18:49:27 -08:00
Selim Gurun
75827b2fb6 Fix build break
Bug: 26874366
Change-Id: Ic7634cb9d823d4f74d2893f4c46a77a5af02a0a1
2016-02-09 10:55:33 -08:00
Selim Gurun
2d291d89f9 Introduce a use32bitAbi flag
Bug: 26874366

On Multiarch apps, it might be necessary to prioritize 32bit Abi ahead
of 64bit ones. The use32bitAbi flag enables this.

This CL also reverts the public api changes in  I2c1fd1d036efe72b28b5fe996416df69a583959f and Ie3ecea6d84e2cb1522e736a21c3a3a24ac62eb27. Previously
the same functionality was provided using a raw abi string that
utilized cpuabioverride flag.

Change-Id: Idce3cbfedd11ef9079ce8a2901e69d30b1cf9ef4
2016-02-09 10:20:21 -08:00
Svet Ganov
354cd3ce22 Multi packages per APK
This change introduces the ability to have multiple packages per
APK. The feature is currently restricted to privileged apps and
updates to such apps.

In essence the manifest can have multiple child package declarations.
A child package can declare everything an Android package can except
some tags or attributes that are not applicable and instead inherited
from the parent when needed. For example, the target SDK of the parent
applies to all children.

A child package can be updated only through the parent package.
A package with multiple child packages is installed, uninstalled
atomically - no partial installs where some child packages are not
installed.

The remaining work is to ensure broadcasts are also sent for child
packages. This will come in a subsequent change.

Sample app:ag/848432

Design doc: https://docs.google.com/document/d/18nFWtJuZchLxrHf5SBbJW03-Ky9Rh_G0-OVB14b6u78

Change-Id: I6fd021d981bf5786290e0c53502724a14c97358c
2016-02-08 15:14:07 -08:00
Jeff Sharkey
e4697136ed Migrate default app data on non-FBE devices.
When a system app requests "forceDeviceEncrypted" they expect their
default app storage to point at a consistent location regardless of
device FBE support.  So when booting upgraded non-FBE devices, we
may need to migrate any data from CE to DE.  Note that on non-FBE
devices these are just semantic locations with identical protection.

This migration *only* works for non-FBE devices; changing
forceDeviceEncrypted flags on an FBE device always requires a full
data wipe.

Bug: 26668510
Change-Id: Ic5dfeaaf2db26c385901a638ca8ec35eb3c52859
2016-02-06 20:45:15 -07:00
Jeff Sharkey
37355a9f5d Tweaks to file:// Uri StrictMode checks.
Whitelist two more legacy intent actions, and don't enforce the
StrictMode checks when resolving intents that might be coming from
legacy apps.  Newer apps would have already been yelled at directly
before getting to the resolver.

Bug: 26976516, 26977622
Change-Id: Ibf72a361ed68c52cfaac16c32ab40e79005a42e7
2016-02-05 16:19:13 -07:00
Makoto Onuki
911db2e19a Merge "Remove com.google.android.syncadapters.contacts from exception list" 2016-02-05 19:51:18 +00:00
Makoto Onuki
e798ba1033 Remove com.google.android.syncadapters.contacts from exception list
Bug 26902400
Bug 26481405

Change-Id: I3b4d0217ee033f727074f68ebe6a1c1461509d04
2016-02-05 11:45:02 -08:00
Roozbeh Pournader
fee4484637 Various LocaleList cleanups
- Remove the LocaleList#getPrimary() API. It had become confusing
  after locale negotiation was completely implemented. For example,
  it could create the confusion that calling getPrimary() on the
  default locale list would provide the default locale, etc.
- Use the adjusted locale list from LocaleList.getAdjustedDefault()
  in Paints created with no locale list provided.
- Change LocaleList#get() to treat out of bound indexes from both
  negative indexes and too large indexes the same way.

Bug: 26984092
Bug: 26193251
Bug: 26834387
Change-Id: I75f77aea6b75e38793ed8477e5e5a4420d5e6d85
2016-02-04 15:44:03 -08:00
Mikhail Naganov
278fb3b359 Make flags related for "external services" public
ServiceInfo.FLAG_EXTERNAL_SERVICE is set when the service is
exported with the new public manifest attribute "android:externalService"

Context.BIND_EXTERNAL_SERVICE is used by clients when they
are binding such service.

Bug: 22084679
Bug: 21643067
Change-Id: Ifd708f90b47a1571cd54c5ec9fc217f0567d5ff4
2016-02-03 16:22:33 -08:00
Andreas Gampe
fe54b11803 Merge "Frameworks/base: Add A/B OTA preopting" 2016-02-02 16:01:11 +00:00
Wale Ogunwale
f70fb29c83 Merge "Allow apps that target less than N SDK to be resizeable." 2016-02-01 23:58:32 +00:00
Selim Gurun
0829fd4b26 Merge "Run 32-bit app in multiArch APK." 2016-02-01 23:40:23 +00:00
Andreas Gampe
a89087542f Frameworks/base: Add A/B OTA preopting
Add an OTA Dexopt service. Refactor package manager service and
package dex optimizer to reuse some code. Add knowledge about
OTA flag to installer.

Bug: 25612095
Change-Id: I7dd6bb468fea44b9d3acf0ac7d7404fb02d0f30a
2016-02-01 15:38:21 -08:00
Tao Bai
c9a0237f5f Run 32-bit app in multiArch APK.
Bug: 26874366

Change-Id: I2c1fd1d036efe72b28b5fe996416df69a583959f
2016-02-01 14:54:37 -08:00
Wale Ogunwale
163828db30 Allow apps that target less than N SDK to be resizeable.
If an app says it is resizeable then make it resizeable
regardless of the SDK it is targetting.

Change-Id: I51a1c5417657c6b15ce035f8d5af202506f4120a
2016-02-01 11:48:19 -08:00
David Brazdil
8486786493 Merge "Add 'package compile' shell command" 2016-02-01 18:44:22 +00:00
David Brazdil
493411ace4 Add 'package compile' shell command
Bug: 26707406
Change-Id: I554969c9f3b3153179370d3d23a88fa7e8693885
2016-02-01 18:32:55 +00:00
Ruben Brunk
33e0a5f7ed Merge "Add feature tag for high-performance VR devices." 2016-02-01 18:20:00 +00:00
Shreyas Basarge
40a11e525c Merge "Updated Javadoc to reflect min period" 2016-02-01 16:07:21 +00:00
Shreyas Basarge
e96c3b7eff Updated Javadoc to reflect min period
Javadoc updated and logging added for
min period and min flex enforcements
in JobScheduler and SyncManager.

Bug: 26874152
Change-Id: Ifdd248b776a1bd04df21b7b9f0ac96bdef0f8bb6
2016-02-01 16:03:36 +00:00
Shreyas Basarge
a491c07f36 Merge "SyncManager on JobScheduler" 2016-02-01 15:32:58 +00:00
Wale Ogunwale
14a79bd12a Merge changes I8d546487,Ib62d357f
* changes:
  Allow resizeableActivity to be specified at the application level
  Renamed manifest attributes initialWidth/Height to defaultWidth/Height
2016-01-31 20:02:45 +00:00
Wale Ogunwale
174d36d87a Merge "Renamed FLAG_ACTIVITY_LAUNCH_TO_SIDE to FLAG_ACTIVITY_LAUNCH_ADJACENT" 2016-01-31 19:57:16 +00:00