Skip to content

Commit

Permalink
Add debugging message to aid debugging
Browse files Browse the repository at this point in the history
Aid #60
  • Loading branch information
renyuneyun committed Feb 19, 2018
1 parent 542dbaf commit 01cc52c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,18 +127,21 @@ public void onListenerConnected() {

@Override
public IBinder onBind(Intent intent) {
Logger.d("NotificationEventListenerService onBind()");
is_running = true;
return super.onBind(intent);
}

@Override
public boolean onUnbind(Intent intent) {
Logger.d("NotificationEventListenerService onUnbind()");
is_running = false;
return super.onUnbind(intent);
}

@Override
public void onCreate() {
Logger.i("NotificationEventListenerService onCreate()");
super.onCreate();
IntentFilter filter = new IntentFilter();
filter.addAction(ACTION_LISTEN);
Expand All @@ -148,6 +151,7 @@ public void onCreate() {

@Override
public void onDestroy() {
Logger.i("NotificationEventListenerService onDestroy()");
super.onDestroy();
LocalBroadcastManager.getInstance(getApplicationContext()).unregisterReceiver(mReceiver);
if (dataList.size() > 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
import android.support.annotation.RequiresApi;
import android.support.v4.content.LocalBroadcastManager;

import com.orhanobut.logger.Logger;

@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
public class InterruptionFilterSwitcherService extends NotificationListenerService {
private static final String ACTION_CHANGE = "ryey.easer.plugins.operation.ringer_mode.action.CHANGE";
Expand Down Expand Up @@ -54,24 +56,28 @@ public void onListenerConnected() {

@Override
public IBinder onBind(Intent intent) {
Logger.i("InterruptionFilterSwitcherService onBind()");
is_running = true;
return super.onBind(intent);
}

@Override
public boolean onUnbind(Intent intent) {
Logger.i("InterruptionFilterSwitcherService onUnbind()");
is_running = false;
return super.onUnbind(intent);
}

@Override
public void onCreate() {
Logger.i("InterruptionFilterSwitcherService onCreate()");
super.onCreate();
LocalBroadcastManager.getInstance(getApplicationContext()).registerReceiver(mReceiver, mFilter);
}

@Override
public void onDestroy() {
Logger.i("InterruptionFilterSwitcherService onDestroy()");
super.onDestroy();
LocalBroadcastManager.getInstance(getApplicationContext()).unregisterReceiver(mReceiver);
}
Expand Down

0 comments on commit 01cc52c

Please sign in to comment.