232 Commits

Author SHA1 Message Date
Jeff Sharkey
9e18fd1a72 Permissions to protect bandwidth statistics.
Introduces new "net_bw_stats" group which will protect reading
detailed bandwidth statistics from the kernel.  Also introduce
"net_bw_acct" group which will enable specific applications to
request that their network traffic be counted against other UIDs.

This change associates manifest permissions with the low-level GIDs.

Change-Id: If3fc28053afda201ff305d798a8878ff1f35b997
2011-06-22 10:15:32 -07:00
satok
8969d9924c Revert "Create TextServiceManager and SpellCheckerService"
This reverts commit eaddb894865a804279659b4aad6364a34ab50beb.
2011-06-22 16:41:58 +09:00
satok
eaddb89486 Create TextServiceManager and SpellCheckerService
Bug: 4176026

Spec of TextServiceManager
- Chooses the most applicable TextService(e.g. SpellCheckerService, WordBreakIteratorService..)
    for each locale

Spec of SpellCheckerService
- Returns whether the given string is a correct word or not
- Returns Suggestions for the given string

Change-Id: Ia25e7b4f308778891929e31b8cbd741f6848cce4
2011-06-20 23:00:30 +09:00
Chia-chi Yeh
3f3337a662 VPN: avoid leaking file descriptors.
Change-Id: If70f5af3529d79bddb9d72675cf6eb038ff3ff70
2011-06-17 16:34:32 -07:00
Jeff Sharkey
21c9c45e5c Interface-level network policy, persist policies.
Define NetworkPolicy as cycle-reset day and warning/limit values, and
set/get through NetworkPolicyManager.  Watch ConnectivityManager for
network connection events, and apply quota rules based on matching
interfaces.  Policy service matches based on strong identity to support
IMSI-specific policy values.

Calculates remaining quota based on current stats recorded since the
last reset cycle day.  Tests to verify edge cases around February.

Persist network and UID policies in XML, and restore on boot.

Change-Id: Id40ba7d6eed6094fbd5e18e6331286c606880d80
2011-06-10 19:35:20 -07:00
Dave Santoro
432513380e API modifications to handle profiles in Contacts.
The user's profile is represented as a single Contact, comprised of
Raw Contacts which may be contributed from any accounts the user has on the
system.

Two new permissions have been added: READ_PROFILE and WRITE_PROFILE.  These are
required for reading or writing any contact data that is designated as part of
the user's profile.

Contact queries can include the user's profile data by setting the
include_profile URI parameter to 1 (this requires READ_PROFILE access).  By
default, the user's profile data will not be included in any Contact queries.

Change-Id: I25616f59622dbb157032c9c435064eb36af6e8e1
2011-06-09 11:04:12 -07:00
Jake Hamby
d4f1bacca5 resolved conflicts for merge of 7ca13deb to master
Change-Id: If34814d6c70cf63eca9bd816845389f6785518ae
2011-06-08 23:20:09 -07:00
Jake Hamby
7d259626d0 resolved conflicts for merge of 0cb17a52 to honeycomb-plus-aosp
Change-Id: I784e6d1946fa708f63becece070c7090cec6f1e2
2011-06-07 15:01:50 -07:00
Svetoslav Ganov
8643aa0179 Interrogation of the view hierarchy from an AccessibilityService.
1. Views are represented as AccessibilityNodeInfos to AccessibilityServices.

2. An accessibility service receives AccessibilityEvents and can ask
   for its source and gets an AccessibilityNodeInfo which can be used
   to get its parent and children infos and so on.

3. AccessibilityNodeInfo contains some attributes and actions that
   can be performed on the source.

4. AccessibilityService can request the system to preform an action
   on the source of an AccessibilityNodeInfo.

5. ViewAncestor provides an interaction connection to the
   AccessibiltyManagerService and an accessibility service uses
   its connection to the latter to interact with screen content.

6. AccessibilityService can interact ONLY with the focused window
   and all calls are routed through the AccessibilityManagerService
   which imposes security.

7. Hidden APIs on AccessibilityService can find AccessibilityNodeInfos
   based on some criteria. These API go through the AccessibilityManagerServcie
   for security check.

