986 Commits

Author SHA1 Message Date
Dianne Hackborn
21f1bd17b2 Fix issue #2438980: Implement package watcher for voice recognizer service setting
I am getting tired of writing package monitor code, realized this is missing in
a number of places, and at this point it has gotten complicated enough that I
don't think anyone actually does it 100% right so:

Introducing PackageMonitor.

Yes there are no Java docs.  I am still playing around with just what this
thing is to figure out what makes sense and how people will use it.  It is
being used to fix this bug for monitoring voice recognizers (integrating the
code from the settings provider for setting an initial value), to replace
the existing code for monitoring input methods (and fix the bug where we
wouldn't remove an input method from the enabled list when it got
uninstalled), to now monitor live wallpaper package changes (now allowing
us to avoid reverting back to the default live wallpaper when the current
one is updated!), and to monitor device admin changes.

Also includes a fix so you can't uninstall an .apk that is currently enabled
as a device admin.

Also includes a fix where the default time zone was not initialized early
enough which should fix issue #2455507 (Observed Google services frame work crash).

In addition, this finally introduces a mechanism to determine if the
"force stop" button should be enabled, with convenience in PackageMonitor
for system services to handle it.  All services have been updated to support
this.  There is also new infrastructure for reporting battery usage as an
applicatin error report.
2010-02-22 11:27:52 -08:00
Daniel Sandler
edcdbb6d3b Add new action for launching the user's music player app.
android.intent.action.MUSIC_PLAYER

http://b/2237931
2010-02-22 09:04:27 -05:00
Christopher Tate
1bb6906c7a Automatically restore app data at install time
When an application being installed defines a backupAgent in its manifest, we
now automatically perform a restore of the latest-known-good data for that app.
This is defined as "data backed up by this app from this handset, if available;
otherwise data for this app as it existed when the device was initially
provisioned."  If neither option exists for the app, no restore action is
taken.

The CL involves major changes in the Backup and Package Managers...

* The Package Manager's act of installing an application has now been split
into two separate phases, with a data-restore phase optionally occurring
between these two PM actions.  First, the details of the install are performed
as usual.  Instead of immediately notifying install observers and issuing the
install-related broadcasts, the in-process install state is snapshotted and
the backup manager notified that a restore operation should be attempted.  It
does this by calling a new API on IBackupManager, passing a token by which it
identifies its in-progress install state.

The backup manager then downloads [if possible] the data for the newly-installed
application and invokes the app's backupAgent to do the restore.  After this
step, regardless of failure, it then calls back into the Package Manager to
indicate that the restore phase has been completed, supplying the token that
was passed in the original notification from the Package Manager.

The Package Manager then runs the final post-install actions: notifying install
observers and sending out all the appropriate broadcasts.  It's only at this
point that the app becomes visible to the Launcher and the rest of the OS.

... and a few other bits and pieces...

* The ApplicationInfo.backupAgentName field has been exposed to the SDK.  This
can be reverted if there's a reason to do so, but it wasn't clear that this
info needs to be hidden from 3rd party apps.

* Debug logging of restore set IDs and operation timeout tokens [used during
any asynchronous Backup Manager operation] are now consistently in hex for
readability.

* We now properly reset our binder identity before calling into the transport
during restore-set operations.  This fixes a permissions failure when a
single-app restore was attempted.

* The 'BackupTest' test app is no longer lumped onto the system partition
by default.

Change-Id: If3addefb846791f327e2a221de97c8d5d20ee7b3
2010-02-19 17:24:07 -08:00
Suchi Amalapurapu
8946dd3355 Move package from internal to external and vice versa. 2010-02-19 14:20:54 -08:00
Mike LeBeau
79375f7619 Two big additions to the voice recognition APIs:
* Allow activities satisfying RecognizerIntent.ACTION_WEB_SEARCH to
  point to the class name of a broadcast receiver which returns details
  about the voice search implementation in an ordered broadcast response.
  Provide a convenience method for getting the intent to fire for this
  info. This can be used to get the current language preference and the
  list of supported languages, and is extensible for future uses.

