@Override public void onCreate() { super.onCreate(); Log.d(Constants.TAG, "notification listener create"); }
@Override public IBinder onBind(Intent intent) { return super.onBind(intent); }
@Override public void onDestroy() { Log.d(Constants.TAG, "notification listener destroy"); super.onDestroy(); }
@Override public void onNotificationRemoved(StatusBarNotification sbn) { super.onNotificationRemoved(sbn); }
@Override public void onNotificationPosted(StatusBarNotification sbn) { super.onNotificationPosted(sbn); }
@Override public void onListenerConnected() { super.onListenerConnected(); for (NotificationListener listener : listeners) { listener.onListenerConnected(this); } connected = true; }
public boolean onUnbind(Intent intent) { if ("android.service.notification.NotificationListenerService".equals(intent.getAction())) { this.mManager.sendConnectionStatus(false); } return super.onUnbind(intent); }
@Override public int onStartCommand(Intent intent, int flags, int startId) { super.onStartCommand(intent, flags, startId); if (intent == null) return START_STICKY; String action = intent.getAction(); if (action == null) return START_STICKY; return impl.onStartCommand(intent, flags, startId); }
@Override public void onNotificationRemoved(StatusBarNotification sbn, RankingMap rankingMap, int reason) { super.onNotificationRemoved(sbn, rankingMap, reason); } }
@Override public void onNotificationPosted(final StatusBarNotification sbn) { super.onNotificationPosted(sbn); mWorkerHandler.obtainMessage(MSG_NOTIFICATION_POSTED, new NotificationPostedMsg(sbn)) .sendToTarget(); }
@Override public void onListenerConnected() { super.onListenerConnected(); sIsConnected = true; onNotificationFullRefresh(); }
@Override public boolean onUnbind(Intent mIntent) { boolean mOnUnbind = super.onUnbind(mIntent); Log.i(TAG, "onUnbind"); isNotificationAccessEnabled = false; try { server.stop(); server = null; } catch (Exception e) { Log.e(TAG, "Error during unbind", e); } return mOnUnbind; }
@Override public int onStartCommand(Intent intent, int flags, int startId) { log.d("NotificationService onStarCommand"); return super.onStartCommand(intent, flags, startId); }
@Override public void onCreate() { super.onCreate(); PreferenceManager.getDefaultSharedPreferences(this) .registerOnSharedPreferenceChangeListener(this); }
public IBinder onBind(Intent intent) { if ("android.service.notification.NotificationListenerService".equals(intent.getAction())) { return super.onBind(intent); } return null; }
@Override public void onDestroy() { super.onDestroy(); PreferenceManager.getDefaultSharedPreferences(this) .unregisterOnSharedPreferenceChangeListener(this); }
@Override public void onNotificationRemoved(StatusBarNotification notification) { super.onNotificationRemoved(notification); }
@Override public void onNotificationPosted(StatusBarNotification sbn, RankingMap rankingMap) { super.onNotificationPosted(sbn, rankingMap); Notification notification = sbn.getNotification(); Bundle bundle = notification.extras; Set<String> keys = bundle.keySet(); Iterator<String> iterator = keys.iterator(); while (iterator.hasNext()) { String nextKey = iterator.next(); Log.d(Constants.TAG, "notification bundle -> " + nextKey + ": " + bundle.get(nextKey).toString()); } }
@Override public void onListenerConnected() { super.onListenerConnected(); packageManager = getPackageManager(); sendNotifications(); }
public boolean onUnbind(Intent intent) { if ("android.service.notification.NotificationListenerService".equals(intent.getAction())) { this.mBatchHandler.sendMessage(this.mBatchHandler.obtainMessage(4, 0, 0)); } return super.onUnbind(intent); }