8. Some actions are hidden and are exposes only to eng builds for UI testing.

Change-Id: Ie34fa4219f350eb3f4f6f9f45b24f709bd98783c
2011-06-06 18:46:03 -07:00
Jeff Brown
7218d830e2 resolved conflicts for merge of ca2b552d to master
Change-Id: I2f3693a59042ac5aa2d7bcdc3a504c78dc99a18b
2011-06-03 15:50:27 -07:00
Jeff Brown
ca2b552d98 am c8812761: am e1718de6: Merge "Add a preference panel for mouse speed." into honeycomb-mr2
* commit 'c8812761609e532cceb400b112ed9982149c2490':
  Add a preference panel for mouse speed.
2011-06-02 17:34:03 -07:00
Jeff Brown
c881276160 am e1718de6: Merge "Add a preference panel for mouse speed." into honeycomb-mr2
* commit 'e1718de61c20c8d401633f83589f18d2c0c652db':
  Add a preference panel for mouse speed.
2011-06-02 17:28:07 -07:00
Jeff Brown
1a84fd1fb7 Add a preference panel for mouse speed.
Bug: 4124987
Change-Id: I3ce175d268a1d043cf5878481261b1049a15a149
2011-06-02 15:39:21 -07:00
Jake Hamby
ab79ee4adc Enable full support for SMS Cell Broadcast.
Implement full support for SMS Cell Broadcast (3GPP TS 23.041).
Includes support for ETWS and CMAS emergency message types.
Includes GSM and UMTS support (CDMA will be added later).

Note: the change to GsmAlphabet.java is only necessary if the
SMS national languages support patch has been applied. If that
change has not been applied, then the changes to GsmAlphabet.java
in this patch set can safely be ignored.

Change-Id: Ia0362c53695b8ef9a0982f558f1cffa912def34b
2011-06-01 15:54:20 -07:00
Chia-chi Yeh
9f67adfc2d Add a new permission for user space VPN applications.
Change-Id: I2b87ef34db01209dac45fbceccafd865840830d5
2011-05-16 15:16:58 -07:00
Christopher Tate
4a627c71ff Full local backup infrastructure
This is the basic infrastructure for pulling a full(*) backup of the
device's data over an adb(**) connection to the local device.  The
basic process consists of these interacting pieces:

1. The framework's BackupManagerService, which coordinates the
   collection of app data and routing to the destination.

2. A new framework-provided BackupAgent implementation called
   FullBackupAgent, which is instantiated in the target applications'
   processes in turn, and knows how to emit a datastream that contains
   all of the app's saved data files.

3. A new shell-level program called "bu" that is used to bridge from
   adb to the framework's Backup Manager.

4. adb itself, which now knows how to use 'bu' to kick off a backup
   operation and pull the resulting data stream to the desktop host.

5. A system-provided application that verifies with the user that
   an attempted backup/restore operation is in fact expected and to
   be allowed.

The full agent implementation is not used during normal operation of
the delta-based app-customized remote backup process.  Instead it's
used during user-confirmed *full* backup of applications and all their
data to a local destination, e.g. via the adb connection.

The output format is 'tar'.  This makes it very easy for the end
user to examine the resulting dataset, e.g. for purpose of extracting
files for debug purposes; as well as making it easy to contemplate
adding things like a direct gzip stage to the data pipeline during
backup/restore.  It also makes it convenient to construct and maintain
synthetic backup datasets for testing purposes.

Within the tar format, certain artificial conventions are used.
All files are stored within top-level directories according to
their semantic origin:

apps/pkgname/a/  : Application .apk file itself
apps/pkgname/obb/: The application's associated .obb containers
apps/pkgname/f/  : The subtree rooted at the getFilesDir() location
apps/pkgname/db/ : The subtree rooted at the getDatabasePath() parent
apps/pkgname/sp/ : The subtree rooted at the getSharedPrefsFile() parent
apps/pkgname/r/  : Files stored relative to the root of the app's file tree
apps/pkgname/c/  : Reserved for the app's getCacheDir() tree; not stored.

For each package, the first entry in the tar stream is a file called
"_manifest", nominally rooted at apps/pkgname.  This file contains some
metadata about the package whose data is stored in the archive.

