Search code examples
androidgoogle-chrome-arc

How to know when my app is executing on Google-Chrome-ARC?


I want to have some different behaviors if my app executes on Google-Chrome-ARC.

I currently get the IMEI, which is null on ARC.

public boolean isArc(Context context) {
  TelephonyManager tm = ((TelephonyManager)context
           .getSystemService(Context.TELEPHONY_SERVICE));
  String imei = tm.getDeviceId();
  return imei == null;
}

But is it reliable?


Solution

  • Quoting the documentation:

    If you need to check if your app is running on Chrome OS, look for chromium as the android.os.Build.BRAND and android.os.Build.MANUFACTURER.

    I would not rely upon a null device ID.