Merge "PointerLocation: move showing exclusion rects behind flag" into qt-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
b7ae1efc96
@@ -26,6 +26,7 @@ import android.graphics.RectF;
|
|||||||
import android.graphics.Region;
|
import android.graphics.Region;
|
||||||
import android.hardware.input.InputManager;
|
import android.hardware.input.InputManager;
|
||||||
import android.hardware.input.InputManager.InputDeviceListener;
|
import android.hardware.input.InputManager.InputDeviceListener;
|
||||||
|
import android.os.Handler;
|
||||||
import android.os.RemoteException;
|
import android.os.RemoteException;
|
||||||
import android.os.SystemProperties;
|
import android.os.SystemProperties;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
@@ -745,11 +746,16 @@ public class PointerLocationView extends View implements InputDeviceListener,
|
|||||||
super.onAttachedToWindow();
|
super.onAttachedToWindow();
|
||||||
|
|
||||||
mIm.registerInputDeviceListener(this, getHandler());
|
mIm.registerInputDeviceListener(this, getHandler());
|
||||||
try {
|
if (shouldShowSystemGestureExclusion()) {
|
||||||
WindowManagerGlobal.getWindowManagerService().registerSystemGestureExclusionListener(
|
try {
|
||||||
mSystemGestureExclusionListener, mContext.getDisplayId());
|
WindowManagerGlobal.getWindowManagerService()
|
||||||
} catch (RemoteException e) {
|
.registerSystemGestureExclusionListener(mSystemGestureExclusionListener,
|
||||||
throw e.rethrowFromSystemServer();
|
mContext.getDisplayId());
|
||||||
|
} catch (RemoteException e) {
|
||||||
|
throw e.rethrowFromSystemServer();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
mSystemGestureExclusion.setEmpty();
|
||||||
}
|
}
|
||||||
logInputDevices();
|
logInputDevices();
|
||||||
}
|
}
|
||||||
@@ -798,6 +804,10 @@ public class PointerLocationView extends View implements InputDeviceListener,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static boolean shouldShowSystemGestureExclusion() {
|
||||||
|
return SystemProperties.getBoolean("debug.pointerlocation.showexclusion", false);
|
||||||
|
}
|
||||||
|
|
||||||
// HACK
|
// HACK
|
||||||
// A quick and dirty string builder implementation optimized for GC.
|
// A quick and dirty string builder implementation optimized for GC.
|
||||||
// Using String.format causes the application grind to a halt when
|
// Using String.format causes the application grind to a halt when
|
||||||
@@ -920,11 +930,14 @@ public class PointerLocationView extends View implements InputDeviceListener,
|
|||||||
@Override
|
@Override
|
||||||
public void onSystemGestureExclusionChanged(int displayId, Region systemGestureExclusion) {
|
public void onSystemGestureExclusionChanged(int displayId, Region systemGestureExclusion) {
|
||||||
Region exclusion = Region.obtain(systemGestureExclusion);
|
Region exclusion = Region.obtain(systemGestureExclusion);
|
||||||
getHandler().post(() -> {
|
Handler handler = getHandler();
|
||||||
mSystemGestureExclusion.set(exclusion);
|
if (handler != null) {
|
||||||
exclusion.recycle();
|
handler.post(() -> {
|
||||||
invalidate();
|
mSystemGestureExclusion.set(exclusion);
|
||||||
});
|
exclusion.recycle();
|
||||||
|
invalidate();
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user