The contents of shared storage can optionally be included in the tar
stream. It is placed in the synthetic location:

shared/...

uid/gid are ignored; app uids are assigned at install time, and the
app's data is handled from within its own execution environment, so
will automatically have the app's correct uid.

Forward-locked .apk files are never backed up.  System-partition
.apk files are not backed up unless they have been overridden by a
post-factory upgrade, in which case the current .apk *is* backed up --
i.e. the .apk that matches the on-disk data.  The manifest preceding
each application's portion of the tar stream provides version numbers
and signature blocks for version checking, as well as an indication
of whether the restore logic should expect to install the .apk before
extracting the data.

System packages can designate their own full backup agents.  This is
to manage things like the settings provider which (a) cannot be shut
down on the fly in order to do a clean snapshot of their file trees,
and (b) manage data that is not only irrelevant but actively hostile
to non-identical devices -- CDMA telephony settings would seriously
mess up a GSM device if emplaced there blind, for example.

When a full backup or restore is initiated from adb, the system will
present a confirmation UI that the user must explicitly respond to
within a short [~ 30 seconds] timeout.  This is to avoid the
possibility of malicious desktop-side software secretly grabbing a copy
of all the user's data for nefarious purposes.

(*) The backup is not strictly a full mirror.  In particular, the
    settings database is not cloned; it is handled the same way that
    it is in cloud backup/restore.  This is because some settings
    are actively destructive if cloned onto a different (or
    especially a different-model) device: telephony settings and
    AndroidID are good examples of this.

(**) On the framework side it doesn't care that it's adb; it just
    sends the tar stream to a file descriptor.  This can easily be
    retargeted around whatever transport we might decide to use
    in the future.

KNOWN ISSUES:

* the security UI is desperately ugly; no proper designs have yet
  been done for it
* restore is not yet implemented
* shared storage backup is not yet implemented
* symlinks aren't yet handled, though some infrastructure for
  dealing with them has been put in place.

Change-Id: Ia8347611e23b398af36ea22c36dff0a276b1ce91
2011-05-10 17:52:51 -07:00
Mike Lockwood
4397c32402 am c535f7f2: DO NOT MERGE Revert "Remove permission android.permission.WRITE_MEDIA_STORAGE"
* commit 'c535f7f291f0bda688efcee62f21cf44d0ebe38e':
  DO NOT MERGE Revert "Remove permission android.permission.WRITE_MEDIA_STORAGE"
2011-05-04 08:57:29 -07:00
Mike Lockwood
c535f7f291 DO NOT MERGE Revert "Remove permission android.permission.WRITE_MEDIA_STORAGE"
We need this to allow MTP to access secondary external storage devices

This reverts commit 35a2ea2fbf156a503d1b0bc6ca7784e51e2462f4.

Conflicts:

	data/etc/platform.xml

Change-Id: Iaf9cf120217e8417d328a51db0d82be6835b0ff0
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-05-04 10:41:20 -04:00
Mike Lockwood
f60ba87f07 DO NOT MERGE Revert "Remove permission android.permission.WRITE_MEDIA_STORAGE"
We need this to allow MTP to access secondary external storage devices

This reverts commit 35a2ea2fbf156a503d1b0bc6ca7784e51e2462f4.

Conflicts:

	data/etc/platform.xml

Change-Id: I0b139a0f3b369c1080831a5b3a48f5d9a330b1bb
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-05-03 21:03:56 -04:00
Wink Saville
ec9b5d17af am ee081bf5: am 3ed0a1ec: Merge "IMS: Provide net_admin permission so that IPSec could be configured/used." into honeycomb-LTE
* commit 'ee081bf5ee936396a89d5bd2b29487047b260f49':
  IMS: Provide net_admin permission so that IPSec could be configured/used.
2011-05-03 16:36:36 -07:00
Wink Saville
ee081bf5ee am 3ed0a1ec: Merge "IMS: Provide net_admin permission so that IPSec could be configured/used." into honeycomb-LTE
* commit '3ed0a1ec7aa6364c236721a1bd29fd196f259cba':
  IMS: Provide net_admin permission so that IPSec could be configured/used.
