diff options
author | Danesh M <daneshm90@gmail.com> | 2014-05-21 21:55:18 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2014-05-21 21:55:18 +0000 |
commit | 4406abb7d274ce7ac57c5873dd5094788bc04ee1 (patch) | |
tree | b2f94404e2ee5dee3751a22deed6a09835d713de | |
parent | acbb21d0ee2afd367d9eac78fe8190f1504de60e (diff) | |
parent | de5ae6cd1a4640f8f8769a0ed4ea5048d3017ac5 (diff) | |
download | android_packages_apps_Nfc-4406abb7d274ce7ac57c5873dd5094788bc04ee1.tar.gz android_packages_apps_Nfc-4406abb7d274ce7ac57c5873dd5094788bc04ee1.tar.bz2 android_packages_apps_Nfc-4406abb7d274ce7ac57c5873dd5094788bc04ee1.zip |
Merge "Nfc : Switch to notification sound" into cm-11.0
-rw-r--r-- | src/com/android/nfc/handover/HandoverService.java | 13 | ||||
-rw-r--r-- | src/com/android/nfc/handover/HandoverTransfer.java | 3 |
2 files changed, 4 insertions, 12 deletions
diff --git a/src/com/android/nfc/handover/HandoverService.java b/src/com/android/nfc/handover/HandoverService.java index 35a49fae..7f986944 100644 --- a/src/com/android/nfc/handover/HandoverService.java +++ b/src/com/android/nfc/handover/HandoverService.java @@ -23,8 +23,6 @@ import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; -import android.media.AudioManager; -import android.media.SoundPool; import android.net.Uri; import android.os.Bundle; import android.os.Handler; @@ -120,7 +118,6 @@ public class HandoverService extends Service implements HandoverTransfer.Callbac final HashMap<Pair<String, Boolean>, HandoverTransfer> mTransfers; final Messenger mMessenger; - SoundPool mSoundPool; int mSuccessSound; BluetoothAdapter mBluetoothAdapter; @@ -144,9 +141,6 @@ public class HandoverService extends Service implements HandoverTransfer.Callbac public void onCreate() { super.onCreate(); - mSoundPool = new SoundPool(1, AudioManager.STREAM_NOTIFICATION, 0); - mSuccessSound = mSoundPool.load(this, R.raw.end, 1); - IntentFilter filter = new IntentFilter(ACTION_BT_OPP_TRANSFER_DONE); filter.addAction(ACTION_BT_OPP_TRANSFER_PROGRESS); filter.addAction(ACTION_CANCEL_HANDOVER_TRANSFER); @@ -158,9 +152,6 @@ public class HandoverService extends Service implements HandoverTransfer.Callbac @Override public void onDestroy() { super.onDestroy(); - if (mSoundPool != null) { - mSoundPool.release(); - } unregisterReceiver(mReceiver); } @@ -435,9 +426,7 @@ public class HandoverService extends Service implements HandoverTransfer.Callbac notifyClientTransferComplete(transfer.getTransferId()); // Play success sound - if (success) { - mSoundPool.play(mSuccessSound, 1.0f, 1.0f, 0, 0, 1.0f); - } else { + if (!success) { if (DBG) Log.d(TAG, "Transfer failed, final state: " + Integer.toString(transfer.mState)); } diff --git a/src/com/android/nfc/handover/HandoverTransfer.java b/src/com/android/nfc/handover/HandoverTransfer.java index c2f2ad5d..6e7221f4 100644 --- a/src/com/android/nfc/handover/HandoverTransfer.java +++ b/src/com/android/nfc/handover/HandoverTransfer.java @@ -260,6 +260,9 @@ public class HandoverTransfer implements Handler.Callback, android.R.drawable.stat_sys_upload_done); notBuilder.setTicker(mContext.getString(R.string.beam_complete)); notBuilder.setContentTitle(mContext.getString(R.string.beam_complete)); + Uri uri = Uri.parse("android.resource://" + mContext.getPackageName() + + "/" + R.raw.end); + notBuilder.setSound(uri); if (mIncoming) { notBuilder.setContentText(mContext.getString(R.string.beam_touch_to_view)); |