diff options
-rwxr-xr-x | res/values/strings.xml | 6 | ||||
-rw-r--r-- | src/com/android/nfc/P2pEventManager.java | 36 |
2 files changed, 0 insertions, 42 deletions
diff --git a/res/values/strings.xml b/res/values/strings.xml index ac610af..3abe1de 100755 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -21,12 +21,6 @@ <!-- A notification action string prompting the user to share their contact details over NFC [CHAR-LIMIT=64] --> <string name="outbound_me_profile_text">Tap to give this person your contact info</string> - <!-- A notification description string telling the user he has shared something over NFC [CHAR-LIMIT=64] --> - <string name="first_share_title">You just dropped to share!</string> - - <!-- A notification action string telling the user to tap to learn more about sharing over NFC [CHAR-LIMIT=64] --> - <string name="first_share_text">Tap to learn more or disable this feature.</string> - <!-- Content description of the NFC enabled notification icon for accessibility (not shown on the screen). [CHAR LIMIT=NONE] --> <string name="accessibility_nfc_enabled">NFC enabled.</string> <string name="touch">Touch to send</string> diff --git a/src/com/android/nfc/P2pEventManager.java b/src/com/android/nfc/P2pEventManager.java index a18c7e6..9a293a1 100644 --- a/src/com/android/nfc/P2pEventManager.java +++ b/src/com/android/nfc/P2pEventManager.java @@ -16,18 +16,14 @@ package com.android.nfc; -import android.app.Notification; import android.app.NotificationManager; -import android.app.PendingIntent; import android.content.Context; -import android.content.Intent; import android.content.SharedPreferences; import android.media.AudioManager; import android.media.SoundPool; import android.os.Handler; import android.os.Message; import android.os.Vibrator; -import android.provider.Settings; import com.android.nfc3.R; /** @@ -41,9 +37,7 @@ public class P2pEventManager implements P2pEventListener, SendUi.Callback, Handl static final int MSG_HINT_TIMEOUT = 0; static final int NUM_FAILURES_UNTIL_HINT = 3; // How many failures before showing hint - static final String PREF_FIRST_SHARE = "first_share"; static final String PREF_SHOW_HINT = "show_hint"; - static final int NOTIFICATION_FIRST_SHARE = 0; static final long[] VIBRATION_PATTERN = {0, 100, 10000}; @@ -60,7 +54,6 @@ public class P2pEventManager implements P2pEventListener, SendUi.Callback, Handl final Handler mHandler; // only used on UI thread - boolean mPrefsFirstShare; boolean mSending; boolean mPrefsShowHint; // Show a hint until the user gets it right int mNothingSharedCount; // Amount of times device entered range but didn't share @@ -79,12 +72,6 @@ public class P2pEventManager implements P2pEventListener, SendUi.Callback, Handl Context.NOTIFICATION_SERVICE); mPrefs = mContext.getSharedPreferences(NfcService.PREF, Context.MODE_PRIVATE); - if (mPrefs.getBoolean(PREF_FIRST_SHARE, true)) { - mPrefsFirstShare = true; - } else { - mPrefsFirstShare = false; - } - if (mPrefs.getBoolean(PREF_SHOW_HINT, true)) { mPrefsShowHint = true; } else { @@ -118,7 +105,6 @@ public class P2pEventManager implements P2pEventListener, SendUi.Callback, Handl @Override public void onP2pSendComplete() { - checkFirstShare(); playSound(mEndSound); mVibrator.vibrate(VIBRATION_PATTERN, -1); mSendUi.showPostSend(); @@ -178,28 +164,6 @@ public class P2pEventManager implements P2pEventListener, SendUi.Callback, Handl editor.apply(); } - /** If first time, display a notification */ - void checkFirstShare() { - if (mPrefsFirstShare) { - mPrefsFirstShare = false; - SharedPreferences.Editor editor = mPrefs.edit(); - editor.putBoolean(PREF_FIRST_SHARE, false); - editor.apply(); - - Intent intent = new Intent(Settings.ACTION_NFCSHARING_SETTINGS); - PendingIntent pi = PendingIntent.getActivity(mContext, 0, intent, - PendingIntent.FLAG_UPDATE_CURRENT); - Notification notification = new Notification.Builder(mContext) - .setContentTitle(mContext.getString(R.string.first_share_title)) - .setContentText(mContext.getString(R.string.first_share_text)) - .setContentIntent(pi) - .setSmallIcon(R.drawable.stat_sys_nfc) - .setAutoCancel(true) - .getNotification(); - mNotificationManager.notify(NOTIFICATION_FIRST_SHARE, notification); - } - } - void playSound(int sound) { mSoundPool.play(sound, 1.0f, 1.0f, 0, 0, 1.0f); } |