2011-05-03 16:33:08 -07:00
Ramesh Sudini
0e7b5a0287 IMS: Provide net_admin permission so that IPSec could be configured/used.
IMS configures the security database in kernel with keys generated from ISIM.

Change-Id: Iae9fb85f286ff2a627369d784a127bf7d4d8f4b3
2011-05-03 13:46:08 -07:00
Mike Lockwood
1e23db4c2f Revert "Remove permission android.permission.WRITE_MEDIA_STORAGE"
We need this to allow MTP to access secondary external storage devices

This reverts commit 35a2ea2fbf156a503d1b0bc6ca7784e51e2462f4.

Conflicts:

	data/etc/platform.xml

Change-Id: I9faf54526182a786a1c0ca1fd01a09baabca186d
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-04-22 07:11:20 -07:00
Dianne Hackborn
0c5001d776 Add APIs to remove tasks.
You can remove sub-tasks inside of a task, or an entire task.

When removing an entire task, you can have its process killed
as well.

When the process is killed, any running services will get an
onTaskRemoved() callback for them to do cleanup before their
process is killed (and the service possibly restarted).

Or they can set a new android:stopWithTask attribute to just
have the service automatically (cleanly) stopped at this point.

Change-Id: I1891bc2da006fa53b99c52f9040f1145650e6808
2011-04-12 18:28:06 -07:00
Jason parks
5ee250aa74 am 1d733625: am cca2f2f9: Merge "Send out a broadcast that the system is being factory reset." into gingerbread
* commit '1d73362597c49f4692a580460bc8697a8f1d0efa':
  Send out a broadcast that the system is being factory reset.
2011-04-04 16:43:34 -07:00
Jeff Hamilton
016f884747 am b9896794: am 96cf34d3: Merge "Make STOP_APP_SWITCHES signatureOrSystem." into gingerbread
* commit 'b98967942e9a764b80abc8ff1c6f6f2d620c0f7a':
  Make STOP_APP_SWITCHES signatureOrSystem.
2011-03-30 15:18:30 -07:00
Jason parks
cca2f2f987 Merge "Send out a broadcast that the system is being factory reset." into gingerbread 2011-03-30 08:17:53 -07:00
Jeff Hamilton
10de0b31df Make STOP_APP_SWITCHES signatureOrSystem.
The NFC service relies on this permission
for it's dispatching mechanism and it is
no longer signed with the platform cert.

Bug: 4173610
Change-Id: I598ad2889c4af307f04433093923255fe7daedbb
2011-03-25 16:17:53 -05:00
Jason parks
4ca74dc4c2 Send out a broadcast that the system is being
factory reset.

Change-Id: I339b7ce58cb3f48316103be49b582d4f7e9b63bf
2011-03-16 09:29:47 -05:00
Nick Pelly
a64e2ad4da resolved conflicts for merge of 38d0d562 to honeycomb-plus-aosp
Change-Id: Iff9ea08b810b0d142a9227272492c0305a9bcf42
2011-03-14 10:28:11 -07:00
Nick Pelly
367f41f8f6 Implement new NFC-EE API's as shared library (frameworks/base).
Change-Id: I45c4eaf59ec78167fc236fdd59676465a5e1bcb7
2011-03-10 16:03:46 -08:00
TK MUN
4bdab1751f DO NOT MERGE WiMAX support
- In Connectivity service, start WiMAX service
- 4G icon display in StatusBarPolicy
- Add DHCP renew
- Add radio for WiMAX

Change-Id: Iffff012b270d80e84ec8fbd4486921a8adb847dd
Signed-off-by: TK MUN <tk.mun@samsung.com>
2011-03-09 22:37:08 -08:00
Mike Lockwood
3a68b8338b USB: Add API and dialog for apps to request permissions for USB devices and accessories
New APIs:

UsbManager.hasPermission returns true if the caller has permission
for the given device or accessory

UsbManager.requestPermission poses a dialog to allow the user to give the caller
permission for the device or accessory.
Result is returned via a PendingIntent.
No dialog is displayed if the caller already has permission.

Also moved UsbResolverActivity to SystemUI package

BUG: 4069037

