summaryrefslogtreecommitdiffstats
path: root/src/com/android/nfc/P2pEventManager.java
Commit message (Collapse)AuthorAgeFilesLines
* am abf67e1b: am 423cc45a: Merge "Fall back to NDEF push if handover SNEP get ↵Martijn Coenen2012-05-251-0/+10
|\ | | | | | | | | | | | | fails." into jb-dev * commit 'abf67e1baa0a4b313d9338e69261db47c33725be': Fall back to NDEF push if handover SNEP get fails.
| * Fall back to NDEF push if handover SNEP get fails.Martijn Coenen2012-05-251-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | This allows applications to be able to set both a Uri (for handover) and an NDEF message, which will only be sent if the handover request does not work (as will be the case on pre-J devices). Also, show a toast if the remote device does not support connection handover. Bug: 6561174 Change-Id: I9ffdcfdf0cded319fbb4ab646ae1da5382fcb74a
* | resolved conflicts for merge of c989f25d to masterJustin Koh2012-05-171-20/+33
|\ \ | |/ |/| | | Change-Id: I6d9df6e420cb4047f06848d4c0d94d30a6cc575a
| * Don't instantiate sendUi in Nfc if we are in appliance mode.Justin Koh2012-05-171-20/+33
| | | | | | | | | | | | | | | | | | | | | | Don't initiate sendUi in Nfc if we are in appliance mode. This saves 20MB of memory. Bug: 6470917 TESTED = runs on Tungsten. Change-Id: I41df65a67cd0f3af3e73469c1679d707c98cc3f8
| * Use the new "appliance" ui mode configuration to determine whether to show ↵Joe Onorato2011-12-141-1/+10
| | | | | | | | | | | | nfc confirmation ui. Change-Id: Iebad3ee6a40341b963ecf118f8d46f08b6478a25
* | Bluetooth Beam bug fixes, UX and i18n.Martijn Coenen2012-05-101-3/+3
| | | | | | | | | | | | | | | | | | | | - Implemented handover select with carrier power state - Delay OPP send if remote carrier is activating - I18n for all handover components - Cleanup old handover transfers Bug: 6411485 Change-Id: I84aac3a7c7e703a1fcb423b6016cd9fa3d33d9b1
* | Dejank Android Beam animation.Martijn Coenen2012-03-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After profiling, it turns out the Beam animation was mostly janky because of the initial buffer allocations that take place in the graphics driver. Modified both the animation and firefly renderers to swap the buffers three times before drawing anything, thereby making sure the buffers are allocated. Do not scale the screenshot while rendering fireflies, as that can cause jank as well. Also modified the FireflyRenderer to keep most of its state alive between subsequent Beams, causing it to come up faster. Cleaned up some old code and added documentation. Change-Id: Ica231861dd7ede178ad2ec1ab09aa00d1c876624
* | Use the new "appliance" ui mode configuration to determine whether to show ↵Joe Onorato2012-02-111-1/+10
| | | | | | | | | | | | nfc confirmation ui. Change-Id: I7ad5d6ad684c6079b9d48ef28b9d77edf8abdf0c
* | NfcService: some trivial cleanups.mike wakerly2011-12-121-3/+0
|/ | | | | | | | | | | | I noticed these while looking at something else. - Removes unused imports; unthrown exceptions on some non-visible methods; dead code. - Tags a few stray interface implementations that lacked @Override. - Removes unnecessary semicolons in a few place. - Fixes one instance of ArrayList being used as a raw type. Change-Id: I860921a3a4d003fd6d6fc1381c0813599f3caf26
* Replace vendor specific NfcGoogle.apk with generic Nfc.apkNick Pelly2011-11-211-2/+0
| | | | | | | | | | | | | | The access control changes allow us to just use Nfc.apk with the regular platform certificate, instead of the custom signed NfcGoogle.apk. So we can compeltely get rid of vendor/google/apps/NfcGoogle and just build it out of packages/apps/Nfc now. The package name is also reverted from com.android.nfc3 to com.android.nfc The NFC uid needs to get bumped (25 to 27) to allow the cert change. Bug: 5608249 Change-Id: I4437dff96f2529f0b9e7d8e65c21359c3eeccd0b
* Optimize soundpool use.Martijn Coenen2011-11-111-18/+7
| | | | | | | Share a single soundpool and release it when NFC is disabled. Bug: 5590478 Change-Id: I858c9520bf6880e7d7c5920c12966d86108dd125
* Don't finish Beam animation again.Martijn Coenen2011-11-031-1/+3
| | | | | Bug: 5553836 Change-Id: I1bfd7e0aa3a1420decea7d793e851f44cb433cf2
* Show NFC call-to-action text immediately.Nick Pelly2011-09-211-53/+2
| | | | | | | | | Pull out all the code the track success/failure for the hint. Doing this as a standalone commit so we can easily revert if we want it back. Bug: 5350022 Change-Id: Ieb70af10ebaabdf82421c128d72ed1fc374130d2
* Remove first-share notification.Martijn Coenen2011-09-151-36/+0
| | | | | Bug: 5296866 Change-Id: I90ccb7127b61aa2242fdb5252cdacccc049d5081
* Move receive animation back to scale up.Martijn Coenen2011-09-021-1/+8
| | | | Change-Id: I00382a2cd085aa4c65eba33e9eab51c57882b838
* Latest zeroclick animations.Martijn Coenen2011-09-011-5/+4
| | | | | | | | | | | | | - Only hw-accelerate when we have the resources for it; - Disallow status bar interaction; - Remove background; - On failure, gradually scale back up; - On receive, slide out to the right. TODO: - OpenGL fireflies Change-Id: I1deae65f24f40a226c8a575130ca22b72ff9e05e
* Touch to send hint for NdefPush.Martijn Coenen2011-08-241-8/+62
| | | | | | | | | Show hint when: - First time sharing (until successful again). - 3 share failures (until successful again). - 3 seconds in p2p range and no confirmation (fade in). Change-Id: I413d45b76ee8588d4aa99351e34212ecc38d8f8e
* NdefPush animations.Martijn Coenen2011-08-241-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | - Sound + vibration whenever devices enter range. - Rebuilt old send animation - clone off in the background. - Scale back up for receive, then call startActivity(). - Slowed down animations - Split sending in two parts: first part is slow and played during the actual send. When the send is done, the animation is accelerated and finished. This has as an advantage that there is an immediate response to the touch (instead of waiting till the send is done). - Lock rotation. TODO: - Integrate firefly background. - Touch to send hint. - Tweak debounce time - somehow it still happens a lot that the link is tore down, the debounce comes in, and the link comes back up again just after 750ms, causing flapping anyway. - After a lot of tapping things seem to become very slow; I'm not sure yet if this is due to NFC or other ICS code. - See if we can really do without TYPE_SYSTEM_OVERLAY window params. Change-Id: I93d472ed566b8201b65e9eee049467995f66e683
* First cut at reverting to tap-to-share.Nick Pelly2011-08-181-95/+4
| | | | | | | A lot more polish to go, but this gest the basic tap-to-share behavior working again. Change-Id: Ic1f1df4200c9a1424018df7602fe5cb278cdc1e6
* Initialize LPF with first value, so that we have a betterNick Pelly2011-08-181-17/+19
| | | | | | chance of immediately triggering after 10 samples Change-Id: I7884204c7e3aeaf6191f5bb05f60153f07b800c7
* Latest ShareTap UI: low-pass filter and animations.Martijn Coenen2011-08-181-9/+24
| | | | Change-Id: If0c04284e1e6f1126f85a8bb58014ce553f4e52b
* 0-click UI updateNick Pelly2011-08-171-98/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o New start sound o Vibrate only when - starting send - send success - receive success o Play sound only when - starting send - send success - send failure (out of range before complete) - receive success o Introduce HoldingItWrongUi with the new image o P2pAnimationActivity -> SendUi, and a huge cleanup of it - no longer an activity. It took 350ms to inflate the views on first onCreate() as an activity, but we can cache this ahead of time as a window. - Use ObjectAnimator instead of ViewAnimator, much less code o Use ACCELEROMETER instead of GRAVITY to get faster tilt detection. TODO (in order of priority) o LLCP has started crashing a lot again. About 1/10 times I come into P2P range the stack crashes now on my Nexus S TMO. At first I thought it was because I was doing animations during LLCP send, which might affect timing to pn544 due to CPU load. So I changed my first implementation (one animation) to split it into a pre-send and post-send, so we don't do any work during the actual send. Still seems to crash though. We really need to make it solid again. o Change notification text and settings text+image as per Rachel's email o Do some simple low-pass filter on ACCELEROMETER so we don't get caught out when the user shakes the phone o Plumb through a starting receive callback, and play sound + vibrate o Prevent touch during send animations. Not a big deal right now because we complete it so fast. o Prevent notification shade from being pulled during HoldingItWrongUi and SendUi o Prevent orientation change during SendUi Change-Id: Ieec1efb741244c68270e34a712c15c58621b1446
* Prevent rotation in animation activity.Martijn Coenen2011-08-151-1/+1
| | | | | | | | | Turns out setting configChanges="orientation" does not actually prevent the orientation change - it just prevents the activity from being restarted with a new intent. Restored old code for locking orientation. Change-Id: I136888f6424d3caf5081dd0a55087e263ccc88e4
* Implement Tap-to-Share and Tilt-to-Share (DropShare).Nick Pelly2011-08-121-59/+96
| | | | | | | | | | | | | | | | | | | o Text says "Tap to Share", but tilting (the phone on top sends) also works. o Move text to top. Remove arrows. o First Accelerometer value takes ~700ms :( o Only call onP2pSendComplete on success. If the send failed, we retry quietly. This improves perceived reliability. o Reduce debounce from 1000ms to 750ms. TODO o Never do orientation change while in the animation activity o Get rid of black transition when entering/leaivng activity o Figure out why it takes 700ms to get first accelerometer value o Improve launch time of animation activity (sometimes it takes 3+ seconds) o Consider going back to a window overlay? o Make it snappy snappy snappy Change-Id: Idbc8e4bb744051b7b69d234a51a3ce69e23b699f
* Latest UX animations and cleanup of P2pAnimationActivity.Martijn Coenen2011-08-111-0/+2
| | | | Change-Id: Ib24ea71f46087b6415204b222213fc9c8348f5fb
* Decouple P2P link management from P2P UX management.Nick Pelly2011-08-101-0/+218
The goal is to make it easier to track the state of the P2P transfer, and to make it easier to fine-tune UX (sound, vibration, animation) for P2P transfer. NdefP2pManager -> P2pLinkManager It now only handles LLCP and NDEF logic (and no UX). It has a state machine to track the state of the LLCP link, send and receive. It does debouncing on the LLCP link. Events are surfaced to P2pEventManager through the P2pEventListener interface. P2pEventManager Handles all UX (sound, vibration, animation) and send confirmation. The current implementation uses Rotation to confirm send, and P2pAnimationActivity to animate the send. Change-Id: Ie498219857afe69403e90f09c77f4d6d1b24ffeb