code: public static void checkDevice(Context context) {
          int version = Build.VERSION.SDK_INT;
          if (version < 8) {
              throw new UnsupportedOperationException("Device must be at least " +
                      "API Level 8 (instead of " + version + ")");
          }
          PackageManager packageManager = context.getPackageManager();
          try {
              packageManager.getPackageInfo(GSF_PACKAGE, 0);
          } catch (NameNotFoundException e) {
              throw new UnsupportedOperationException(
                      "Device does not have package " + GSF_PACKAGE);
          }
      }
docs: Checks if the device has the proper dependencies installed.
  <p>
  This method should be called when the application starts to verify that
  the device supports GCM.
  
  @param context application context.
  @throws UnsupportedOperationException if the device does not support GCM.