diff options
-rw-r--r-- | res/values-ar/strings.xml | 12 | ||||
-rw-r--r-- | src/com/android/nfc/NfcDispatcher.java | 5 | ||||
-rwxr-xr-x | src/com/android/nfc/NfcService.java | 39 | ||||
-rw-r--r-- | src/com/android/nfc/SendUi.java | 2 | ||||
-rw-r--r-- | src/com/android/nfc/handover/HandoverManager.java | 5 |
5 files changed, 31 insertions, 32 deletions
diff --git a/res/values-ar/strings.xml b/res/values-ar/strings.xml index 5eceaf8..d7ec39f 100644 --- a/res/values-ar/strings.xml +++ b/res/values-ar/strings.xml @@ -8,14 +8,14 @@ <string name="outbound_me_profile_title" msgid="2523625031572784769">"اكتمل تفاعل NFC"</string> <string name="outbound_me_profile_text" msgid="5594998841143667989">"المس لمنح هذا الشخص معلومات اتصالك."</string> <string name="accessibility_nfc_enabled" msgid="7796246979948787735">"تم تمكين NFC."</string> - <string name="touch" msgid="4727218133711188355">"المس لتبادل البيانات"</string> - <string name="beam_progress" msgid="7453634884807323920">"بيانات واردة..."</string> - <string name="beam_complete" msgid="477026736424637435">"اكتمل تبادل البيانات"</string> - <string name="beam_failed" msgid="5116241718189888630">"لم يكتمل تبادل البيانات"</string> - <string name="beam_canceled" msgid="5425192751826544741">"تم إلغاء تبادل البيانات"</string> + <string name="touch" msgid="4727218133711188355">"المس لرسم شعاع"</string> + <string name="beam_progress" msgid="7453634884807323920">"شعاع وارد..."</string> + <string name="beam_complete" msgid="477026736424637435">"اكتمل الشعاع"</string> + <string name="beam_failed" msgid="5116241718189888630">"لم يكتمل الشعاع"</string> + <string name="beam_canceled" msgid="5425192751826544741">"تم إلغاء الشعاع"</string> <string name="cancel" msgid="61873902552555096">"إلغاء"</string> <string name="beam_touch_to_view" msgid="7853129156831642630">"المس ليتم العرض"</string> - <string name="beam_handover_not_supported" msgid="4083165921751489015">"جهاز المستلم لا يوفر نقل ملفات كبيرة عبر تبادل البيانات."</string> + <string name="beam_handover_not_supported" msgid="4083165921751489015">"جهاز المستلم لا يوفر نقل ملفات كبيرة عبر الشعاع."</string> <string name="connecting_headset" msgid="3929250919225573008">"جارٍ الاتصال..."</string> <string name="connected_headset" msgid="4047751837023241955">"متصل"</string> <string name="connect_headset_failed" msgid="7500801585498094863">"تعذر الاتصال"</string> diff --git a/src/com/android/nfc/NfcDispatcher.java b/src/com/android/nfc/NfcDispatcher.java index b3ab97c..f628dea 100644 --- a/src/com/android/nfc/NfcDispatcher.java +++ b/src/com/android/nfc/NfcDispatcher.java @@ -305,7 +305,10 @@ public class NfcDispatcher { if (message == null) { return false; } - dispatch.setNdefIntent(); + Intent intent = dispatch.setNdefIntent(); + + // Bail out if the intent does not contain filterable NDEF data + if (intent == null) return false; // Try to start AAR activity with matching filter List<String> aarPackages = extractAarPackages(message); diff --git a/src/com/android/nfc/NfcService.java b/src/com/android/nfc/NfcService.java index 3acfa1c..ca1713d 100755 --- a/src/com/android/nfc/NfcService.java +++ b/src/com/android/nfc/NfcService.java @@ -187,9 +187,8 @@ public class NfcService extends Application implements DeviceHostListener { private SharedPreferences mPrefs; private SharedPreferences.Editor mPrefsEditor; private PowerManager.WakeLock mRoutingWakeLock; - private PowerManager.WakeLock mOpenWakeLock; - private PowerManager.WakeLock mDisconnectWakeLock; - private PowerManager.WakeLock mTransceiveWakeLock; + private PowerManager.WakeLock mEeWakeLock; + int mStartSound; int mEndSound; int mErrorSound; @@ -323,16 +322,10 @@ public class NfcService extends Application implements DeviceHostListener { mPowerManager = (PowerManager) getSystemService(Context.POWER_SERVICE); - // TODO(mikey|maco): consolidate as a single wakelock when individual - // stats are no longer useful. mRoutingWakeLock = mPowerManager.newWakeLock( PowerManager.PARTIAL_WAKE_LOCK, "NfcService:mRoutingWakeLock"); - mOpenWakeLock = mPowerManager.newWakeLock( - PowerManager.PARTIAL_WAKE_LOCK, "NfcService:mOpenWakeLock"); - mDisconnectWakeLock = mPowerManager.newWakeLock( - PowerManager.PARTIAL_WAKE_LOCK, "NfcService:mDisconnectWakeLock"); - mTransceiveWakeLock = mPowerManager.newWakeLock( - PowerManager.PARTIAL_WAKE_LOCK, "NfcService:mTransceiveWakeLock"); + mEeWakeLock = mPowerManager.newWakeLock( + PowerManager.PARTIAL_WAKE_LOCK, "NfcService:mEeWakeLock"); mKeyguard = (KeyguardManager) getSystemService(Context.KEYGUARD_SERVICE); mScreenState = checkScreenState(); @@ -417,20 +410,20 @@ public class NfcService extends Application implements DeviceHostListener { } int doOpenSecureElementConnection() { - mOpenWakeLock.acquire(); + mEeWakeLock.acquire(); try { return mSecureElement.doOpenSecureElementConnection(); } finally { - mOpenWakeLock.release(); + mEeWakeLock.release(); } } byte[] doTransceive(int handle, byte[] cmd) { - mTransceiveWakeLock.acquire(); + mEeWakeLock.acquire(); try { return doTransceiveNoLock(handle, cmd); } finally { - mTransceiveWakeLock.release(); + mEeWakeLock.release(); } } @@ -439,11 +432,11 @@ public class NfcService extends Application implements DeviceHostListener { } void doDisconnect(int handle) { - mDisconnectWakeLock.acquire(); + mEeWakeLock.acquire(); try { mSecureElement.doDisconnect(handle); } finally { - mDisconnectWakeLock.release(); + mEeWakeLock.release(); } } @@ -640,7 +633,7 @@ public class NfcService extends Application implements DeviceHostListener { } try { - mTransceiveWakeLock.acquire(); + mEeWakeLock.acquire(); try { mDeviceHost.setTimeout(TagTechnology.ISO_DEP, 10000); @@ -654,7 +647,7 @@ public class NfcService extends Application implements DeviceHostListener { mDeviceHost.resetTimeouts(); } finally { - mTransceiveWakeLock.release(); + mEeWakeLock.release(); } } finally { doDisconnect(handle); @@ -1427,7 +1420,7 @@ public class NfcService extends Application implements DeviceHostListener { synchronized (this) { if (!mWatchDogCanceled) { // Trigger watch-dog - Log.e(TAG, "Watch dog triggered"); + Log.e(TAG, "--- NFC controller stuck while applying routing ---"); mDeviceHost.doAbort(); } } @@ -1847,7 +1840,11 @@ public class NfcService extends Application implements DeviceHostListener { } mScreenState = params[0].intValue(); - mRoutingWakeLock.acquire(); + // HACK: We've seen applying the routing configuration + // getting stuck. The operation should normally easily + // complete within a minute, so don't hold the wakelock + // any longer than that. + mRoutingWakeLock.acquire(60000); try { applyRouting(false); } finally { diff --git a/src/com/android/nfc/SendUi.java b/src/com/android/nfc/SendUi.java index 23602c9..c54f54e 100644 --- a/src/com/android/nfc/SendUi.java +++ b/src/com/android/nfc/SendUi.java @@ -183,7 +183,7 @@ public class SendUi implements Animator.AnimatorListener, View.OnTouchListener, // We're only allowed to use hardware acceleration if // isHighEndGfx() returns true - otherwise, we're too limited // on resources to do it. - mHardwareAccelerated = ActivityManager.isHighEndGfx(mDisplay); + mHardwareAccelerated = ActivityManager.isHighEndGfx(); int hwAccelerationFlags = mHardwareAccelerated ? WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED : 0; diff --git a/src/com/android/nfc/handover/HandoverManager.java b/src/com/android/nfc/handover/HandoverManager.java index fccdd17..a514f85 100644 --- a/src/com/android/nfc/handover/HandoverManager.java +++ b/src/com/android/nfc/handover/HandoverManager.java @@ -387,8 +387,7 @@ public class HandoverManager implements BluetoothHeadsetHandover.Callback { notBuilder.setContentText(mContext.getString(R.string.beam_touch_to_view)); Intent viewIntent = buildViewIntent(); - PendingIntent contentIntent = PendingIntent.getActivity(mContext, 0, viewIntent, - Intent.FLAG_ACTIVITY_NEW_TASK); + PendingIntent contentIntent = PendingIntent.getActivity(mContext, 0, viewIntent, 0); notBuilder.setContentIntent(contentIntent); @@ -535,7 +534,7 @@ public class HandoverManager implements BluetoothHeadsetHandover.Callback { Uri uri = mediaUri != null ? mediaUri : Uri.parse(ContentResolver.SCHEME_FILE + "://" + filePath); viewIntent.setDataAndTypeAndNormalize(uri, mimeTypes.get(filePath)); - + viewIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); return viewIntent; } |