* When creating a RecognitionManager, allow the caller to optionally specify
  a specific component of a voice recognition service on the device that they
  want to use. This way, an app can still use its own service through
  RecognitionManager, even if it's not the one chosen the user in settings.
2010-02-18 19:19:49 -08:00
Dianne Hackborn
e36d6e277e Work on issue #2263557: PMF3000 showing hybrid of portrait and landscape modes
This is a bunch of reworking of how configuration changes are handled:

- When orientation is changing (for whatever reason), the window manager no
  longer tries to pre-emptively compute a new configuration.  Instead, it
  just determines  change is happening and tells the window manager.
- The activity manager is now responsible for giving the window manager the
  final configuration it is using.  This is both so it knows whem the
  activity manager is done with its configuration updates, and so the window
  manager can use the "real" configuration.
- When an orientation or other configuration change is happening, freeze the
  screen and keep it frozen until the activity manager has given us the
  final configuration.
- The window manager can now send new configurations to its clients during
  its layout pass, as part of a resize, if it has determined that it has
  changed.  This allows for a new View.onConfigurationChanged() API for any
  view to easily find out when the configuration has changed.
- ViewRoot now also works with the activity thread to make sure the process's
  current resources are updated to the new configuration when it receives one
  from a window.  This ensures that at the time onConfigurationChanged() and
  other view callbacks are happening, the correct configuration is in force.
- There is now a sequence number associated with Configuration, which
  ActivityThread uses to avoid using stale configurations.  This is needed now
  that it can receive configurations asynchronously from both the window
  manager and activity manager.
- The hack for keeping the locale has been removed, and underlying problem
  fixed by having Configuration initialize its locale to "unknown" instead of
  a valid default value.
2010-02-18 15:47:34 -08:00
Mathias Agopian
a696f5d667 Add ImageFormat.java and move the Camera/YUV constants from PixelFormat to it.
PixelFormat's corresponding constansts are now deprecated.
2010-02-18 15:32:47 -08:00
Patrick Scott
f43113f621 Unhide setBlockNetworkLoads.
Blocking network images is not as secure as completely blocking network loads.
Leave setBlockNetworkImage so clients can reduce bandwidth by disabling remote
images. This will allow file:// and content:// URIs to load.
2010-02-18 16:12:28 -05:00
San Mehat
d970998b0d framework: storage: Add 'force' option to unmount/destroy storage apis, and update callsites.
Also adds additional storage unit tests

Signed-off-by: San Mehat <san@google.com>
2010-02-18 11:48:48 -08:00
Tobias Haamel
154f7a1cc2 Show car mode notification in status bar.
The notification is an ongoing event and can be used to get out of car mode.
2010-02-18 11:43:03 -08:00
Mike Lockwood
a4903f254b Add passive location provider.
The passive location provider allows receiving location updates without
actually triggering them.  This allows an application to receive location
updates that are being generated due to other clients of the location manager.

Change-Id: Ibf7a96b089c56875d4f62d3210252ae8d9f32768
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-02-17 18:36:40 -05:00
Jeff Sharkey
2b95c24138 Added more @RemotableViewMethod methods, mutate ImageView.
Catch some View methods missed during the first pass of
marking with @RemotableViewMethod annotation.  Also adds new
ImageView.setColorFilter(int) to match the android:tint XML
attribute.

When ImageView touches ColorFilter or alpha, mutate the
underlying Drawable. Fix NPE in StateListDrawable.mutate().
2010-02-17 15:03:32 -08:00
Dave Sparks
0551311980 Unhide new SoundPool API's. Bug 2415373. 2010-02-17 13:29:08 -08:00
Adam Powell
c9fbaabc1b XML attribute for overscrolling behavior 2010-02-17 11:47:00 -08:00
Dianne Hackborn
64e7a257ca Fix build. 2010-02-17 11:15:28 -08:00
Dianne Hackborn
ef6b22fc04 Fix issue #2420412: API review: DeviceAdmin API changes
Note in docs that callbacks are on main thread.
Rename to DeviceAdminReceiver?
Document resetPassword is the device's password.

