// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: braces fieldsfirst space lnc package com.oliodevices.assist.app.detectors.status_bar_detectors; import android.app.Notification; import android.app.PendingIntent; import android.content.BroadcastReceiver; import android.content.ContentResolver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.database.Cursor; import android.media.AudioManager; import android.media.RemoteController; import android.net.Uri; import android.os.Bundle; import android.os.Handler; import android.os.IBinder; import android.service.notification.NotificationListenerService; import android.service.notification.StatusBarNotification; import android.support.v4.app.NotificationCompat; import android.view.KeyEvent; import com.olio.communication.actions.Action; import com.olio.communication.actions.AndroidAction; import com.olio.communication.actions.AndroidDismissAction; import com.olio.communication.actions.AndroidDismissActionBuilder; import com.olio.communication.actions.AndroidSBNAction; import com.olio.communication.actions.MediaAction; import com.olio.communication.actions.WebAction; import com.olio.communication.messages.MessageBuilder; import com.olio.communication.notifications.AndroidSBNContent; import com.olio.communication.notifications.DismissOptions; import com.olio.data.object.bluetooth_status.BluetoothNotificationObserver; import com.olio.data.object.bluetooth_status.BluetoothStatus; import com.olio.data.object.media.MediaControl; import com.olio.util.ALog; import com.oliodevices.assist.app.detectors.BroadcastDelegate; import com.oliodevices.assist.app.detectors.MessageBroadcastDelegate; import com.oliodevices.assist.app.detectors.status_bar_detectors.Notifications.NotificationToStreamItemMapper; import java.util.ArrayList; import java.util.Calendar; import java.util.HashMap; import java.util.Iterator; import java.util.Map; // Referenced classes of package com.oliodevices.assist.app.detectors.status_bar_detectors: // DetectorConfigurationHelper, AndroidSBNContentBuilder public class NotificationHandlerService extends NotificationListenerService implements android.media.RemoteController.OnClientUpdateListener { private class CalendarTuple { public Boolean currentEvent; public int eventId; final NotificationHandlerService this$0; private CalendarTuple(Boolean boolean1, int i) { this$0 = NotificationHandlerService.this; super(); currentEvent = boolean1; eventId = i; } } private class MediaCommandListener extends BroadcastReceiver { final NotificationHandlerService this$0; public void onReceive(Context context, Intent intent) { context = (Action)intent.getSerializableExtra("notification_action"); if (context instanceof MediaAction) { context = (MediaAction)context; ALog.d((new StringBuilder()).append("Received MediaAction: ").append(context).toString(), new Object[0]); handleMediaAction(context); } } private MediaCommandListener() { this$0 = NotificationHandlerService.this; super(); } } class NLServiceReceiver extends BroadcastReceiver { final NotificationHandlerService this$0; private void cancelNotification(AndroidDismissAction androiddismissaction) { if (android.os.Build.VERSION.SDK_INT < 21) { String s = androiddismissaction.getTag(); String s1 = androiddismissaction.getPackageName(); int i = androiddismissaction.getNotificationId(); NotificationHandlerService.this.cancelNotification(s1, s, i); return; } else { androiddismissaction = androiddismissaction.getNotificationKey(); NotificationHandlerService.this.cancelNotification(androiddismissaction); return; } } private void dismissNotification(AndroidDismissAction androiddismissaction) { StatusBarNotification astatusbarnotification[] = getActiveNotifications(); Object obj = new ArrayList(); boolean flag = false; int j = astatusbarnotification.length; for (int i = 0; i < j;) { StatusBarNotification statusbarnotification = astatusbarnotification[i]; boolean flag1 = flag; if (statusbarnotification.getPackageName().equalsIgnoreCase(androiddismissaction.getPackageName())) { ((ArrayList) (obj)).add(statusbarnotification); flag1 = flag; if (NotificationCompat.isGroupSummary(statusbarnotification.getNotification())) { flag1 = true; } } i++; flag = flag1; } if (flag && ((ArrayList) (obj)).size() == 2) { for (Iterator iterator = ((ArrayList) (obj)).iterator(); iterator.hasNext(); cancelNotification(AndroidDismissActionBuilder.anAndroidDismissAction().setNotificationId(((StatusBarNotification) (obj)).getId()).setTag(((StatusBarNotification) (obj)).getTag()).setPackageName(((StatusBarNotification) (obj)).getPackageName()).setNotificationKey(androiddismissaction).build())) { obj = (StatusBarNotification)iterator.next(); androiddismissaction = ""; if (android.os.Build.VERSION.SDK_INT >= 21) { androiddismissaction = ((StatusBarNotification) (obj)).getKey(); } } } else { cancelNotification(androiddismissaction); } } public void onReceive(Context context, Intent intent) { context = (Action)intent.getSerializableExtra("notification_action"); if (context instanceof AndroidAction) { context = (AndroidAction)context; if (context.getBroadcastFilter().equals(NotificationHandlerService.NOTIFICATION_DETECTOR_INTENT_FILTER)) { if (context instanceof AndroidSBNAction) { intent = (AndroidSBNAction)context; String s = intent.getActionId(); int i = intent.getActionIndex(); ((android.support.v4.app.NotificationCompat.Action[])AndroidSBNContent.getStaticActionMap().get(s))[Integer.valueOf(i).intValue()].actionIntent.send(); } if (context instanceof AndroidDismissAction) { dismissNotification((AndroidDismissAction)context); return; } } break MISSING_BLOCK_LABEL_169; } try { if (com/olio/communication/actions/WebAction.isInstance(context) && hangoutDismissOptions != null) { NotificationHandlerService.this.cancelNotification(hangoutDismissOptions.packageName, hangoutDismissOptions.tag, hangoutDismissOptions.notificationId); return; } } // Misplaced declaration of an exception variable catch (Context context) { ALog.e("exception is", context, new Object[0]); } } NLServiceReceiver() { this$0 = NotificationHandlerService.this; super(); } } private class SyncReceiver extends BroadcastReceiver { final NotificationHandlerService this$0; public void onReceive(Context context, Intent intent) { sendAllSbn(); } private SyncReceiver() { this$0 = NotificationHandlerService.this; super(); } } public static final String APP_ACTION_ACTION_ID = "APP_ACTION_ACTION_ID"; public static final String APP_ACTION_ACTION_INDEX = "APP_ACTION_ACTION_INDEX"; public static final String APP_ACTION_NOTIFICATION_ID = "APP_ACTION_NOTIFICATION_ID"; public static final String APP_ACTION_PREFIX = "APP_ACTION_"; public static final String APP_ACTION_TAG = "APP_ACTION_TAG"; public static final String APP_ACTION_TYPE = "APP_ACTION_TYPE"; public static String BLUETOOTH_DEVICE = "BLUETOOTH_DEVICE"; public static final String DISMISS_ACTION_ACTION_TYPE = "DISMISS_ACTION_ACTION_TYPE"; public static final String DISMISS_ACTION_NOTIFICATION_ID = "DISMISS_ACTION_NOTIFICATION_ID"; public static final String DISMISS_ACTION_PACKAGE_NAME = "DISMISS_ACTION_PACKAGE_NAME"; public static final String DISMISS_ACTION_PREFIX = "DISMISS_ACTION_"; public static final String DISMISS_ACTION_TAG = "DISMISS_ACTION_TAG"; public static final String HOLDING_FILTER_ACTION_ID = "HOLDING_FILTER_ACTION_ID"; public static final String HOLDING_FILTER_ACTION_SHOULD_SET_HOLDING = "SET_HOLDING"; public static final String HOLDING_FILTER_PREFIX = "HOLDING_FILTER_"; public static final String HOLDING_FILTER_TURN_OFF_HOLDING = "TURN_OFF_HOLDING"; public static String MEDIA_ACTION_INTENT_FILTER = "com.oliodevices.MediaAction"; public static final String MUSIC_NOTIFICATION_ID = "com.olio.music"; public static final String NOTIFICATION_DETECTOR_CONNECTED = "com.olio.notification_detectors.notification_detector.bound_to_service_listener"; public static String NOTIFICATION_DETECTOR_INTENT_FILTER = "com.oliodevices.NotificationDetector"; public static String NOT_ID = "notificationId"; public static String NOT_TAG = "tag"; public static String PKG = "pkg"; public static final String REMIND_ACTION_TYPE = "REMIND_ACTION"; public static final String REMIND_NOTIFICATION_ID = "REMIND_NOTIFICATION_ID"; public static String REMOVE_NOTIFICATION = "removeNotification"; public static final String SMS_ACTION_LEFT_TEXT = "SMS_ACTION_LEFT_TEXT"; public static final String SMS_ACTION_NUMBER = "NUMBER"; public static final String SMS_ACTION_PREFIX = "SMS_ACTION_"; public static final String SMS_ACTION_RIGHT_TEXT = "SMS_ACTION_RIGHT_TEXT"; public static final String SMS_ACTION_TAG = "TAG"; public static final String SYNC_RECEIVER_SYNC = "com.olio.notification_detectors.notification_detector.sync_sbn"; private static String TAG = "NotificationHandlerService"; public static boolean isNotificationAccessEnabled = false; DismissOptions hangoutDismissOptions; private boolean inHoldingNotificationsFlow; private int lastEventId; private Map mAndroidSBNActionMap; private AudioManager mAudioManager; private MessageBroadcastDelegate mDelegate; private MediaCommandListener mMediaCommandListener; private BluetoothNotificationObserver mNotificationObserver; private NotificationToStreamItemMapper mNotificationParser; private RemoteController mRemoteController; SyncReceiver mSyncReceiver; private MediaControl mTrackInfo; private NLServiceReceiver nlServiceReceiver; private boolean shouldSendMediaControl; public NotificationHandlerService() { mTrackInfo = new MediaControl(); shouldSendMediaControl = false; inHoldingNotificationsFlow = false; lastEventId = -1; } private CalendarTuple checkCurrentCalendar() { long l = Calendar.getInstance().getTimeInMillis(); Cursor cursor = android.provider.CalendarContract.Instances.query(getContentResolver(), new String[] { "event_id", "allDay" }, l, l); int i = -1; while (cursor.moveToNext()) { int j; boolean flag; if (cursor.getInt(cursor.getColumnIndex("allDay")) != 0) { flag = true; } else { flag = false; } j = i; if (!flag) { int k = cursor.getInt(cursor.getColumnIndex("event_id")); j = i; if (k != lastEventId) { j = k; } } ALog.d("Calendar event: %d, all day: %b", new Object[] { Integer.valueOf(j), Boolean.valueOf(flag) }); i = j; } cursor.close(); if (i != -1) { return new CalendarTuple(Boolean.valueOf(true), i); } else { return new CalendarTuple(Boolean.valueOf(false), i); } } private void clearTrackInfo() { mTrackInfo.reset(); } private void filterForCalendarEvent() { } public static String getContactName(Context context, String s) { s = context.getContentResolver().query(Uri.withAppendedPath(android.provider.ContactsContract.PhoneLookup.CONTENT_FILTER_URI, Uri.encode(s)), new String[] { "display_name" }, null, null, null); if (s == null) { return null; } context = null; if (s.moveToFirst()) { context = s.getString(s.getColumnIndex("display_name")); } if (s != null && !s.isClosed()) { s.close(); } return context; } private boolean handleMediaAction(MediaAction mediaaction) { byte byte0 = -1; static class _cls2 { static final int $SwitchMap$com$olio$communication$actions$MediaAction$MediaEvent[]; static { $SwitchMap$com$olio$communication$actions$MediaAction$MediaEvent = new int[com.olio.communication.actions.MediaAction.MediaEvent.values().length]; try { $SwitchMap$com$olio$communication$actions$MediaAction$MediaEvent[com.olio.communication.actions.MediaAction.MediaEvent.PLAY_PAUSE.ordinal()] = 1; } catch (NoSuchFieldError nosuchfielderror8) { } try { $SwitchMap$com$olio$communication$actions$MediaAction$MediaEvent[com.olio.communication.actions.MediaAction.MediaEvent.PLAY.ordinal()] = 2; } catch (NoSuchFieldError nosuchfielderror7) { } try { $SwitchMap$com$olio$communication$actions$MediaAction$MediaEvent[com.olio.communication.actions.MediaAction.MediaEvent.PAUSE.ordinal()] = 3; } catch (NoSuchFieldError nosuchfielderror6) { } try { $SwitchMap$com$olio$communication$actions$MediaAction$MediaEvent[com.olio.communication.actions.MediaAction.MediaEvent.NEXT.ordinal()] = 4; } catch (NoSuchFieldError nosuchfielderror5) { } try { $SwitchMap$com$olio$communication$actions$MediaAction$MediaEvent[com.olio.communication.actions.MediaAction.MediaEvent.PREV.ordinal()] = 5; } catch (NoSuchFieldError nosuchfielderror4) { } try { $SwitchMap$com$olio$communication$actions$MediaAction$MediaEvent[com.olio.communication.actions.MediaAction.MediaEvent.VOLUME_DOWN.ordinal()] = 6; } catch (NoSuchFieldError nosuchfielderror3) { } try { $SwitchMap$com$olio$communication$actions$MediaAction$MediaEvent[com.olio.communication.actions.MediaAction.MediaEvent.VOLUME_UP.ordinal()] = 7; } catch (NoSuchFieldError nosuchfielderror2) { } try { $SwitchMap$com$olio$communication$actions$MediaAction$MediaEvent[com.olio.communication.actions.MediaAction.MediaEvent.DISCONNECT.ordinal()] = 8; } catch (NoSuchFieldError nosuchfielderror1) { } try { $SwitchMap$com$olio$communication$actions$MediaAction$MediaEvent[com.olio.communication.actions.MediaAction.MediaEvent.CONNECT.ordinal()] = 9; } catch (NoSuchFieldError nosuchfielderror) { return; } } } _cls2..SwitchMap.com.olio.communication.actions.MediaAction.MediaEvent[mediaaction.getMediaEvent().ordinal()]; JVM INSTR tableswitch 1 5: default 48 // 1 93 // 2 99 // 3 105 // 4 111 // 5 135; goto _L1 _L2 _L3 _L4 _L5 _L6 _L1: if (byte0 != -1) { mediaaction = new KeyEvent(0, byte0); mRemoteController.sendMediaKeyEvent(mediaaction); mediaaction = new KeyEvent(1, byte0); mRemoteController.sendMediaKeyEvent(mediaaction); return true; } break; /* Loop/switch isn't completed */ _L2: byte0 = 85; continue; /* Loop/switch isn't completed */ _L3: byte0 = 126; continue; /* Loop/switch isn't completed */ _L4: byte0 = 127; continue; /* Loop/switch isn't completed */ _L5: byte byte1 = 87; byte0 = byte1; if (mTrackInfo != null) { mTrackInfo.reset(); byte0 = byte1; } continue; /* Loop/switch isn't completed */ _L6: byte byte2 = 88; byte0 = byte2; if (mTrackInfo != null) { mTrackInfo.reset(); byte0 = byte2; } if (true) goto _L1; else goto _L7 _L7: int i = 0; _cls2..SwitchMap.com.olio.communication.actions.MediaAction.MediaEvent[mediaaction.getMediaEvent().ordinal()]; JVM INSTR tableswitch 6 7: default 196 // 6 214 // 7 222; goto _L8 _L9 _L10 _L8: if (byte0 != -1) { mAudioManager.adjustStreamVolume(3, i, 8); return true; } break; /* Loop/switch isn't completed */ _L9: byte0 = 25; i = -1; continue; /* Loop/switch isn't completed */ _L10: byte0 = 24; i = 1; if (true) goto _L8; else goto _L11 _L11: _cls2..SwitchMap.com.olio.communication.actions.MediaAction.MediaEvent[mediaaction.getMediaEvent().ordinal()]; JVM INSTR tableswitch 8 9: default 264 // 8 266 // 9 284; goto _L12 _L13 _L14 _L12: return false; _L13: ALog.d("Media Event Disconnected.", new Object[0]); shouldSendMediaControl = false; continue; /* Loop/switch isn't completed */ _L14: ALog.d("Media Event Connected.", new Object[0]); if (mTrackInfo != null && mRemoteController != null) { mTrackInfo.setCurrentTime((int)mRemoteController.getEstimatedMediaPosition()); } shouldSendMediaControl = true; updateMediaControl(); if (true) goto _L12; else goto _L15 _L15: } private void registerBluetoothReceiver() { ALog.d("Media Bluetooth Receiver Registered.", new Object[0]); mNotificationObserver = new BluetoothNotificationObserver(getContentResolver(), new Handler(getMainLooper()), com.olio.data.object.bluetooth_status.BluetoothNotificationObserver.Platform.PHONE) { final NotificationHandlerService this$0; public void connectionStatusUpdate(com.olio.data.object.bluetooth_status.BluetoothNotificationObserver.ConnectionStatusChange connectionstatuschange) { if (connectionstatuschange == com.olio.data.object.bluetooth_status.BluetoothNotificationObserver.ConnectionStatusChange.CONNECTED) { ALog.d("Bluetooth device connected.", new Object[0]); } else { ALog.d("Bluetooth device disconnected.", new Object[0]); shouldSendMediaControl = false; connectionstatuschange = getApplicationContext(); if (connectionstatuschange != null) { connectionstatuschange.removeStickyBroadcast(new Intent("com.oliodevices.assist.intent.action.UPDATE_BATTERY")); connectionstatuschange.removeStickyBroadcast(new Intent("com.oliodevices.assist.intent.action.UPDATE_DND")); return; } } } public void statusUpdate(BluetoothStatus bluetoothstatus) { } { this$0 = NotificationHandlerService.this; super(contentresolver, handler, platform); } }; mNotificationObserver.register(); } private void removeNotification(AndroidSBNContent androidsbncontent) { if (mDelegate != null) { androidsbncontent = (new MessageBuilder()).setAction(com.olio.communication.messages.Message.Action.DELETE).setDestination("watch").setPayload(androidsbncontent).setSource("phone").build(); mDelegate.sendMessage(androidsbncontent); } } private void sendMediaControl() { com.olio.communication.messages.Message message = (new MessageBuilder()).setSource("phone").setDestination("watch").setPayload(mTrackInfo).build(); ALog.d("sendMediaControl(): Media Control Message : %s", new Object[] { message }); mDelegate.sendMessage(message); } public static String truncateLastName(String s) { int i = s.indexOf(' '); String s1 = s; if (i > 0) { s1 = s; if (i < s.length() - 1) { s1 = (new StringBuilder()).append(s.substring(0, i + 2)).append(".").toString(); } } return s1; } private void updateMediaControl() { label0: { ALog.d("current track info: %s", new Object[] { mTrackInfo }); if (!mTrackInfo.getTopText().isEmpty() && !mTrackInfo.getBottomText().isEmpty() && mTrackInfo.getCurrentTime() >= 0 && mTrackInfo.getDuration() > 0 && mTrackInfo.getMediaState() != com.olio.data.object.media.MediaControl.MediaState.Stopped) { ContentResolver contentresolver = getApplicationContext().getContentResolver(); MediaControl mediacontrol = MediaControl.mediaControl(contentresolver); mediacontrol.setTopText(mTrackInfo.getTopText()); mediacontrol.setBottomText(mTrackInfo.getBottomText()); mediacontrol.setDuration(mTrackInfo.getDuration()); mediacontrol.setCurrentTime(mTrackInfo.getCurrentTime()); mediacontrol.setMediaState(mTrackInfo.getMediaState()); ALog.d("Updating mediaControl: %s", new Object[] { mediacontrol }); mediacontrol.save(contentresolver); if (!shouldSendMediaControl) { break label0; } sendMediaControl(); } return; } ALog.w("Media Control not sent", new Object[0]); } public IBinder onBind(Intent intent) { ALog.d("onBind", new Object[0]); sendBroadcast(new Intent("com.olio.notification_detectors.notification_detector.bound_to_service_listener")); registerBluetoothReceiver(); return super.onBind(intent); } public void onClientChange(boolean flag) { ALog.d("onClientChange %b", new Object[] { Boolean.valueOf(flag) }); clearTrackInfo(); } public void onClientMetadataUpdate(android.media.RemoteController.MetadataEditor metadataeditor) { String s1 = metadataeditor.getString(2, null); String s = s1; if (s1 == null) { s = metadataeditor.getString(13, "Artist"); } s1 = metadataeditor.getString(7, "Title"); long l = metadataeditor.getLong(9, 0L); mTrackInfo.setTopText(s1); mTrackInfo.setBottomText(s); mTrackInfo.setDuration((int)l); ALog.d("onClientMetadataUpdate: %s - %s, %s/%s", new Object[] { s, s1, Integer.valueOf(mTrackInfo.getCurrentTime()), Long.valueOf(l) }); updateMediaControl(); } public void onClientPlaybackStateUpdate(int i) { ALog.d("onClientPlaybackStateUpdate %d", new Object[] { Integer.valueOf(i) }); onClientPlaybackStateUpdate(i, 0L, 0L, 1.0F); } public void onClientPlaybackStateUpdate(int i, long l, long l1, float f) { i; JVM INSTR tableswitch 1 3: default 28 // 1 46 // 2 125 // 3 148; goto _L1 _L2 _L3 _L4 _L1: ALog.v("media state %d", new Object[] { Integer.valueOf(i) }); return; _L2: mTrackInfo.setMediaState(com.olio.data.object.media.MediaControl.MediaState.Stopped); mTrackInfo.setCurrentTime(-1); _L6: ALog.d("onClientPlaybackStateUpdate: %s - %s, %s/%s", new Object[] { mTrackInfo.getTopText(), mTrackInfo.getBottomText(), Integer.valueOf(mTrackInfo.getCurrentTime()), Integer.valueOf(mTrackInfo.getDuration()) }); updateMediaControl(); return; _L3: mTrackInfo.setMediaState(com.olio.data.object.media.MediaControl.MediaState.Paused); mTrackInfo.setCurrentTime((int)l1); continue; /* Loop/switch isn't completed */ _L4: mTrackInfo.setMediaState(com.olio.data.object.media.MediaControl.MediaState.Playing); mTrackInfo.setCurrentTime((int)l1); if (true) goto _L6; else goto _L5 _L5: } public void onClientSessionEvent(String s, Bundle bundle) { ALog.d("onClientSessionEvent", new Object[0]); } public void onClientTransportControlUpdate(int i) { ALog.d("onClientTransportControlUpdate %d", new Object[] { Integer.valueOf(i) }); } public void onCreate() { ALog.d("onCreate", new Object[0]); super.onCreate(); ALog.i("notification detector started: true", new Object[0]); mNotificationParser = new NotificationToStreamItemMapper(getApplicationContext(), getContentResolver()); mNotificationParser.register(); nlServiceReceiver = new NLServiceReceiver(); Object obj = new IntentFilter(); ((IntentFilter) (obj)).addAction(NOTIFICATION_DETECTOR_INTENT_FILTER); registerReceiver(nlServiceReceiver, ((IntentFilter) (obj))); mSyncReceiver = new SyncReceiver(); obj = new IntentFilter("com.olio.notification_detectors.notification_detector.sync_sbn"); registerReceiver(mSyncReceiver, ((IntentFilter) (obj))); mMediaCommandListener = new MediaCommandListener(); obj = new IntentFilter(MEDIA_ACTION_INTENT_FILTER); registerReceiver(mMediaCommandListener, ((IntentFilter) (obj))); obj = getApplicationContext(); mRemoteController = new RemoteController(((Context) (obj)), this); mAudioManager = (AudioManager)((Context) (obj)).getSystemService("audio"); if (mAudioManager == null) { ALog.e("Could not get Audio Manager", new Object[0]); } else if (mAudioManager.registerRemoteController(mRemoteController)) { ALog.d("Remote controller registered", new Object[0]); } else { ALog.e("Remote controller could not be registered", new Object[0]); } mAndroidSBNActionMap = new HashMap(); mDelegate = new BroadcastDelegate(getBaseContext()); } public void onDestroy() { ALog.d("onDestroy", new Object[0]); super.onDestroy(); unregisterReceiver(nlServiceReceiver); unregisterReceiver(mSyncReceiver); mNotificationObserver.unregister(); mNotificationParser.unregister(); if (mAudioManager != null) { mAudioManager.unregisterRemoteController(mRemoteController); } } public void onNotificationPosted(StatusBarNotification statusbarnotification) { Notification notification = statusbarnotification.getNotification(); String s; String s1; if (android.os.Build.VERSION.SDK_INT > 19) { s = notification.category; } else { s = ""; } s1 = statusbarnotification.getPackageName(); ALog.d("Notification posted from %s: %s", new Object[] { s1, notification.toString() }); if (s1.equals(getPackageName()) || DetectorConfigurationHelper.shouldIgnore(this, s1) || "transport".equals(s) || "progress".equals(s)) { ALog.d("Ignoring notification from %s", new Object[] { s1 }); } else { filterForCalendarEvent(); if (notification.priority >= 0 && mDelegate != null) { statusbarnotification = AndroidSBNContentBuilder.fromStatusBarNotification(statusbarnotification); if (statusbarnotification.getTitleBig() != null || statusbarnotification.getTitle() != null || statusbarnotification.getText() != null) { mNotificationParser.processSBNContent(statusbarnotification, mDelegate); return; } } } } public void onNotificationRemoved(StatusBarNotification statusbarnotification) { Notification notification = statusbarnotification.getNotification(); if (android.os.Build.VERSION.SDK_INT >= 21 && NotificationCompat.isGroupSummary(notification)) { StatusBarNotification astatusbarnotification[] = getActiveNotifications(); int j = astatusbarnotification.length; for (int i = 0; i < j; i++) { StatusBarNotification statusbarnotification1 = astatusbarnotification[i]; if (statusbarnotification1.getPackageName().equalsIgnoreCase(statusbarnotification.getPackageName())) { removeNotification(AndroidSBNContentBuilder.fromStatusBarNotification(statusbarnotification1)); } } } else { removeNotification(AndroidSBNContentBuilder.fromStatusBarNotification(statusbarnotification)); } } public int onStartCommand(Intent intent, int i, int j) { ALog.d("onStartCommand", new Object[0]); if (mDelegate == null) { mDelegate = new BroadcastDelegate(getBaseContext()); } return 1; } public boolean onUnbind(Intent intent) { ALog.d("onUnbind", new Object[0]); boolean flag = super.onUnbind(intent); isNotificationAccessEnabled = false; return flag; } public void sendAllSbn() { StatusBarNotification astatusbarnotification[] = getActiveNotifications(); if (astatusbarnotification == null) { return; } int j = astatusbarnotification.length; int i = 0; _L2: if (i >= j) { break; /* Loop/switch isn't completed */ } onNotificationPosted(astatusbarnotification[i]); i++; if (true) goto _L2; else goto _L1 NullPointerException nullpointerexception; nullpointerexception; ALog.e("Exception in sendAllSbn: ", nullpointerexception, new Object[0]); _L1: } /* static boolean access$402(NotificationHandlerService notificationhandlerservice, boolean flag) { notificationhandlerservice.shouldSendMediaControl = flag; return flag; } */ }