chore: more debug output of states
This commit is contained in:
@@ -63,6 +63,8 @@ public class LstForegroundService extends Service implements SensorEventListener
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
|
||||
Log.i("LstForegroundService", "onCreate()");
|
||||
|
||||
int resid = R.raw.track_beat;
|
||||
PlaybackEngine.create(this, resid);
|
||||
stepDetector = new StepDetector(PlaybackEngine.getEngineHandle());
|
||||
@@ -89,6 +91,8 @@ public class LstForegroundService extends Service implements SensorEventListener
|
||||
if (intent != null) {
|
||||
String action = intent.getAction();
|
||||
if (ACTION_START.equals(action)) {
|
||||
Log.i("LstForegroundService", "onStartCommand() ACTION_START");
|
||||
|
||||
String contentUri = intent.getStringExtra("content_uri");
|
||||
try {
|
||||
if(contentUri != null) {
|
||||
@@ -101,6 +105,7 @@ public class LstForegroundService extends Service implements SensorEventListener
|
||||
}
|
||||
startCollection(contentUri);
|
||||
} else if (ACTION_STOP.equals(action)) {
|
||||
Log.i("LstForegroundService", "ACTION_STOP");
|
||||
stopCollectionAndSelf();
|
||||
}
|
||||
}
|
||||
@@ -200,6 +205,7 @@ public class LstForegroundService extends Service implements SensorEventListener
|
||||
@Nullable
|
||||
@Override
|
||||
public IBinder onBind(Intent intent) {
|
||||
Log.i("LstForegroundService", "onBind()");
|
||||
return binder;
|
||||
}
|
||||
|
||||
|
||||
@@ -118,6 +118,16 @@ public class MainActivity extends AppCompatActivity implements LstForegroundServ
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
unbindService(conn);
|
||||
Log.i("MainActivity", "onStop()");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
Log.i("MainActivity", "onDestroy()");
|
||||
|
||||
// TODO: since the Service keeps running, we must signal oboe to stop playing
|
||||
// TODO: signal the pause to the C++ lib
|
||||
}
|
||||
|
||||
private boolean isForeground = false;
|
||||
@@ -125,10 +135,9 @@ public class MainActivity extends AppCompatActivity implements LstForegroundServ
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
isForeground = false;
|
||||
// TODO: since the Service keeps running, we must signal oboe to stop playing
|
||||
// TODO: signal the pause to the C++ lib
|
||||
//
|
||||
// telltale signs: logcat: "PlaybackEngine - Buffer overrun on output for channel (0.000000)" or (1.000000)
|
||||
Log.i("MainActivity", "onPause()");
|
||||
}
|
||||
@Override
|
||||
protected void onResume() {
|
||||
|
||||
Reference in New Issue
Block a user