11908 Commits

Author SHA1 Message Date
Jeff Hamilton
52d3203ef6 Add dispatching overrides for foreground apps.
Apps can register to override the default dispatching
but only when they're in the foreground.

Change-Id: I8e9a9254d3f79f097fb3c8c677d806043574ba4d
2011-01-13 14:24:07 -06:00
Wei-Ta Chen
61d9ffbfd8 Merge "Do not merge." into gingerbread 2011-01-13 12:02:32 -08:00
Nick Pelly
253c509cb0 Make sure service handles are live before passing to other objects.
Change-Id: Ia3fa799b56463f313da0e84a50c4dc75d584eaca
2011-01-13 09:22:57 -08:00
Eric Fischer
a74de88e8e Add date format and map center resources for new locales.
Change-Id: I62e7724993c160a11b3ece922a50b7b8ebc06c31
2011-01-12 16:44:09 -08:00
Nick Pelly
a29bf14e1d Merge "New Intent defined for RF ON/OFF events" into gingerbread 2011-01-12 16:28:59 -08:00
daniel_tomas
200ca02fca New Intent defined for RF ON/OFF events
Change-Id: Ie1bc056bd36eb999b4678c594a3edc801a0cf6a1
2011-01-12 16:28:34 -08:00
Kenny Root
e8c04db71e Merge "Add the {get,set}PackageObbPaths calls to API" into gingerbread 2011-01-12 15:03:43 -08:00
Jaikumar Ganesh
c8f42fb698 Merge "DO NOT MERGE: Remove auto connection on ACL connection." into gingerbread 2011-01-12 13:56:13 -08:00
Jaikumar Ganesh
d50ac2966e DO NOT MERGE: Remove auto connection on ACL connection.
There is no need for this and causes problems with certian cars.

Fixes bug: 3281016

Change-Id: Idb65bbd4c8573923ebf82195b828ae071cb20aef
2011-01-12 13:50:06 -08:00
Gilles Debunne
16141478df SelectAllOnFocus shows a higlighted text. DO NOT MERGE.
Bug 3201383

Highlighted is different from selected, only the background is modified
and selection mode is not started.

Tapping inside a highlighted text places the cursor. This is especially
useful for WebView and search bar has been modified to select all on focus.

Selection handles time out is no longer needed.

This CL is pretty involved and especially messes up with the terrible
ExtractedTextView, which causes a lot of problem with text selection
across device rotations.

The current implementation works pretty well. It has one problem: the handles
are not displayed when switching to landscape mode with a selected text.

This is still an improvement over the current GB version, where the handles
are not preserved at all across device rotation and where I can find more bugs.

Handles are now hidden when a context menu is displayed.

I can polish this more if we decide to include this in the MR1.

Change-Id: Id10bf2808ff25752efd59a1987e91d609ba478cd
2011-01-12 09:46:53 -08:00
Wei-Ta Chen
25bce3a673 Do not merge.
Backport changes related to BitmapRegionDecoder from HoneyComb to
Gingerbread.

Bug: 3309014

////////////////////////////////////////////////////
This is a combination of 7 commits.
Revert "Do not merge."

This reverts commit f7681f84918c27f6a626681ce37ed2a236c44e82.

Change-Id: I46fd710600b1649773eaea2d9abc2b21a592f9a6

Fix a initialization bug in BitmapRegionDecoder.

Change-Id: I6c1151fd34970a84d4de52d664d9a5dc464892c5

Fix segfault when tring to throw IOException.

Change-Id: I530cc4409ba4ca17cec933afad077c5f60ba554f

Fix 3122139, where previewing an attachment for the second time will
fail.

Use AutoFDSeek to mark and restore the position before we read data from
the descriptor.

Change-Id: I3d4f012dce486e19b113bc90a98b94031cfa8195

Add inPreferQualityOverSpeed into BitmapFactory.Options.

The new field allows a developer to use a more accurate by
slightly slower IDCT method in JPEG decode. This in turns improves the
quality of the reconstructed image.

The field by default is not set and thus does not affect existing
applications.

Bug: 3238925
Change-Id: I93d55b7226e47a43e639325cd1a677694d6f2ee4

Unhide inPreferQualityOverSpeed in BitmapFactory.Options.

The new field allows a developer to use a more accurate by
slightly slower IDCT method in JPEG decode. This in turns improves the
quality of the reconstructed image.

The field by default is not set and thus does not affect existing
applications.

Bug: 3238925

Related changes: https://android-git.corp.google.com/g/#change,83291 and
                 https://android-git.corp.google.com/g/#change,83294

Change-Id: I969f5c413f9b2179454aeb90e18ae8222ee583b4

Correct the API comments.

