summaryrefslogtreecommitdiffstats
path: root/src/com/android/nfc
diff options
context:
space:
mode:
authorJoe Onorato <joeo@google.com>2011-12-14 20:58:28 -0800
committerMike Lockwood <lockwood@google.com>2012-02-11 10:45:35 -0800
commitbd0b6c38ba56bf787a3903f258776b185fdd7daa (patch)
treec3144cedfc17bdf1a921ee2e770ce177413471cd /src/com/android/nfc
parentfb42b9f2d905015730f2e12772ed9a2a610a3957 (diff)
downloadpackages_apps_nfc-bd0b6c38ba56bf787a3903f258776b185fdd7daa.zip
packages_apps_nfc-bd0b6c38ba56bf787a3903f258776b185fdd7daa.tar.gz
packages_apps_nfc-bd0b6c38ba56bf787a3903f258776b185fdd7daa.tar.bz2
Use the new "appliance" ui mode configuration to determine whether to show nfc confirmation ui.
Change-Id: I7ad5d6ad684c6079b9d48ef28b9d77edf8abdf0c
Diffstat (limited to 'src/com/android/nfc')
-rw-r--r--src/com/android/nfc/P2pEventManager.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/com/android/nfc/P2pEventManager.java b/src/com/android/nfc/P2pEventManager.java
index e7377f2..fdeede5 100644
--- a/src/com/android/nfc/P2pEventManager.java
+++ b/src/com/android/nfc/P2pEventManager.java
@@ -18,6 +18,7 @@ package com.android.nfc;
import android.app.NotificationManager;
import android.content.Context;
+import android.content.res.Configuration;
import android.os.Vibrator;
/**
@@ -65,7 +66,15 @@ public class P2pEventManager implements P2pEventListener, SendUi.Callback {
@Override
public void onP2pSendConfirmationRequested() {
- mSendUi.showPreSend();
+ final int uiModeType = mContext.getResources().getConfiguration().uiMode
+ & Configuration.UI_MODE_TYPE_MASK;
+ if (uiModeType == Configuration.UI_MODE_TYPE_APPLIANCE) {
+ // "Appliances" don't intrinsically have a way of confirming this, so we
+ // will just auto-confirm.
+ mCallback.onP2pSendConfirmed();
+ } else {
+ mSendUi.showPreSend();
+ }
}
@Override