Change-Id: I93be769501a8776b49ac26e468af19f8fa2114c9
2011-03-08 21:22:19 -05:00
Mike Lockwood
40bbf9295d DO NOT MERGE: Backport USB accessory support to gingerbread
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-03-01 23:09:12 -08:00
Mike Lockwood
c4308f01c9 Move USB framework support from android.hardware to android.hardware.usb package
Change-Id: I00fd4f0caaa4aebe48f71c576bb211b5f38bf88d
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-03-01 08:07:20 -08:00
Mike Lockwood
02eb8746de UsbManager: Enhancements for managing USB devices and accessories
When a USB device or accessory is connected, the UsbService now asks the
user which application to associate with the device or accessory.
Applications interested in devices or accessories must specify the
devices they work with via meta-data attached to their manifest.
Permission to communicate with the device is assigned when the user chooses
the activity to use for the device.
The user has the option of clicking the "always use this application" checkbox
to make the assignment automatic in the future.
The user may later clear this preference and revoke permission for an application
to have permission to communicate with the device by clicking the "Clear defaults"
button for the activity in the Manage Applications panel in Settings.

Added class UsbResolveActivity (a subclass or ResolveActivity for choosing
an activity for a USB device or accessory)

Added UsbDeviceManager, which manages the mapping between USB devices/accessories
and applications, including default applications for devices and accessories,
and manages application permissions.

Add interface to allow Settings to clear device and accessory
preferences and permissions for an application.

Remove obsolete ACCESS_USB permission.

Add new signatureOrSystem MANAGE_USB permission to allow administrating
preferences and permissions.

Moved UsbService.java to a "usb" subdirectory, along with new classes
UsbResolveActivity and UsbDeviceManager.

Change-Id: I92554381e9779e68ce380daaee4e1401fb875703
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-02-28 17:00:45 -08:00
Dianne Hackborn
e7f972122d Implement issue #3426299: Introduce application "stopped" state
The package manager now keeps track of whether an application is
stopped.  There are new intent flags to control whether intent
filters in a stopped application will match the intent.  This is
currently used in one place, sending broadcasts, so that stopped
apps can not be launched due to background processes.

The package manager during first init makes sure no applications
are in the stopped state.  When new applications are installed,
that begin in the stopped state.  When the activity manager is
launching a component of an application, it ensures the application
is taken out of the stopped state.

The "force stop" button in manage applications will now put an
application back in to the stopped state; it can't go back out
of the stopped state until one of its components is launched by
the activity manager.

There will probably be a few more places where we need to filter
stopped applications out of intent matches, but doing this for
broadcast is a very big first step.

This also introduces a new broadcast that is sent to an application
after it is replaced with a new .apk.  But only if the app is not
in the stopped state.  This makes it a lot easier for developers to
implement code to get their application back in proper running shape
after an upgrade.

Finally another new broadcast is added that is sent to a package's
installer at the first time it is launched.  This allows the installer
to tell the package about it being installed only when it is first
actually used.

Change-Id: I589c53ff0e0ece868fe734ace4439c0d202dca2d
2011-02-25 14:46:27 -08:00
Peter Visontay
8d224caf98 ActivityManager exposes launch count API.
Bug: 3431684
Change-Id: I49d4fb0b1620aafaf251d77700bc017859328968
2011-02-22 11:51:49 +00:00
Mike Lockwood
984dd8a206 Merge "UsbManager: New APIs for USB accessories" 2011-02-16 12:42:35 -08:00
Nick Pelly
ef12256ca5 am d8d51fed: am 8c8e9d9a: am 1df862a4: Minor doc update.
* commit 'd8d51fed861cd36f57f1eb2542def23322379d7c':
  Minor doc update.
2011-02-16 09:27:37 -08:00
Nick Pelly
d8d51fed86 am 8c8e9d9a: am 1df862a4: Minor doc update.
* commit '8c8e9d9a7f1bddbc995a5c088f19a0a3be1f6a5b':
  Minor doc update.
2011-02-16 09:25:09 -08:00
Nick Pelly
1df862a465 Minor doc update.
Change-Id: I1d29adfccbdc196a145a2c2a044d63b00e5f788b
2011-02-16 09:18:34 -08:00
Mike Lockwood
9182d3c4eb UsbManager: New APIs for USB accessories
USB accessories are peripherals that connect to android devices as a USB host.

