Loading services/core/java/com/android/server/ondeviceintelligence/RemoteOnDeviceIntelligenceService.java +7 −3 Original line number Diff line number Diff line Loading @@ -22,11 +22,14 @@ import static android.content.Context.BIND_INCLUDE_CAPABILITIES; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.provider.Settings; import android.service.ondeviceintelligence.IOnDeviceIntelligenceService; import android.service.ondeviceintelligence.OnDeviceIntelligenceService; import com.android.internal.infra.ServiceConnector; import java.util.concurrent.TimeUnit; /** * Manages the connection to the remote on-device intelligence service. Also, handles unbinding * logic set by the service implementation via a Secure Settings flag. Loading @@ -49,8 +52,9 @@ public class RemoteOnDeviceIntelligenceService extends @Override protected long getAutoDisconnectTimeoutMs() { // Disable automatic unbinding. // TODO: add logic to fetch this flag via SecureSettings. return -1; return Settings.Secure.getLongForUser(mContext.getContentResolver(), Settings.Secure.ON_DEVICE_INTELLIGENCE_UNBIND_TIMEOUT_MS, TimeUnit.SECONDS.toMillis(30), mContext.getUserId()); } } services/core/java/com/android/server/ondeviceintelligence/RemoteOnDeviceSandboxedInferenceService.java +9 −5 Original line number Diff line number Diff line Loading @@ -22,14 +22,18 @@ import static android.content.Context.BIND_INCLUDE_CAPABILITIES; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.provider.Settings; import android.service.ondeviceintelligence.IOnDeviceSandboxedInferenceService; import android.service.ondeviceintelligence.OnDeviceSandboxedInferenceService; import com.android.internal.infra.ServiceConnector; import java.util.concurrent.TimeUnit; /** * Manages the connection to the remote on-device sand boxed inference service. Also, handles unbinding * Manages the connection to the remote on-device sand boxed inference service. Also, handles * unbinding * logic set by the service implementation via a SecureSettings flag. */ public class RemoteOnDeviceSandboxedInferenceService extends Loading @@ -54,11 +58,11 @@ public class RemoteOnDeviceSandboxedInferenceService extends connect(); } @Override protected long getAutoDisconnectTimeoutMs() { // Disable automatic unbinding. // TODO: add logic to fetch this flag via SecureSettings. return -1; return Settings.Secure.getLongForUser(mContext.getContentResolver(), Settings.Secure.ON_DEVICE_INFERENCE_UNBIND_TIMEOUT_MS, TimeUnit.SECONDS.toMillis(30), mContext.getUserId()); } } Loading
services/core/java/com/android/server/ondeviceintelligence/RemoteOnDeviceIntelligenceService.java +7 −3 Original line number Diff line number Diff line Loading @@ -22,11 +22,14 @@ import static android.content.Context.BIND_INCLUDE_CAPABILITIES; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.provider.Settings; import android.service.ondeviceintelligence.IOnDeviceIntelligenceService; import android.service.ondeviceintelligence.OnDeviceIntelligenceService; import com.android.internal.infra.ServiceConnector; import java.util.concurrent.TimeUnit; /** * Manages the connection to the remote on-device intelligence service. Also, handles unbinding * logic set by the service implementation via a Secure Settings flag. Loading @@ -49,8 +52,9 @@ public class RemoteOnDeviceIntelligenceService extends @Override protected long getAutoDisconnectTimeoutMs() { // Disable automatic unbinding. // TODO: add logic to fetch this flag via SecureSettings. return -1; return Settings.Secure.getLongForUser(mContext.getContentResolver(), Settings.Secure.ON_DEVICE_INTELLIGENCE_UNBIND_TIMEOUT_MS, TimeUnit.SECONDS.toMillis(30), mContext.getUserId()); } }
services/core/java/com/android/server/ondeviceintelligence/RemoteOnDeviceSandboxedInferenceService.java +9 −5 Original line number Diff line number Diff line Loading @@ -22,14 +22,18 @@ import static android.content.Context.BIND_INCLUDE_CAPABILITIES; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.provider.Settings; import android.service.ondeviceintelligence.IOnDeviceSandboxedInferenceService; import android.service.ondeviceintelligence.OnDeviceSandboxedInferenceService; import com.android.internal.infra.ServiceConnector; import java.util.concurrent.TimeUnit; /** * Manages the connection to the remote on-device sand boxed inference service. Also, handles unbinding * Manages the connection to the remote on-device sand boxed inference service. Also, handles * unbinding * logic set by the service implementation via a SecureSettings flag. */ public class RemoteOnDeviceSandboxedInferenceService extends Loading @@ -54,11 +58,11 @@ public class RemoteOnDeviceSandboxedInferenceService extends connect(); } @Override protected long getAutoDisconnectTimeoutMs() { // Disable automatic unbinding. // TODO: add logic to fetch this flag via SecureSettings. return -1; return Settings.Secure.getLongForUser(mContext.getContentResolver(), Settings.Secure.ON_DEVICE_INFERENCE_UNBIND_TIMEOUT_MS, TimeUnit.SECONDS.toMillis(30), mContext.getUserId()); } }