65 lines
1.8 KiB
Java
65 lines
1.8 KiB
Java
package pawletos.device;
|
|
|
|
import android.content.Context;
|
|
import android.os.Build;
|
|
import android.os.SystemProperties;
|
|
|
|
/**
|
|
* PawletOS Environment API for apps running on PawletOS builds.
|
|
*/
|
|
public class OxmcEnvironment {
|
|
private static final String OXMC_OS_NAME = "PawletOS";
|
|
private static final int OXMC_OS_VERSION = 16;
|
|
|
|
/**
|
|
* Check if device is running PawletOS.
|
|
*/
|
|
public static boolean isPawletOS() {
|
|
return "PawletOS".equalsIgnoreCase(Build.MANUFACTURER)
|
|
|| "PawletOS".equalsIgnoreCase(OXMC_OS_NAME);
|
|
}
|
|
|
|
/**
|
|
* Get the PawletOS version.
|
|
*/
|
|
public static int getPawletVersion() {
|
|
return OXMC_OS_VERSION;
|
|
}
|
|
|
|
/**
|
|
* Get a welcome message from framework resources.
|
|
*/
|
|
public static String getWelcomeMessage(Context ctx) {
|
|
return ctx.getString(android.R.string.oxmc_device_message);
|
|
}
|
|
|
|
/**
|
|
* Get the brand name.
|
|
*/
|
|
public static String getBrandName(Context ctx) {
|
|
return ctx.getString(android.R.string.oxmc_brand_name);
|
|
}
|
|
|
|
/**
|
|
* Get the codename (e.g., PV16).
|
|
*/
|
|
public static String getCodename(Context ctx) {
|
|
return ctx.getString(android.R.string.oxmc_codename);
|
|
}
|
|
|
|
// ─────────────────────────────
|
|
// Custom build property access
|
|
// ─────────────────────────────
|
|
|
|
public static String getManufactureDate() {
|
|
return SystemProperties.get("ro.oxmc.build.manufacture_date", "unknown");
|
|
}
|
|
|
|
public static String getWarrantyExclusion() {
|
|
return SystemProperties.get("ro.oxmc.build.warranty_exclusion", "none");
|
|
}
|
|
|
|
public static String getSeries() {
|
|
return SystemProperties.get("ro.oxmc.build.series", "generic");
|
|
}
|
|
} |