BitmapRegionDecoder supports PNG as well.
2011-01-11 22:54:10 -08:00
Jeff Brown
6f71d0fedb Filter virtual keys after touches. (DO NOT MERGE)
Adds a new virtualKeyQuietTimeMillis configuration resource that sets
the duration for which virtual keys will be dropped after recent touches
on screen.  The default value is 0; it is intended to be overridden
per device using a resource overlay.

This change is designed to help in two cases:

1. Swipes from touchscreen into virtual key area.
2. Accidental taps in virtual key area while using on-screen keyboard.

Bug: 3089163
Change-Id: Id6733c83c2e2bc8d9553aa0e5c1fd74b741bec6e
2011-01-11 20:56:04 -08:00
Kenny Root
1c6e764275 Allow updated system apps to retain priority
Previously any updated system apps would not be able to have a greater
than 0 priority on an activity intent filter. Moving the priority check
later in the package scanning allows it to apply to updated system
packages as well.

Bug: 2572398
Change-Id: I9fdf7906809518b28b49ffec31afec1442d85d3c
2011-01-11 15:51:46 -08:00
Gilles Debunne
dc32a99889 Blinking runnable is created only if text is editable. DO NOT MERGE.
Change-Id: If85acc73cfa12b6da23d60459a746e1aef51d3aa
2011-01-11 10:24:11 -08:00
Gilles Debunne
d5253fae69 All runnable are stopped on detach. DO NOT MERGE.
This prevents these runnable from holding a reference to the context
that will prevent it from being garbage collected.

The blinking cursor is especially bad and appears in memore traces.

Change-Id: I8acbfbbfc59975dfd7bcf06e941074ea7dc0b0bc
2011-01-11 10:21:41 -08:00
Martijn Coenen
25be536521 Implement canMakeReadonly().
The method is needed since makeReadOnly() only works on T1T/T2T. Also removed
makeLowlevelReadonly(), since NFC forum does not allow setting the CC and the lock
bits separately.

Change-Id: I8e6d7c065b1f017ef07d878c41df05e1a8193f5a
2011-01-10 12:11:33 -08:00
Nick Pelly
9293937619 Merge "Remove attemptDeadServiceRecovery() from TagTechnology's." into gingerbread 2011-01-10 12:02:36 -08:00
Nick Pelly
d64d711d45 Merge "Change Tag.getTechnology(NfcAdapter, int) to NfcAdapter.getTechnology(Tag, int)" into gingerbread 2011-01-10 12:02:26 -08:00
Nick Pelly
3dd6c45853 Remove attemptDeadServiceRecovery() from TagTechnology's.
attemptDeadServiceRecovery() is a hack to recover from NfcService dying. It
should be a rare event, and is only needed in NfcAdapter which is a long-lived
object.

TagTechnology objects are transient, it is acceptable for them to go stale
when NFC service dies. Lets not complicate the code with recovery for a rare
event.

Change-Id: I101350e920b075c680eb4f250683f0a2bb878553
2011-01-10 18:14:41 +11:00
Nick Pelly
b4003bf73e Change Tag.getTechnology(NfcAdapter, int) to NfcAdapter.getTechnology(Tag, int)
The later feels less clumsy.

Change-Id: I50f29aef23d2993dcfd25f4c4f2cb0d77bdc0610
2011-01-10 17:28:03 +11:00
Kenny Root
6c4d904851 Add the {get,set}PackageObbPaths calls to API
Add getPackageObbPaths() and setPackageObbPaths() to the public API.

Bug: 3214719
Change-Id: Icb9f2f92f8c59bb3d31317f609854e81abbd1449
2011-01-09 13:20:28 -08:00
Chris Tate
6ec91731cb DO NOT MERGE : Permission fix: don't require BACKUP perm for self-restores
The public API is not supposed to require the BACKUP permission in order
for an application to restore its own last-known-good backup data.  However,
as currently implemented, BackupManager.requestRestore() [the public API
in question] depends on private Backup Manager methods that *do* enforce
that permission.  The net result is that the method cannot be successfully
used by third party applications: it will throw an exception if attempted.
This CL restructures the permission checking involved.

First, the underlying beginRestoreSession() operation can now be passed a
'null' transport name; if this is done, then the restore session is begun
on whatever the currently-active transport is.  Looking up the name of the
active transport is one of the permission-guarded actions that was required
with the initial implementation.

Second, a package name can now be passed to beginRestoreSession().  If
this is done, then the restore session can only be used to perform a
single-package restore of that one application.  The BACKUP permission is
not required if the caller is tying the restore to its own package name.

In combination, these changes permit BackupManager.requestRestore() to
function without the calling app needing to hold any special permission.
The no-permission case is intentionally quite narrow:  the caller must
hold the permission unless they both (a) pass 'null' for the transport
name, thereby accepting whatever the currently active transport is, and
(b) pass their own package name to restrict the restore session only
to their own app.

