summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Thrun <jthrun@uievolution.com>2017-10-14 21:23:17 -0700
committerJohn Thrun <jthrun@uievolution.com>2017-10-14 21:23:17 -0700
commit5def73b8d9ffe4027c899fc7ef59a2510da6fbf6 (patch)
tree445e3471718948da56ab99cf4f9897f27b05c470
parent0e96dc4514ac21babe32ad6612bd62c99f0d4d31 (diff)
downloadsdl_android-5def73b8d9ffe4027c899fc7ef59a2510da6fbf6.tar.gz
Fix timing of call to refreshHapticData() .
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyBase.java18
1 files changed, 14 insertions, 4 deletions
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyBase.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyBase.java
index cb8e2c6f3..9bc41c294 100644
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyBase.java
+++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyBase.java
@@ -6309,11 +6309,16 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
FutureTask<Boolean> fTask = new FutureTask<Boolean>( new SdlRemoteDisplay.Creator(context, disp, remoteDisplay, remoteDisplayClass, new SdlRemoteDisplay.Callback(){
@Override
- public void onCreated(SdlRemoteDisplay remoteDisplay) {
+ public void onCreated(final SdlRemoteDisplay remoteDisplay) {
//Remote display has been created.
//Now is a good time to do parsing for spatial data
VideoStreamingManager.this.remoteDisplay = remoteDisplay;
- hapticManager.refreshHapticData(remoteDisplay.getMainView());
+ remoteDisplay.getMainView().post(new Runnable() {
+ @Override
+ public void run() {
+ hapticManager.refreshHapticData(remoteDisplay.getMainView());
+ }
+ });
//Get touch scalars
ImageResolution resolution = null;
@@ -6336,10 +6341,15 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
}
@Override
- public void onInvalidated(SdlRemoteDisplay remoteDisplay) {
+ public void onInvalidated(final SdlRemoteDisplay remoteDisplay) {
//Our view has been invalidated
//A good time to refresh spatial data
- hapticManager.refreshHapticData(remoteDisplay.getMainView());
+ remoteDisplay.getMainView().post(new Runnable() {
+ @Override
+ public void run() {
+ hapticManager.refreshHapticData(remoteDisplay.getMainView());
+ }
+ });
}
} ));
Thread showPresentation = new Thread(fTask);