본문으로 건너뛰기
안드로이드 메인보드 · 터치 디스플레이 · 펌웨어 — 2013년부터

Kiosk and lockdown

Static methodsBroadcast — returns void

Turn a general-purpose board into a locked-down single-purpose device: hide the system UI, stop unwanted apps installing, and block USB storage.

Hide the system bars​

public static void setNavigationBarShow(Context context)
public static void setNavigationBarHide(Context context)
public static void setStatusBarShow(Context context)
public static void setStatusBarHide(Context context)
ItempApiPub.setStatusBarHide(context);
ItempApiPub.setNavigationBarHide(context);

Block app installation​

public static final int DISABLED_MODE = 0; // no blocking
public static final int WHITELIST_MODE = 1; // only listed packages may install
public static final int BLACKLIST_MODE = 2; // listed packages may not install

public static void intallBlock(Context context, String[] packages, int mode)
// Whitelist: allow only your own app to be installed/updated.
String[] allow = { "com.yourcompany.kioskapp" };
ItempApiPub.intallBlock(context, allow, ItempApiPub.WHITELIST_MODE);
// Turn blocking off.
ItempApiPub.intallBlock(context, null, ItempApiPub.DISABLED_MODE);

The method name is spelled intallBlock in the current API — match that spelling exactly in your code.

Block USB storage​

public static void setUsbStorageBlock(Context context, boolean enable)
ItempApiPub.setUsbStorageBlock(context, true); // ignore USB mass storage

Stops someone walking up with a USB stick and pulling files or side-loading.

Other lockdown helpers​

public static void pointerLocationEnable(Context context) // show touch dots (debug)
public static void pointerLocationDisable(Context context)
public static void cleanCache(Context context, List<String> packageNames)
// Clear cached data for specific packages.
List<String> pkgs = Arrays.asList("com.yourcompany.kioskapp");
ItempApiPub.cleanCache(context, pkgs);
Sending the cache-clear broadcast directly

If the cleanCache helper is not available in your build of the library, the same effect is achieved by sending the broadcast yourself:

Intent intent = new Intent("com.itemp.clear_user_data");
intent.putStringArrayListExtra("packageNames", new ArrayList<>(pkgs));
intent.setPackage("com.android.settings");
context.sendBroadcast(intent);

Wake-on-LAN​

public static void setWolEnable(Context context)
public static void setWolDisable(Context context)

Lets you wake a powered-off board with a magic packet from the LAN — pairs well with the power schedules for remote fleet management.

Notes​

These work without platform signing. Hiding bars and blocking installs are privileged actions, but our firmware is rooted, so a normally-signed app can call them and they take effect — see Permissions and signing. You do not need our platform key.

Leave yourself a way back in. If you hide both bars and block installs, make sure your own app has an exit path (a hidden gesture, a timed unlock) before you deploy — otherwise recovering the device means reflashing.