11854 Commits

Author SHA1 Message Date
Nick Pelly
4a5e253220 Clean up MifareUltralight API.
o Some javadoc updates
o writeBlock -> writePages  (Block means something else in NFC Forum).
o validate page offset

Change-Id: Icae54db3397d57aaa451caaa86d56e8ba82507f2
2011-01-27 12:22:56 -08:00
Dianne Hackborn
f5e4f208b9 Make CHANGE_COMPONENT_ENABLED_STATE a signatureOrSystem perm.
Change-Id: I53a6671d5478e7dbca44b17d90f1edfa8e3420bc
2011-01-26 12:40:18 -08:00
Kenny Root
138757db4f Merge "Make OBB results a one-way call" into gingerbread 2011-01-26 09:17:28 -08:00
Kenny Root
b7db2726e9 Make OBB results a one-way call
OBB result back to an application needs to be a one-way binder call.

Bug: 3353699
Change-Id: I0e625914d18a001c2fa9d764ea6463f34cf96743
2011-01-25 17:29:59 -08:00
Jeff Hamilton
f126ad3b64 Merge "Use classnames instead of ints for NFC techs." into gingerbread 2011-01-25 14:35:46 -08:00
Jeff Hamilton
d88e9aa575 Use classnames instead of ints for NFC techs.
This makes the system more flexible and allows
adding new technology types without having to
update the API.

Change-Id: Iaee6b633965e501a70e8afc3f1d54d9d94a4d05a
2011-01-25 16:32:26 -06:00
Nick Pelly
b134223f91 Make Mifare Classic increment/decrement operands little endian
Also make sure they are non-negative.

This is not documented in Mifare Classic spec, but based on findings from NXP:
- Operand should be stored in little-endian format in the transceive buffer
- Tag ignores the sign bit on the operand, its effectively 31-bit unsigned
- Overflow and underflow generates an error.

Change-Id: Id3389b3894ded732c4b00d564ca53f5df651359e
2011-01-25 07:45:07 -08:00
Justin Ho
28c4f69a93 Updated checkbox assets
Change-Id: I93c979816bc3310c510bf8942c273ce8c411150d
2011-01-24 13:05:06 -08:00
Arnaud Ferir
5e81a6e21e Fix trace mismatch.
Change-Id: Ie6e9a2baef63d2b5621593203742c2ffeaafc4ba
2011-01-24 12:15:21 -06:00
Sylvain Fonteneau
c5a418ecb7 Handle mock tags in android.nfc.Tag conversion to Parcel.
When generating a mock tag (after a NDEF exchange over LLCP), one of
the internal fields is set to null. This was causing NullPointerException
when being converted to a Parcel.

This is fixed by not including this field in the Parcel for mock tags.

Change-Id: I000e2faa54d71fd755ba7993e1e258743aad98fb
2011-01-24 12:15:13 -06:00
Nick Pelly
c896d85c15 Merge "Add operands to mifare classic increment, decrement." into gingerbread 2011-01-23 22:12:25 -08:00
Nick Pelly
1e233af3a7 Add operands to mifare classic increment, decrement.
Change-Id: Ib35f615142bda48a5e33888a09ebae2880624788
2011-01-23 22:11:44 -08:00
Nick Pelly
da01b4abb8 Merge "Make MifareClassic methods more consistent." into gingerbread 2011-01-23 21:36:14 -08:00
Nick Pelly
e45083b11b Make MifareClassic methods more consistent.
Remove method overloading for combinations of sector+block addressing.
Instead provide methods that more closly match the raw commands, and more
efficient helpers to convert between blocks and sectors.

o fix off-by-one bug in getBlockCountInSector()
o add BLOCK_SIZE
o remove DESFIRE not operating in classic emulation (SAK 0x20)
o hide isEmulated(), there is no use case, and the info is available elsewhere
o getTotalBlockCount() -> getBlockCount()
o getBlockCount(int) -> getBlockCountInSector(int)
o introduce blockToSector() and sectorToBlock()
o remove authenticateBlock()
    make it really clear that authentication is per sector, and reduce function
    explosion. blockToSector() allows you to use authenticateSector...
o explicit authenticateSectorWithKeyA() / authenticateSectorWithKeyB()
    get rid of magic boolean
o remove all (int sector, int block) parameters
    always address by absolute block. this makes the API crystal clear, and
    helps reduce function explosion
o validation of all sector and block indices
o dont & 0xff when converting to byte - its redundant
o Remove TYPE_OTHER. Mifare Classic types are well-known and stable.

Change-Id: I3c9f8254ff307f31b388b3d7592c862d5de6afa5
2011-01-23 21:32:57 -08:00
Jeff Hamilton
e1e70c5761 Merge "Allow null filters for foreground dispatch to act as catch all." into gingerbread 2011-01-23 19:17:22 -08:00
Jim Miller
42a461570b Fix 3379239: Catch exceptions from workaround for OOM.
This catches possible exceptions caused by attempting to
unregister a receiver that may have already been unregistered.
This is related to the OOM issue workaround in Change I99a7e0c3.

