Class Overview
This class provides APIs to support remote injection of key, pointer,
and trackball events into the device UI.
Summary
[Expand]
Inherited Methods |
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
|
Public Methods
public
boolean
injectKeyEvent
(KeyEvent ev, boolean sync)
API to inject a key event into the device UI.
Parameters
ev
| Key event describing the keystroke action. |
sync
| If true , waits for the event to be completed before returning to
the caller. Otherwise, returns immediately without blocking. |
Returns
true
if event was dispatched, false
if it was dropped
for any reason.
Usage
An administrator can use this API to inject key events into the device remotely.
Setting sync to false causes the method to block while waiting for a current
input event to be dispatched.
Example client call:
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
RemoteInjection remoteInjection = edm.getRemoteInjection();
try {
int keycode = KeyEvent.KEYCODE_0;
remoteInjection.injectKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, keycode), true);
} catch (SecurityException se) {
Log.w(TAG,"Exception: " + se);
}
|
Permission
The use of this API requires the caller to have the
"com.samsung.android.knox.permission.KNOX_REMOTE_CONTROL" permission which has a protection
level of signature. |
public
boolean
injectKeyEventDex
(KeyEvent ev, boolean sync)
API to inject a key event into the Dex screen UI.
Parameters
ev
| Key event describing the keystroke action. |
sync
| If true , waits for the event to be completed before returning to
the caller. Otherwise, returns immediately without blocking. |
Returns
true
if event was dispatched, false
if it was dropped
for any reason.
Usage
An administrator can use this API to inject key events into the Dex screen of device remotely when Dex mode is ON.
Setting sync to false causes the method to block while waiting for a current
input event to be dispatched.
Note : Some key injection events can only be injected
in device screen (like power key).
Example client call:
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
RemoteInjection remoteInjection = edm.getRemoteInjection();
try {
int keycode = KeyEvent.KEYCODE_0;
remoteInjection.injectKeyEventDex(new KeyEvent(KeyEvent.ACTION_DOWN, keycode), true);
} catch (SecurityException se) {
Log.w(TAG,"Exception: " + se);
}
|
Permission
The use of this API requires the caller to have the
"com.samsung.android.knox.permission.KNOX_ADVANCED_RESTRICTION" permission which has a protection
level of signature. |
public
boolean
injectPointerEvent
(MotionEvent ev, boolean sync)
API to inject a pointer (touch) event into the device UI.
Parameters
ev
| Motion event describing the pointer (touch) action. |
sync
| If true , waits for the event to be completed before returning
to the caller. Otherwise, returns immediately without blocking. |
Returns
- Returns
true
if event was dispatched, false
if
it was dropped for any reason.
Usage
An administrator can use this API to inject a pointer event into the device remotely.
Setting sync to false causes the method to block while waiting for the current
input event to be dispatched.
Example client call:
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
RemoteInjection remoteInjection = edm.getRemoteInjection();
try {
int x = 100, y = 200,flags = 0;
remoteInjection.injectPointerEvent(MotionEvent.obtain(SystemClock.uptimeMillis(),
SystemClock.uptimeMillis(), MotionEvent.ACTION_DOWN, x, y, flags), true);
} catch (SecurityException se) {
Log.w(TAG,"Exception: " + se);
}
|
Permission
The use of this API requires the caller to have the
"com.samsung.android.knox.permission.KNOX_REMOTE_CONTROL" permission which has a protection
level of signature. |
public
boolean
injectPointerEventDex
(MotionEvent ev, boolean sync)
API to inject a pointer (touch) event into the Dex screen UI.
Parameters
ev
| Motion event describing the pointer (touch) action. |
sync
| If true , waits for the event to be completed before returning
to the caller. Otherwise, returns immediately without blocking. |
Returns
- Returns
true
if event was dispatched, false
if
it was dropped for any reason.
Usage
An administrator can use this API to inject a pointer event into Dex screen of device remotely when Dex mode is ON.
Setting sync to false causes the method to block while waiting for the current
input event to be dispatched.
Example client call:
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
RemoteInjection remoteInjection = edm.getRemoteInjection();
try {
int x = 100, y = 200,flags = 0;
remoteInjection.injectPointerEventDex(MotionEvent.obtain(SystemClock.uptimeMillis(),
SystemClock.uptimeMillis(), MotionEvent.ACTION_DOWN, x, y, flags), true);
} catch (SecurityException se) {
Log.w(TAG,"Exception: " + se);
}
|
Permission
The use of this API requires the caller to have the
"com.samsung.android.knox.permission.KNOX_ADVANCED_RESTRICTION" permission which has a protection
level of signature. |
public
boolean
injectTrackballEvent
(MotionEvent ev, boolean sync)
API to inject a track ball (navigation device) event into the device UI.
Parameters
ev
| Trackball event describing the trackball action. |
sync
| If true , waits for the event to be completed before returning
to the caller. Otherwise, returns immediately without blocking. |
Returns
- Returns
true
if event was dispatched, false
if it
was dropped for any reason.
Usage
An administrator can use this API to inject a trackball event into the
device remotely. Setting sync to false causes the method to block
while waiting for the current input event to be dispatched.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
RemoteInjection remoteInjection = edm.getRemoteInjection();
try {
int x = 100, y = 200, flags = 0;
remoteInjection.injectTrackballEvent(MotionEvent.obtain(SystemClock.uptimeMillis(),
SystemClock.uptimeMillis(), MotionEvent.ACTION_DOWN, x, y, flags), true);
} catch (SecurityException se) {
Log.w(TAG,"Exception: " + se);
}
|
Permission
The use of this API requires the caller to have the
"com.samsung.android.knox.permission.KNOX_REMOTE_CONTROL" permission which has a
protection level of signature. |