2011年8月16日火曜日

Gmailの通知 (一時凌ぎのpoor Gmail Notifier) その3

Gmail for Liveview の不具合は、Googleアカウントを一度削除すると、動くようになると言う情報を見かけたけど、アカウントを4つも設定しているので、面倒くさくて有り得ない。

今、Poor Gmail notifier でとりあえずできそうな改善はなんだろなーと、extrasを吐くようにしてログを眺めてみた。

08-16 21:24:55.440: DEBUG/jp.ddo.dekuyou.liveview.plugins.gmail(14612): Gmail onReceive : android.intent.action.PROVIDER_CHANGED
08-16 21:24:55.440: DEBUG/jp.ddo.dekuyou.liveview.plugins.gmail(14612): extras:count:2
08-16 21:24:55.440: DEBUG/jp.ddo.dekuyou.liveview.plugins.gmail(14612): extras:account:dekuyou@gmail.com
08-16 21:24:55.440: DEBUG/jp.ddo.dekuyou.liveview.plugins.gmail(14612): extras:tagLabel:^^unseen-^iim
08-16 21:24:55.440: DEBUG/jp.ddo.dekuyou.liveview.plugins.gmail(14612): extras:getAttention:true
08-16 21:24:55.440: DEBUG/jp.ddo.dekuyou.liveview.plugins.gmail(14612): extras:getAttention:true
08-16 21:24:55.460: DEBUG/jp.ddo.dekuyou.liveview.plugins.gmail(14612): GmailPluginService onStart
08-16 21:24:55.490: DEBUG/jp.ddo.dekuyou.liveview.plugins.gmail(14612): Announce sent to LiveView
08-16 21:25:44.708: DEBUG/jp.ddo.dekuyou.liveview.plugins.gmail(14612): Gmail onReceive : android.intent.action.PROVIDER_CHANGED
08-16 21:25:44.708: DEBUG/jp.ddo.dekuyou.liveview.plugins.gmail(14612): extras:count:1
08-16 21:25:44.708: DEBUG/jp.ddo.dekuyou.liveview.plugins.gmail(14612): extras:account:dekuyou@gmail.com
08-16 21:25:44.708: DEBUG/jp.ddo.dekuyou.liveview.plugins.gmail(14612): extras:tagLabel:^^unseen-^iim
08-16 21:25:44.708: DEBUG/jp.ddo.dekuyou.liveview.plugins.gmail(14612): extras:getAttention:true
08-16 21:25:44.708: DEBUG/jp.ddo.dekuyou.liveview.plugins.gmail(14612): extras:getAttention:true
08-16 21:25:44.718: DEBUG/jp.ddo.dekuyou.liveview.plugins.gmail(14612): GmailPluginService onStart
08-16 21:25:44.738: DEBUG/jp.ddo.dekuyou.liveview.plugins.gmail(14612): Announce sent to LiveView
08-16 21:27:10.322: DEBUG/jp.ddo.dekuyou.liveview.plugins.gmail(14612): Gmail onReceive : android.intent.action.PROVIDER_CHANGED
08-16 21:27:10.322: DEBUG/jp.ddo.dekuyou.liveview.plugins.gmail(14612): extras:count:0
08-16 21:27:10.322: DEBUG/jp.ddo.dekuyou.liveview.plugins.gmail(14612): extras:account:dekuyou@gmail.com
08-16 21:27:10.322: DEBUG/jp.ddo.dekuyou.liveview.plugins.gmail(14612): extras:tagLabel:^^unseen-^iim
08-16 21:27:10.322: DEBUG/jp.ddo.dekuyou.liveview.plugins.gmail(14612): extras:getAttention:false
08-16 21:27:10.322: DEBUG/jp.ddo.dekuyou.liveview.plugins.gmail(14612): extras:getAttention:false
08-16 21:27:10.322: DEBUG/jp.ddo.dekuyou.liveview.plugins.gmail(14612): GmailPluginService onStart

どうもアカウント毎にcountが動いていっていることに今更ながら気づいたわけです。
あと、getAttention は未読がなくなったらやっとfalseになるとか。

と、いうわけで前回のCountと今回を比べて、増えていれば新着、減っていれば既読の通知と判断してLiveviewへの通知制御を実施するようにしてみました。

新着判定がわかれば、対象のアカウントのGmail読みに行ってTitle取得してと思ったのですが、GmailのProviderが無いからコンパイルできないよとか言う状況に現状ハマっているのでとりあえずここまで。。。。


0 件のコメント:

コメントを投稿