Skip to content

Commit

Permalink
fix: android auto service binding fix (#360)
Browse files Browse the repository at this point in the history
  • Loading branch information
illuminati1911 authored Nov 28, 2024
1 parent e3cd86a commit 5f0b2a8
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,18 @@ public SampleAndroidAutoSession(SessionInfo sessionInfo) {
@Override
public void onCreate(@NonNull LifecycleOwner lifecycleOwner) {
Log.i(TAG, "In onCreate()");
}

@Override
public void onStart(@NonNull LifecycleOwner lifecycleOwner) {
Log.i(TAG, "In onStart()");
getCarContext()
.bindService(
new Intent(getCarContext(), SampleAndroidAutoService.class),
mServiceConnection,
Context.BIND_AUTO_CREATE);
}

@Override
public void onStart(@NonNull LifecycleOwner lifecycleOwner) {
Log.i(TAG, "In onStart()");
}

@Override
public void onResume(@NonNull LifecycleOwner lifecycleOwner) {
Log.i(TAG, "In onResume()");
Expand All @@ -74,12 +74,12 @@ public void onPause(@NonNull LifecycleOwner lifecycleOwner) {
@Override
public void onStop(@NonNull LifecycleOwner lifecycleOwner) {
Log.i(TAG, "In onStop()");
getCarContext().unbindService(mServiceConnection);
}

@Override
public void onDestroy(@NonNull LifecycleOwner lifecycleOwner) {
Log.i(TAG, "In onDestroy()");
getCarContext().unbindService(mServiceConnection);
}
};

Expand Down

0 comments on commit 5f0b2a8

Please sign in to comment.