>>103
まず,SecureTaskプラグインをインストールする.
次に下記のように権限を与える(インストール後に1回だけ必要).
adb shell pm grant com.balda.securetask android.permission.DUMP

後は,下記のような Profile を組めばよい.
ディスプレイオフから3分経ってもロックを確保してたらもうおかしいんじゃないかな.

Profile: ディスプレイオフ (41)
State: Display State [ Is:Off ]
Enter: Anon (194)
A1: Perform Task [ Name:NfcWakeLockCheck Priority:%priority Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: Stop:Off ]

Exit: Anon (159)
A1: Stop [ With Error:Off Task:NfcWakeLockCheck ]


NfcWakeLockCheck (98)
Abort Existing Task
A1: Wait [ MS:0 Seconds:0 Minutes:3 Hours:0 Days:0 ]
A2: Dump log [ Configuration:dumpsys power Timeout (Seconds):30 ]
A3: Wait [ MS:0 Seconds:1 Minutes:0 Hours:0 Days:0 ]
A4: Run Shell [ Command:grep -q NfcService:lubNfcWakeLock %stdumpfile
echo $? Timeout (Seconds):0 Use Root:Off Store Output In:%statuscode Store Errors In: Store Result In: ]
A5: Delete File [ File:%stdumpfile Shred Level:0 Use Root:Off ]
A6: If [ %statuscode eq 0 ]
A7: Notify Vibrate [ Title:NfcWakeLock Text: Icon:null Number:0 Pattern: Priority:3 Repeat Alert:Off ]
A8: End If