diff options
author | Joe Onorato <joeo@google.com> | 2011-12-14 20:58:28 -0800 |
---|---|---|
committer | Joe Onorato <joeo@google.com> | 2011-12-14 20:58:28 -0800 |
commit | a262bb2acccd3687856eb2c171d976de98bb892f (patch) | |
tree | 037896d5f4318b0d5cb43a14eb80fb7ba4c08699 /src/com | |
parent | 448981a372167bce39dac7ed000c85d56db4aba6 (diff) | |
download | packages_apps_nfc-a262bb2acccd3687856eb2c171d976de98bb892f.zip packages_apps_nfc-a262bb2acccd3687856eb2c171d976de98bb892f.tar.gz packages_apps_nfc-a262bb2acccd3687856eb2c171d976de98bb892f.tar.bz2 |
Use the new "appliance" ui mode configuration to determine whether to show nfc confirmation ui.
Change-Id: Iebad3ee6a40341b963ecf118f8d46f08b6478a25
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/nfc/P2pEventManager.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/com/android/nfc/P2pEventManager.java b/src/com/android/nfc/P2pEventManager.java index 5677a6f..8e4165d 100644 --- a/src/com/android/nfc/P2pEventManager.java +++ b/src/com/android/nfc/P2pEventManager.java @@ -19,6 +19,7 @@ package com.android.nfc; import android.app.NotificationManager; import android.content.Context; import android.content.SharedPreferences; +import android.content.res.Configuration; import android.os.Handler; import android.os.Message; import android.os.Vibrator; @@ -68,7 +69,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 |