Change-Id: Ib69a8acc6b12659125c958a03efac0a8a68a3859
2011-01-23 13:40:31 -08:00
Jeff Hamilton
9f20cd7ff2 Allow null filters for foreground dispatch to act as catch all.
Change-Id: Idf3d2e344a6e87035ccb5b533ed9e81fec596132
2011-01-23 12:15:28 -06:00
Jaikumar Ganesh
1c9761e30d Merge "Do Not Merge Connect other profiles when priority is auto connect." into gingerbread 2011-01-21 21:25:01 -08:00
Jaikumar Ganesh
40e6c210f8 Do Not Merge Connect other profiles when priority is auto connect.
ACL auto connection was removed so other profiles
won't auto connect when priority was auto connect.

Reduced connect other profiles time delay.

Bug: 3281016
Change-Id: Ic56ca6e95f618f02bc316d1f80014e58c4b6c3bc
2011-01-21 19:05:54 -08:00
John Reck
398a589cce Merge "DO NOT MERGE - Create db path if it doesn't exit" into gingerbread 2011-01-21 14:03:30 -08:00
John Reck
bf8af78973 DO NOT MERGE - Create db path if it doesn't exit
Bug: 3241808
 Make sure the directory the caller is trying to open the icon db
 in actually exists and create it if it doesn't.

Change-Id: Icc0a67b0ceba03a746ac2cd3b84fc34c2c8b4fe2
2011-01-21 11:42:15 -08:00
Jeff Hamilton
dc54a8c742 Merge "API changes for NFC." into gingerbread 2011-01-21 11:34:20 -08:00
Jeff Hamilton
4e21e1d21a API changes for NFC.
Bug: 3366009
Change-Id: Ia28e03e1501421906b640b78d4c9a59a20e9c668
2011-01-21 13:32:58 -06:00
Jean-Michel Trivi
a314f32ba9 Merge "Bug 3365937 notify TTS initialization listener of binding errors" into gingerbread 2011-01-21 09:09:30 -08:00
Jean-Michel Trivi
1e13a02320 Bug 3365937 notify TTS initialization listener of binding errors
The creation of a TextToSpeech object causes the TTS service to
 start, and the initialization listener to be called when the
 service is connected. But the listener is never called when
 the service binding failed to be notified of this error.
The fix consists in checking the result of the bind to service
 operation, and notify the listener in case of an error.

More log was added in case speak() and synthesizeToFile() are
 called but the service is not known to have started.

Change-Id: I7dcc1fa44be31fee3177ec6215fca3306377b934
2011-01-20 17:25:48 -08:00
Dianne Hackborn
11576102a9 Fix issue #3373438: Update GBMR versions
Change-Id: Ic4b4f1b0534fd2fbd6322eae01a4cb9d5a67cc6f
2011-01-20 12:16:43 -08:00
Jeff Brown
d0725eef67 Merge "Never drag scroll views with no children. (DO NOT MERGE)" into gingerbread 2011-01-19 17:03:03 -08:00
Jeff Brown
39bc6197ba Never drag scroll views with no children. (DO NOT MERGE)
Fixes a regression from Froyo.  Previously, when a scroll view
had no children, its onTouchEvent would return because the scroll
view would only start dragging if the user touched one of its children.
In Gingerbread, the user can drag from anywhere within the scroll
view, not just by touching a child.  However, it makes no sense
to drag a scroll view that has no children so an empty scroll view
should just ignore touches like any other empty view group would.

This change fixes applications that for some reason or other happen
to have empty scroll views in strange places.

Bug: 3246230
Change-Id: I76c6136d3cd74968983033014d60deec1718ce30
2011-01-19 11:20:46 -08:00
Nick Pelly
0316d4a24f Change signature of MifareClassic.authenticate*() to throw IOException.
Update API for this and the previous commit.

