Permalink
Browse files

Dynamically tell the user which vendor image is needed

*parse the build fingerprint for the required vendor id

Thanks to @dwitherell for help with the parsing logic :)

this is an extension of my previous commit PureNexusProject/android_frameworks_base@33c703f
which is required for this commit

Change-Id: I54da1e332ba3e14943cc5135f2ec05b314ce0d5e
  • Loading branch information...
beanstown106 authored and xlxfoxxlx committed Jul 20, 2016
1 parent 5ac1599 commit a4d6ee773a13d0c409307db0fb915ffb0f3293f6
@@ -53,5 +53,5 @@
<string name="permdesc_resetBatteryStats">Allows an application to reset the current low-level battery use data.</string>
<!-- Vendor mismatched fingerprint warning [CHAR LIMIT=NONE] -->
<string name="system_error_vendorprint">It appears your vendor image may be out of date. Please flash the latest vendor image for your device.</string>
<string name="system_error_vendorprint">Your vendor image does not match the system. Please flash the <xliff:g id="string">%s</xliff:g> vendor image for your device</string>
</resources>
@@ -1714,11 +1714,14 @@ public void handleMessage(Message msg) {
} break;
case SHOW_FINGERPRINT_ERROR_UI_MSG: {
if (mShowDialogs) {
String buildfingerprint = SystemProperties.get("ro.build.fingerprint");
String[] splitfingerprint = buildfingerprint.split("/");
String vendorid = splitfingerprint[3];
AlertDialog d = new BaseErrorDialog(mContext);
d.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ERROR);
d.setCancelable(false);
d.setTitle(mContext.getText(R.string.android_system_label));
d.setMessage(mContext.getText(R.string.system_error_vendorprint));
d.setMessage(mContext.getString(R.string.system_error_vendorprint, vendorid));
d.setButton(DialogInterface.BUTTON_POSITIVE, mContext.getText(R.string.ok),
obtainMessage(DISMISS_DIALOG_UI_MSG, d));
d.show();

0 comments on commit a4d6ee7

Please sign in to comment.