Also hide android.R.attr.neverEncrypt.
2010-02-17 10:29:52 -08:00
Leon Scroggins
e265532f30 Create a default style for WebTextView.
As a result, all apps using WebView (and therefore WebTextView)
will get the same style, and display properly.

Fixes http://b/issue?id=2385422
2010-02-17 10:30:12 -05:00
Jesse Wilson
d998b3cd24 Removing org.w3c.dom subpackages.
See dalvik change https://android-git.corp.google.com/g/40511
2010-02-16 21:56:42 -08:00
Mike LeBeau
329c6aed78 Remove ACTION_VOICE_SEARCH_SETTINGS (added only for Froyo), because we've got
a more robust solution instead.
2010-02-16 18:22:23 -08:00
Christopher Tate
9f790c309b Fix the build (mucked up an API change / commit / upload sequence)
Change-Id: I0eade23e5ccd4a45dbb77f76bd3cd180ddda7107
2010-02-16 17:20:32 -08:00
Christopher Tate
e28290e21f API CHANGE: expose backup/restore to the SDK
The core backup/restore classes [BackupManager, BackupAgent, RestoreSession, and
RestoreObserver] are now published for 3rd party developers, as well as the suite
of helper classes that exist so far to aid authorship of backup/restore agents.

In conjunction with the API change, the restore-time automatic data wipe has now
been removed:  applications are responsible for managing the logic of wipe vs
merge themselves.  If the app's agent onRestore() callback throws, the data
is presumed to be incoherent and a wipe is issued via the Activity Manager;
otherwise, no automatic action is ever taken.

Change-Id: I0b3418b829d4689b58b88be3d9c4ace37a8583a9
2010-02-16 16:23:55 -08:00
Kenny Root
bb9a51768d Add API to access ICU's East Asian Width
Currently there is no way for an application built against the API to
access East Asian Width data from ICU. This adds an API for applications
to use to access it for correct drawing of international characters.

Change-Id: Iab50698ee555ae2ca8ab4b242cc14aa6e0dc3b48
2010-02-16 15:05:02 -08:00
Dan Egnor
9d4b575453 Add getInsecure() that returns a persistently insecure SSLSocketFactory,
which Email needs for unbundling.

Bug: 2353593
2010-02-16 14:18:24 -08:00
Jean-Baptiste Queru
3af80dc6d9 Expose more Download Manager APIs.
This will allow apps to track download progress.

Change-Id: Id6b77c0fc01b4838fca45e2fe241b1ea08e65038
2010-02-16 13:55:19 -08:00
Paul Westbrook
b9dfb9b403 Download Manager API to support Gmail
Adds APIs to the Download manager to handle downloads based on
opaque ids
2010-02-16 09:25:40 -08:00
Doug Zongker
241379081e update current.xml to fix build
This (new) constant was renamed; forgot to make update-api.

Change-Id: I11ad63f70fc7e266abdc9863b43bf5307227c656
2010-02-16 09:06:32 -08:00
Dianne Hackborn
b125dc5599 Fix MotionEvent pointer API.
Ooops.  The API said that the pointer down and up actions contained
the pointer id, but it is actually the index.  Actually it makes
much more sense for it to be the index, and those ACTION_POINTER_1_DOWN
etc. constants were stupid.
2010-02-12 17:52:22 -08:00
Doug Zongker
33f7a80f76 @hide the bizarro Base64 stream constructors
With no usages of these "backwards" streams, it's not clear that we
want to support them forever in the API.

Also fixed some badly cut-and-pasted javadoc.

