9644 Commits

Author SHA1 Message Date
Dianne Hackborn
29c99aaaae Merge "Added check to make orientation calculations more robust" into gingerbread 2011-01-14 15:36:26 -08:00
Niclas Kellgren
a1454becb9 Added check to make orientation calculations more robust
Added check avoid a division by zero resulting in NaN which in turn
makes checkFullyTilted to ignore high tilt angles from then on.
If (x, y, z) == (0, 0, 0) then there is no tilt or rotation and
this vector must be ignored. This check is extended to ignore all
small acceleration values where noise can be of big influence.

Low or zero readings can happen when space travelling free falling,
but more commonly when shaking or getting bad readings from the sensor.
The accelerometer is turned off when not used and polling it too soon
after it is turned on may result in (0, 0, 0).

Change-Id: I19aec653abb8ab6f7126778035c8c96449f1326f
2011-01-14 11:14:03 -08:00
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
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
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
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
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
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
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
Dianne Hackborn
5261cea2e0 Merge "Fix issue #3224616: TimeUtils.formatDuration() can drop 0s." into gingerbread 2010-12-21 13:27:15 -08:00
Bjorn Bringert
f5f7510486 Fix issue #3224616: TimeUtils.formatDuration() can drop 0s.
Integrated from master.

Change-Id: Ie12dd25cce03c06fafb7df1335266322df43b038
2010-12-20 15:23:02 -08:00
Mike LeBeau
52af3a4f9a Unhide RecognizerResultsIntent. This API was
reviewed for Froyo, but we didn't want to make it
public then because it wasn't until our first
Market release of Voice Search that the APIs would
be in use by our app.

http://b/3135351

Change-Id: I49053717cac08e3976c22e3a105139b6755aadb8
2010-12-20 10:50:31 -05:00
Martijn Coenen
ab82a5b9a8 Clean up and polish Mifare Classic tech.
- It's useful to have accessors at block level, so apps don't really have to know
  about the sector structure (and how many blocks there are in a sector).
- There's no way to tell whether a read/write/ didn't work because of auth
  failure. The documentation should be changed to make this point clear.
- Added increment/decrement commands, for atomic increment/decrement of value blocks.

Change-Id: I590feacbcd1443f1be7a86ab046a5b1f33e2e04c
2010-12-17 13:20:32 -08:00
Martijn Coenen
01d159aa2c Need to check ndef before writing ndef.
Regression due to all the (re)connect changes.

Change-Id: I637618f63518965e893a5a59db61002271666fa4
2010-12-16 16:34:56 -08:00
Martijn Coenen
c58c3f1ae2 Implement additional Mifare Ultralight convenience methods.
Change-Id: I8d9dfadb5911b2d11d1ba6dcf1381decbb8386ef
2010-12-15 16:41:38 -06:00
Martijn Coenen
0d27f999f4 Expose reconnect(), to allow applications to reset tag state.
Change-Id: Ib5432e7f6b6aaf6ec1cb06693592cb7c6440a6f8
2010-12-15 16:41:38 -06:00
Martijn Coenen
4049f9d00a Implement multi-tech connect, enfore tech exclusivity.
- The NfcService now allows for connecting to a specific technology;
- The "active" parts of technology classes may not be used at the same time.

Change-Id: Ibb569f51cc6da4f3e24df9d0850c6f49a022b0c2
2010-12-15 16:41:38 -06:00
Dianne Hackborn
99441c45e4 Fix issue #3149290: java.lang.RuntimeException: Unable to pause activity
{com.android.settings/com.android.settings.applications.StorageUse}

AbsListView could call mAdapter.getItemId() if a save state happened
after the data changed but before a layout occurred.

Change-Id: Ica020971dc458dff79b56dd810733e217f4f7da6
2010-12-15 11:02:55 -08:00
Costin Manolache
a848d34450 Merge "Fix bug in permission grant system." into gingerbread 2010-12-14 10:07:26 -08:00
Brad Fitzpatrick
0927c90265 Merge "Fix StrictMode javadoc copy/paste error." into gingerbread 2010-12-13 15:25:09 -08:00