|
|
@ -850,7 +850,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
|
|
|
@OnLifecycleEvent(Lifecycle.Event.ON_ANY)
|
|
|
|
@OnLifecycleEvent(Lifecycle.Event.ON_ANY)
|
|
|
|
public void onStateChanged() {
|
|
|
|
public void onStateChanged() {
|
|
|
|
Lifecycle.State state = mowner.getLifecycle().getCurrentState();
|
|
|
|
Lifecycle.State state = mowner.getLifecycle().getCurrentState();
|
|
|
|
EntityLog.log(ServiceSynchronize.this, EntityLog.Type.Debug, "Owner state=" + state);
|
|
|
|
EntityLog.log(ServiceSynchronize.this, EntityLog.Type.Debug1, "Owner state=" + state);
|
|
|
|
if (state.equals(Lifecycle.State.DESTROYED))
|
|
|
|
if (state.equals(Lifecycle.State.DESTROYED))
|
|
|
|
mowner.getLifecycle().removeObserver(this);
|
|
|
|
mowner.getLifecycle().removeObserver(this);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -872,7 +872,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void onChanged(boolean inCall) {
|
|
|
|
public void onChanged(boolean inCall) {
|
|
|
|
boolean suppress = prefs.getBoolean("notify_suppress_in_call", false);
|
|
|
|
boolean suppress = prefs.getBoolean("notify_suppress_in_call", false);
|
|
|
|
EntityLog.log(ServiceSynchronize.this, EntityLog.Type.Debug,
|
|
|
|
EntityLog.log(ServiceSynchronize.this, EntityLog.Type.Debug1,
|
|
|
|
"In call=" + inCall + " suppress=" + suppress);
|
|
|
|
"In call=" + inCall + " suppress=" + suppress);
|
|
|
|
isInCall = (inCall && suppress);
|
|
|
|
isInCall = (inCall && suppress);
|
|
|
|
boolean fg = Boolean.TRUE.equals(foreground.getValue());
|
|
|
|
boolean fg = Boolean.TRUE.equals(foreground.getValue());
|
|
|
@ -889,7 +889,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
|
|
|
boolean projection = (connectionState != null &&
|
|
|
|
boolean projection = (connectionState != null &&
|
|
|
|
connectionState == CarConnection.CONNECTION_TYPE_PROJECTION);
|
|
|
|
connectionState == CarConnection.CONNECTION_TYPE_PROJECTION);
|
|
|
|
boolean suppress = prefs.getBoolean("notify_suppress_in_car", false);
|
|
|
|
boolean suppress = prefs.getBoolean("notify_suppress_in_car", false);
|
|
|
|
EntityLog.log(ServiceSynchronize.this, EntityLog.Type.Debug,
|
|
|
|
EntityLog.log(ServiceSynchronize.this, EntityLog.Type.Debug1,
|
|
|
|
"Projection=" + projection + " state=" + connectionState + " suppress=" + suppress);
|
|
|
|
"Projection=" + projection + " state=" + connectionState + " suppress=" + suppress);
|
|
|
|
isInCar = (projection && suppress);
|
|
|
|
isInCar = (projection && suppress);
|
|
|
|
boolean fg = Boolean.TRUE.equals(foreground.getValue());
|
|
|
|
boolean fg = Boolean.TRUE.equals(foreground.getValue());
|
|
|
|