Change-Id: I19275a5d00081bd0f00afea59a2b673344a32954
2011-01-18 18:52:37 -08:00
Martijn Coenen
bf34061bb4 Support for TagLostException (API).
Change-Id: Idf2c3253f7bc5f371133c4f18bfc2afde69c3010
2011-01-18 18:32:50 -08:00
Nick Pelly
a8ca533d34 Fix javadoc which broke build.
Change-Id: Ie3cac9bec04e80defae44ba02086ad0cdfd301a9
2011-01-18 17:07:05 -08:00
Nick Pelly
e4dd154c08 Merge "hange the default IsoDep timeout to 300ms (docs update)." into gingerbread 2011-01-18 16:11:14 -08:00
Mathias Agopian
12d014fdf4 Merge "fix [3355413] Gyro calls onAccuracyChanged and reports accuracy as UNRELIABLE" into gingerbread 2011-01-18 16:10:08 -08:00
Martijn Coenen
cbec3fb285 hange the default IsoDep timeout to 300ms (docs update).
Change-Id: I4fe5a6bf9fd42a28c9619e6e0bf11885bcc43f91
2011-01-18 15:35:14 -08:00
Jeff Brown
41395459e6 Merge "Filter virtual keys after touches. (DO NOT MERGE)" into gingerbread 2011-01-18 14:31:31 -08:00
Martijn Coenen
07e6f616d1 Check NDEF before calling makeReadOnly().
Change-Id: Iadbaf5c29821eff78ad487b248af529febcdc4ce
2011-01-18 11:35:46 -08:00
Martijn Coenen
a701cf85a0 Implement IsoDep timeout handling (API).
Added a method for setting the timeout on IsoDep transactions.

Change-Id: Ie627e7a826556e46295fefe69b9be83ebf911d93
2011-01-18 11:35:46 -08:00
Jeff Hamilton
0716ea144d Merge "Javadoc updates for NFC." into gingerbread 2011-01-18 11:01:55 -08:00
Jeff Hamilton
3a223404e7 Merge "New APIs for NDEF Push Protocol." into gingerbread 2011-01-18 11:01:05 -08:00
Jeff Hamilton
ce3224cda5 Javadoc updates for NFC.
Change-Id: Ibd91829979576297599fbcc9eb8054924af1d527
2011-01-18 10:57:30 -08:00
Kenny Root
34d2b41e48 Revert "Add the {get,set}PackageObbPaths calls to API"
This reverts commit 6c4d904851772313930f800ac7c323cf90c709bb.

Going with a different tactic that doesn't dump stuff on
PackageManagerService.

Bug: 3214719
Change-Id: I0bbeccf3c21d264deda4256eb53713d2c98284f4
2011-01-17 11:49:22 -08:00
Jeff Hamilton
33ff240558 New APIs for NDEF Push Protocol.
The NPP is only usable by the foregorund
activity to prevent dispatching confusion
on the far end.

Change-Id: I08475a52083fd7f81b79b7fe2faf4e126121a809
2011-01-17 08:07:24 -08:00
Mathias Agopian
c2b4e21320 fix [3355413] Gyro calls onAccuracyChanged and reports accuracy as UNRELIABLE
- make sure to call onAccuracyChanged only when it actually changes
- only call onAccuracyChanged on Magnetic and Orientation sensors, which
  are the only ones to support it.
- for other sensors, call onAccuracyChanged only once with the
  SENSOR_STATUS_ACCURACY_HIGH value

Change-Id: Ic861e3d48d3b98dab74ffebe2746576f5b69f371
2011-01-16 19:11:20 -08:00
Jim Miller
6687ecb447 Merge "Fix 3106227: use WeakReferences for receivers in DigitalClock class" into gingerbread 2011-01-16 16:14:52 -08:00
Nick Pelly
b73203ab7e Merge "Make sure service handles are live before passing to other objects." into gingerbread 2011-01-14 18:18:25 -08:00
Jim Miller
8b886fab54 Fix 3106227: use WeakReferences for receivers in DigitalClock class
This works around a bug in the framework where LockScreen wouldn't
get GC'd under certain circumstances which would lead to an OOM
crash.  It now uses WeakReferences for observers inside the
DigitalClock container class and unregisters them if the containing
DigitalClock goes away.

Also removed mLive variable which was unused and could potentially
leak the receivers.

Left mAttached for debugging so we can use it to determine if the
calls to onAttachToWindow() and onDetachFromWindow() are grossly
unbalanced which may be the root cause of the original problem.

Have cleanUp() explicitly clear unused references to make
tracing through hprof references easier.

Change-Id: I99a7e0c356001b05eab5aa729564553666febfea
2011-01-14 18:01:12 -08:00
Jaikumar Ganesh
a788a94309 Merge "Do Not Merge: Expose insecure rfcomm Bluetooth API." into gingerbread 2011-01-14 16:11:41 -08:00
Dianne Hackborn
29c99aaaae Merge "Added check to make orientation calculations more robust" into gingerbread 2011-01-14 15:36:26 -08:00
Jaikumar Ganesh
a3363ef2cd Do Not Merge: Expose insecure rfcomm Bluetooth API.
This complements the secure rfcomm API.
The link key is unauthenticated and is subject to MITM attacks.
The link key may be encrypted depending on the type of Bluetooth device.
This helps apps which don't need the extra security or
have their own security layer built on top of the rfcomm link.

Bug: 3352266

Change-Id: I633fd0372e5e23288d6fec950dd1abc2896031f1
2011-01-14 13:24:03 -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