Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
leon committed Feb 28, 2016
1 parent efa56a0 commit a436fb9
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import android.os.Build;
import android.os.Handler;
import android.os.Looper;
import android.os.Parcelable;
import android.util.Log;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityNodeInfo;
Expand Down Expand Up @@ -114,14 +115,17 @@ public void onReceiveJob(AccessibilityEvent event) {
final int eventType = event.getEventType();
//通知栏事件
if(eventType == AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED) {
Parcelable data = event.getParcelableData();
if(data == null || !(data instanceof Notification)) {
return;
}
if(QiangHongBaoService.isNotificationServiceRunning() && getConfig().isEnableNotificationService()) { //开启快速模式,不处理
return;
}
List<CharSequence> texts = event.getText();
if(!texts.isEmpty()) {
String text = String.valueOf(texts.get(0));
Notification nf = (Notification) event.getParcelableData();
notificationEvent(text, nf);
notificationEvent(text, (Notification) data);
}
} else if(eventType == AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED) {
openHongBao(event);
Expand Down

0 comments on commit a436fb9

Please sign in to comment.