48 lines
1.4 KiB
Java
48 lines
1.4 KiB
Java
package pawletos.device;
|
|
|
|
import android.content.Context;
|
|
import android.os.SystemProperties;
|
|
|
|
/**
|
|
* PawletOS Device API for apps running on PawletOS builds.
|
|
*/
|
|
public class PawletDevice {
|
|
|
|
/**
|
|
* Get the brand name.
|
|
*/
|
|
public static String getBrandName(Context ctx) {
|
|
int resId = ctx.getResources().getIdentifier("oxmc_brand_name", "string", ctx.getPackageName());
|
|
if (resId != 0) {
|
|
return ctx.getString(resId);
|
|
}
|
|
return "PawletOS";
|
|
}
|
|
|
|
/**
|
|
* Get the codename.
|
|
*/
|
|
public static String getCodename(Context ctx) {
|
|
int resId = ctx.getResources().getIdentifier("oxmc_codename", "string", ctx.getPackageName());
|
|
if (resId != 0) {
|
|
return ctx.getString(resId);
|
|
}
|
|
return "generic-pawlet-device";
|
|
}
|
|
|
|
// ─────────────────────────────
|
|
// 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");
|
|
}
|
|
} |