When connected, the accessory will first identify itself to the android device
by sending manufacturer, product, accessory type and version strings
to the device, and then request the device to enter USB accessory mode.
The device will then enable the USB accessory kernel driver and disable
all other USB functionality except possibly adb
(adb can be used while the android device is connected to the PC
and the PC is running software that emulates a USB accessory)

The class android.hardware.UsbAccessory is used to describe the
currently attached USB accessory.
UsbAccessory contains the manufacturer, product, accessory type
and version strings to identify the accessory.
The accessory can be opened as a ParcelFileDescriptor, which can be used
to communicate with the accessory over two bulk endpoints.

The Intents UsbManager.USB_ACCESSORY_ATTACHED and
UsbManager.USB_ACCESSORY_DETACHED are broadcast when accessories are
connected and disconnected to the device.  The USB_ACCESSORY_ATTACHED
contains a UsbAccessory object for the attached accessory as an extra.
The Intent also contains string extras for the manufacturer, product,
accessory type and version strings to allow filtering on these strings.

Change-Id: Ie77cbf51814a4aa44a6b1e62673bfe4c6aa81755
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-02-16 08:25:16 -05:00
Dianne Hackborn
3a40182c77 am 49295e53: am ccd79399: am 1d07b5bc: Merge "Make CHANGE_COMPONENT_ENABLED_STATE a signatureOrSystem perm." into gingerbread
* commit '49295e5379472c22af8975e32271f9659c016531':
  Make CHANGE_COMPONENT_ENABLED_STATE a signatureOrSystem perm.
2011-01-26 14:17:37 -08:00
Dianne Hackborn
49295e5379 am ccd79399: am 1d07b5bc: Merge "Make CHANGE_COMPONENT_ENABLED_STATE a signatureOrSystem perm." into gingerbread
* commit 'ccd79399cc2a28d79287fd1558c5f5a530356003':
  Make CHANGE_COMPONENT_ENABLED_STATE a signatureOrSystem perm.
2011-01-26 14:15:08 -08:00
Dianne Hackborn
f5e4f208b9 Make CHANGE_COMPONENT_ENABLED_STATE a signatureOrSystem perm.
Change-Id: I53a6671d5478e7dbca44b17d90f1edfa8e3420bc
2011-01-26 12:40:18 -08:00
Adam Powell
7df04fb2a0 am 41cd1ce1: am f72a13ec: Merge "Fix bug 3378333 - Holo-style layout for granting permissions" into honeycomb
* commit '41cd1ce1b97e48190b47447555560702d0843aba':
  Fix bug 3378333 - Holo-style layout for granting permissions
2011-01-25 13:47:27 -08:00
Adam Powell
c91466f56a Fix bug 3378333 - Holo-style layout for granting permissions
Change-Id: Ie1bb925db3ddd8343c9756e220a0d821f4d31c6d
2011-01-25 13:34:28 -08:00
Mike Lockwood
97d7e4c227 Make ACCESS_USB permission for applications to access USB devices:
- change from signatureOrSystem to normal
- no longer associate this permission with the "usb" unix group
- add to public API

Change-Id: I3be3a5d138719dd126ff0a798824a77f9ce79e24
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-01-22 15:56:09 -08:00
Mike Lockwood
e7d511e148 New APIs for USB host support:
UsbManager:
- is now a service retrievable via Context.getSystemService(Context.USB_SERVICE).
- provides support for returning a list all connected USB devices
- broadcasts ACTION_USB_DEVICE_ATTACHED and USB_DEVICE_DETACHED when devices
  are added and removed from the USB host bus

UsbDevice:
- represents an attached USB device.

UsbInterface:
- represents an interface on a USB device
- devices may have multiple interfaces if they provide multiple
   sets of functionality (for example, android phones typically have interfaces
   for both USB mass storage and adb)

UsbEndpoint:
- represents an endpoint on a USB interface
- endpoints are used for sending or receiving data
  (only in one or the other direction)

UsbRequest:
- encapsulates a send or receive request to be sent over an endpoint

Change-Id: Ieef3e434c62760770ea839070cf5eba1a705967a
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-01-22 15:56:09 -08:00