Change-Id: I4811d22e493bf2b8eaf79b9e95526e7eab5f27ee
2010-02-12 17:41:40 -08:00
Doug Zongker
d2affae13d add a Base64 implementation to the API
b/1413917 - RFE: Base64 utility class
Change-Id: I11697859e1f78f596b92d2e03a49ed1be04ae42d
2010-02-12 17:13:56 -08:00
Amith Yamasani
0499498935 Add a new KEYBOARD_TAP haptic feedback type for very short, low-latency vibration.
The minimum value varies from device to device, so this is useful for defining
the shortest and most efficient vibration. The VibratorService creates a Thread
when playing back vibration patterns, so this allows you to avoid thread creation
and associated scheduling delays by specifying a one-shot duration in the config
file.
2010-02-12 15:10:37 -08:00
Scott Main
749ee4fefd API change.
add cycle_interpolator resource (it's the only one missing among
all Interpolators) and update public.xml and current.xml with the new resource.
2010-02-12 14:13:27 -08:00
Brett Chabot
90762d35a9 Modify ActivityInstrumentationTestCase2 to not require hardcoded package name.
Deprecate old constructor.

Bug 2440167
2010-02-12 11:09:26 -08:00
Adam Powell
0b8bb4282a Overscrolling modifications. Overscroll will not allow the user to
scroll content out of view. Scrolling will slow down halfway to the
barrier point. API added in View. AbsListView, ScrollView,
HorizontalScrollView all use this API. Overscrolling uses haptic
feedback. Added scroll barrier pattern to config.xml.
2010-02-12 10:26:25 -08:00
Dianne Hackborn
470969346d Add APIs for mapping between new and current package names.
This will allow Market and others to find out what the "real" name
of a package is, when it is currently running under the old name of
a previously installed version.
2010-02-11 20:02:20 -08:00
Dianne Hackborn
315ada7fbb Get rid of the limit-unlock policy control.
This is merged with force-lock.  These both allow effectively the same thing,
so there is no reason to junk up the user experience with them as separate
entities.
2010-02-11 14:36:30 -08:00
Mike LeBeau
378ae126d9 Add SERVICE_INTERFACE and SERVICE_META_DATA constants to RecognitionService,
to be used by anyone implementing a voice recognition service. Also define
a new <recognition-service> styleable to be used in such service's metadata
xml.

Still to do: Change VoiceSearch's GoogleRecognitionService to respond to this
intent, and actually use this intent instead of ACTION_RECOGNIZE_SPEECH here
in RecognitionService.
2010-02-11 14:02:46 -08:00
Tobias Haamel
27b28b3f62 Introduce special UI modes for night and car usage.
The device mode is now called ui mode. Furthermore is the order of
precedence for the resources now in such a way that the ui mode needs
to be specified after the orientation and before the density.

The ui mode can be set, like it is done for the locale, as follows:

IActivityManager am = ActivityManagerNative.getDefault();
Configuration config = am.getConfiguration();
config.uiMode = Configuration.UI_MODE_TYPE_CAR | Configuration.UI_MODE_NIGHT_ANY;
am.updateConfiguration(config);

To allow users to disable the car mode and set the night mode the IUiModeManager
interface is used.

The automatic night mode switching will be added in a separate change.
2010-02-11 21:25:58 +01:00
San Mehat
a181b21305 MountService: Fix some mountset bugs and tighten up some return values
Signed-off-by: San Mehat <san@google.com>
2010-02-11 06:50:31 -08:00
Bjorn Bringert
91f2a20a59 Add content provider for browser geolocation permissions
This replaces the old Google-specific geolocation setting.

Fixes http://b/issue?id=2428694
Part of http://b/issue?id=2383870

Change-Id: I6308b476ad18b1d71d7438b936c592a45365c9f0
2010-02-11 10:02:39 +00:00
Ray Chen
49ffc0ff72 Revise ThumbnailUtils API. 2010-02-11 10:26:34 +08:00
Ben Cheng
23085b781e Support per-application switch to execute the VM in safe mode.
The new attribute can be set by adding android:safeMode="true"
in AndroidManifest.xml with the SDK.