External bug http://code.google.com/p/android/issues/detail?id=10094
Internal bug 3197202

(Cherrypick from master to gingerbread)

Change-Id: Ie20b0bd2420345ce6eda178f854680b558f6372a
2011-01-09 12:49:47 -08:00
Dianne Hackborn
433863b108 Fix issue #3333958: Package Manager can sometimes mistakenly think...
...an app is disabled!

Ouch.

Change-Id: I5788c5f8edfe2a0d6f4f0f3359e1742f8ed8d98e
2011-01-09 11:46:27 -08:00
Gilles Debunne
9ffb0a0df3 Merge "Ran fixPngMetaTags on all the core/res assets." into gingerbread 2011-01-06 18:30:26 -08:00
Gilles Debunne
976647841c Merge "Asset cleanup. DO NOT MERGE" into gingerbread 2011-01-06 18:29:59 -08:00
Marco Nelissen
ba77a3f9cb Add support for the "compilation" tag in mp3, mp4 and ogg, and also add
support for two common ways of specifying album artist in ogg files.
b/3311831

Change-Id: Iba1152013b7577168af71f947d7249560419fa05
2011-01-06 15:05:06 -08:00
Nick Pelly
f54ad8daf6 Clean up transceive().
BasicTagTechnology.transceive(byte[] raw) should work for most child classes,
except those that want to disable (raw) transceive.

Current plan is not to add transceiveMifare() etc - use explicit methods
instead.

Add package scoped BasicTagTechnology.transceive(byte[] rata, boolean raw)
as a helper to remove code duplication.

Change-Id: Iaea161022751c99058d291e2ed0f8c475d1c7282
2011-01-07 09:21:23 +11:00
Eric Fischer
06d19ef0a0 Merge "Import translations for additional languages." into gingerbread 2011-01-06 14:11:47 -08:00
Jeff Hamilton
0aea183615 Merge "Make the new NFC APIs public." into gingerbread 2011-01-06 11:28:42 -08:00
Jeff Hamilton
be372d6462 Make the new NFC APIs public.
Change-Id: Ia0acd9759d67683eaf1dc199dc2cc55e16a98e77
2011-01-06 13:18:34 -06:00
Eric Fischer
43c8aa3144 Import translations for additional languages.
Change-Id: I8a30fc0f90e22a5ec8d746aaf4b64776a3274016
2011-01-06 10:29:06 -08:00
Dianne Hackborn
3ea5728e70 Tweak level at which we reset battery stats to 90%.
Change-Id: I81151809100912c7956536d5d47279d2c2fea8c4
2011-01-05 19:14:53 -08:00
Brad Fitzpatrick
69ea4e15e5 Documentation fixes found over vacation hacking.
Change-Id: I28900026465d66d950cf4f05f0c202b46c3c2d43
2011-01-05 13:07:34 -08:00
Martijn Coenen
a559aa4759 Fix technology extra naming for IsoDep and NfcB (API part).
Change-Id: Iaa8f1b4dec5d626ffb17a33d71d2f92dd0d99636
2011-01-05 13:30:15 +11:00
Nick Pelly
8f49c025ca Merge "Added response flags and DSFID extras for NfcV technology (API part)." into gingerbread 2011-01-03 22:38:14 -08:00
Martijn Coenen
7eb32a4427 Added response flags and DSFID extras for NfcV technology (API part).
Also fixed a missing assignment in NfcB technology.

Change-Id: Ic564a0a17a9638c11fa528056da40f74ed37e9e6
2011-01-04 17:37:29 +11:00
Nick Pelly
a743448a1b Merge "Tweak Ndef.getType() API. Rename constants, expand javadoc." into gingerbread 2011-01-03 22:32:56 -08:00
Nick Pelly
ddbb2c997b Tweak Ndef.getType() API. Rename constants, expand javadoc.
Change-Id: I9d2c83411411fea4ef46bb7c30ebdbcd9ee3e7d8
2011-01-04 17:31:48 +11:00
Nick Pelly
163bd40749 Merge "Added getType() to NDEF technology class (API part)." into gingerbread 2011-01-03 20:58:26 -08:00
Martijn Coenen
d27ebf1e69 Added getType() to NDEF technology class (API part).
Change-Id: Idfa391dd9d4a401e1daa3dc90ca57e4a3d9e0fa3
2011-01-04 15:57:39 +11:00
Nick Pelly
8c09ef91ae Merge "Removed selectAid() from IsoDep." into gingerbread 2011-01-03 20:09:03 -08:00
Martijn Coenen
912aa1cd70 Removed selectAid() from IsoDep.
It's a convenience method that can be implemented with transceive();
not really needed for now.