Tested with pairing locally compiled SDK with Eclipse and verified that the JIT
(the only component currently included in the safe mode) is indeed disabled
with the new attribute.

Bug: 2267583
2010-02-10 14:51:31 -08:00
Dan Egnor
60586f2ec6 API CHANGE: Add SSLSessionCache public API to allow unbundled SSL session caching.
Generally clean up the associated SSLCertificateSocketFactory API as well,
change AndroidHttpClient to use this new thing, and make the android-common
library build SDK-clean (woo hoo).

Bug: 2362543
Bug: 2357311
2010-02-10 14:43:21 -08:00
Bjorn Bringert
e4e82f2782 Unhide SearchManager.INTENT_ACTION_SEARCH_SETTINGS
This intent action is needed by Settings to start the search settings
activity which lives in QuickSearchBox / GoogleQuickSearchBox.

Fixes http://b/issue?id=2394530

Change-Id: Iea2a7d9df0092459e5618986f4f789f9257f912a
2010-02-10 21:30:29 +00:00
Bjorn Bringert
23897c16a6 Use resource ID for searchable description
Before, SearchableInfo read and cached the localized
searchable description, which meant that it was not updated
on locale changes. Now SearchableInfo only holds the resource
ID.

SearchableInfo is a new API in Froyo, so it's ok to change.

Part of http://b/issue?id=2175247

Change-Id: I1898f7895b9172f58419d906ad741cb7dd1e7252
2010-02-10 21:22:57 +00:00
Suchi Amalapurapu
117818e4f1 Add new manifest option for install location
Change recommendAppInstallLocation api
add code to parse new attribute.
Define flags in PackageInfo
Add new settings attributes for enabling setting and value for install location
Some tests
The policy for install location: if explicitly set in manifest as internal only we try to install the app only on internal storage. if set to preferExternal, we try to install it on sdcard if possible. If not we fall back to internal.
If the user enables setting SET_INSTALL_LOCATION(which will always
be set to false in final release builds) and sets a prefered location, we try
to honour it.
2010-02-10 08:59:08 -08:00
Wei-Ta Chen
d2391faa5d Modify the API of YuvImage, so that callers do not need to deal with
the yuv format when specifying a rectangle region.

Bug: 2285598
2010-02-10 23:15:37 +08:00
Alex Gruenstein
cc47fae688 Add EXTRA_PARTIAL_RESULTS so that clients can enable receiving results via onPartialResults() 2010-02-09 15:25:53 -08:00
Dianne Hackborn
e83cefcef0 New external storage APIs.
This implements the spec for external storage organization, and
properly reflects how the media scanner organizes the files it finds.

Also includes package manager support for removing app private
files from external storage when the application is uninstalled.

For the new APIs and paths, the main place to look is Environment
and Context.
2010-02-09 14:20:55 -08:00
Romain Guy
305a2eb8e5 Properly notifies listener when an animation is cancelled.
Bug: #2428005.
2010-02-09 11:36:44 -08:00
San Mehat
b104340496 Framework: Clean up / Refactor Mount APIs
- Move android.storage.* -> android.os.storage.* and refactor users
 - Refactor generic shares back to explicit ums enable/disable/isEnabled
 - Remove media insert/removed event callbacks (not ready for Froyo)
 - Remove 'label' from volume state change callbacks
 - Add public API functions for enabling/disabling USB mass storage (permissions enforced
   in MountSevice)
 - Remove some stray un-needed import lines
 - Move android.os.IMountService / android.os.IMountServiceListener -> android.os.storage
 - Improve code comments

Updated:
  MountService: Add dup state check and move debugging behind a conditional
  UsbStorageActivity: Fix review comments + a TODO
  StorageNotification: Add @Override tags
  StorageManager: Don't use a static Listener list
  MountService: Reduce bloat and fix == where I meant .equals()
  PackageManagerTests: Update for new API

Signed-off-by: San Mehat <san@google.com>
2010-02-09 11:03:16 -08:00