Change-Id: Idd855c85b15d97ae679d11d908834be3cb2741d8
2011-01-04 15:08:34 +11:00
Martijn Coenen
a42b352594 Added transfer/restore convience cmds to MF Classic tech.
Change-Id: I675993bc3aae6a741d63be458a0dfea240dd5316
2011-01-04 13:32:06 +11:00
Alon Albert
672ebb61a7 Merge "Improved ignore-backoff handling Allow a non-epidited ignore-backoff op to pass through an expidited backed off op." into gingerbread 2010-12-28 14:44:51 -08:00
Jeff Brown
c6f2b3b302 Merge "Fix policy issues when screen is off. (DO NOT MERGE)" into gingerbread 2010-12-23 12:41:59 -08:00
Dianne Hackborn
7becaeea7b Another stab at fixing issue #3149290 java.lang.RuntimeException:...
...Unable to pause activity
{com.android.settings/com.android.settings.applications.StorageUse}

Change-Id: Ibfa28a1c5af50dd150dfcafe71e905426d312643
2010-12-22 18:29:32 -08:00
Jeff Brown
eb9f7a01b0 Fix policy issues when screen is off. (DO NOT MERGE)
Rewrote interceptKeyBeforeQueueing to make the handling more systematic.
Behavior should be identical except:
- We never pass keys to applications when the screen is off and the keyguard
  is not showing (the proximity sensor turned off the screen).
  Previously we passed all non-wake keys through in this case which
  caused a bug on Crespo where the screen would come back on if a soft key
  was held at the time of power off because the resulting key up event
  would sneak in just before the keyguard was shown.  It would then be
  passed through to the dispatcher which would poke user activity and
  wake up the screen.
- We propagate the key flags when broadcasting media keys which
  ensures that recipients can tell when the key is canceled.
- We ignore endcall or power if canceled (shouldn't happen anyways).

Changed the input dispatcher to not poke user activity for canceled
events since they are synthetic and should not wake the device.

Changed the lock screen so that it does not poke the wake lock when the
grab handle is released.  This fixes a bug where the screen would come
back on immediately if the power went off while the user was holding
one of the grab handles because the sliding tab would receive an up
event after screen turned off and release the grab handles.

Bug: 3144874
Change-Id: Iebb91e10592b4ef2de4b1dd3a2e1e4254aacb697
2010-12-22 16:00:21 -08:00
Alon Albert
d41fe75f09 Improved ignore-backoff handling
Allow a non-epidited ignore-backoff op to pass through
an expidited backed off op.

To do this, I first refactored the complicated if statement:

            if (best == null
                    || ((bestSyncableIsUnknownAndNotARetry == syncableIsUnknownAndNotARetry)
                        ? (best.expedited == op.expedited
                           ? opRunTime < bestRunTime
                           : op.expedited)
                        : syncableIsUnknownAndNotARetry)) {
                best = op;
                bestSyncableIsUnknownAndNotARetry = syncableIsUnknownAndNotARetry;
                bestRunTime = opRunTime;
            }

Into a more readable:
            boolean setBest = false;
            if (best == null) {
                setBest = true;
            } else if (bestSyncableIsUnknownAndNotARetry == syncableIsUnknownAndNotARetry) {
                if (best.expedited == op.expedited) {
                    if (opRunTime < bestRunTime) {
                        //  if both have same level, earlier time wins
                        setBest = true;
                    }
                } else {
                    if (op.expedited) {
                        setBest = true;
                    }
                }
            } else {
                if (syncableIsUnknownAndNotARetry) {
                    setBest = true;
                }
            }
            if (setBest) {
                best = op;
                bestSyncableIsUnknownAndNotARetry = syncableIsUnknownAndNotARetry;
                bestRunTime = opRunTime;
            }

The refactoring was all done automatically with IntelliJ to avoid human error
in the conversion.

After verifying this code still behaved as expected including the error
condition in the bug, I added handling for the cases when a non-expidited op
may override an expedited op if certain conditions occur, specificaly, if the
expidited op is backed off and the non-expidited op is not.

Finally, refactored to make it testable and added tests and logging.

Bug: 3128963

Change-Id: I131cbcec6073ea5fe425f6b5aa88ca56c02b6598
2010-12-22 14:40:43 -08:00
Jeff Hamilton
3ce86481cb Remove canBeFormatted().
It's not easy to determine if this
is possible, so instead apps should
attempt a format and handle errors
in the format request.

Change-Id: I078a208b849e71ef3fb6b5970a9111ece4a2d201
2010-12-22 11:31:21 -06:00
Gilles Debunne
1cbb9a06c8 Ran fixPngMetaTags on all the core/res assets.
This removes the empty iTxt meta tags in png which are not supported by
Java 1.5. This script should be run every time the SDK is released.

Bug 3069421

Change-Id: I1610e52597937040f9da343046cd98aa075f728d
2010-12-21 16:46:21 -08:00