summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--AriesParts/AndroidManifest.xml4
-rw-r--r--AriesParts/res/values/strings.xml9
-rw-r--r--AriesParts/src/com/cyanogenmod/settings/device/Sanity.java38
-rw-r--r--AriesParts/src/com/cyanogenmod/settings/device/Startup.java1
-rw-r--r--AriesParts/src/com/cyanogenmod/settings/device/WarnActivity.java43
-rw-r--r--BoardConfigCommon.mk5
6 files changed, 100 insertions, 0 deletions
diff --git a/AriesParts/AndroidManifest.xml b/AriesParts/AndroidManifest.xml
index 7debe38..137d83d 100644
--- a/AriesParts/AndroidManifest.xml
+++ b/AriesParts/AndroidManifest.xml
@@ -3,6 +3,7 @@
package="com.cyanogenmod.settings.device" android:sharedUserId="android.uid.system">
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS" />
+ <uses-permission android:name="android.permission.READ_PHONE_STATE" />
<application android:label="@string/app_name"
android:icon="@drawable/icon">
<activity android:name=".DeviceSettings"
@@ -14,5 +15,8 @@
</intent-filter>
</receiver>
<service android:name=".TvOutService" />
+ <activity android:name=".WarnActivity"
+ android:label="@string/generic_warning_title"
+ android:theme="@android:style/Theme.Translucent"></activity>
</application>
</manifest>
diff --git a/AriesParts/res/values/strings.xml b/AriesParts/res/values/strings.xml
index 80679a0..ef450f3 100644
--- a/AriesParts/res/values/strings.xml
+++ b/AriesParts/res/values/strings.xml
@@ -50,4 +50,13 @@
<string name="deskdock_audio_summary_on">Desk dock audio enabled</string>
<string name="deskdock_audio_summary_off">Desk dock audio disabled</string>
+ <!-- Used for activity title. Usually not visible, except on the
+ multi-task screen -->
+ <string name="generic_warning_title">Warning</string>
+
+ <!-- Invalid IMEI -->
+ <string name="imei_not_sane_title">Warning!</string>
+ <string name="imei_not_sane_message">A problem was detected with your device. Your device IMEI number is invalid. An invalid IMEI number could cause network issues including the inability to call emergency numbers.</string>
+ <string name="imei_not_sane_ok">OK</string>
+
</resources>
diff --git a/AriesParts/src/com/cyanogenmod/settings/device/Sanity.java b/AriesParts/src/com/cyanogenmod/settings/device/Sanity.java
new file mode 100644
index 0000000..981b884
--- /dev/null
+++ b/AriesParts/src/com/cyanogenmod/settings/device/Sanity.java
@@ -0,0 +1,38 @@
+package com.cyanogenmod.settings.device;
+
+import android.content.Context;
+import android.content.Intent;
+import android.telephony.TelephonyManager;
+import android.util.Log;
+
+public class Sanity {
+ private static final String TAG = "AriesParts";
+ private static final String BAD_IMEI[] = {
+ "004999010640000"
+ };
+
+ public static void check(Context context) {
+ TelephonyManager tm = (TelephonyManager) context.getSystemService(
+ Context.TELEPHONY_SERVICE);
+ String id = tm.getDeviceId();
+ if (tm.getPhoneType() == TelephonyManager.PHONE_TYPE_GSM && !ensureIMEISanity(id)) {
+ Log.e(TAG, "Invalid IMEI!");
+ Intent intent = new Intent(context, WarnActivity.class);
+ intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ intent.putExtra(WarnActivity.KEY_REASON, WarnActivity.REASON_INVALID_IMEI);
+ context.startActivity(intent);
+ return;
+ }
+ Log.d(TAG, "Device is sane.");
+ }
+
+ public static boolean ensureIMEISanity(String id) {
+ Log.d(TAG, "Current IMEI: " + id);
+ for (int j = 0; j < BAD_IMEI.length; j++) {
+ if (BAD_IMEI[j].equals(id)) {
+ return false;
+ }
+ }
+ return true;
+ }
+}
diff --git a/AriesParts/src/com/cyanogenmod/settings/device/Startup.java b/AriesParts/src/com/cyanogenmod/settings/device/Startup.java
index 901f47e..924a95d 100644
--- a/AriesParts/src/com/cyanogenmod/settings/device/Startup.java
+++ b/AriesParts/src/com/cyanogenmod/settings/device/Startup.java
@@ -14,6 +14,7 @@ public class Startup extends BroadcastReceiver {
Hspa.restore(context);
VolumeBoostPreference.restore(context);
DockAudio.restore(context);
+ Sanity.check(context);
}
}
diff --git a/AriesParts/src/com/cyanogenmod/settings/device/WarnActivity.java b/AriesParts/src/com/cyanogenmod/settings/device/WarnActivity.java
new file mode 100644
index 0000000..34488ee
--- /dev/null
+++ b/AriesParts/src/com/cyanogenmod/settings/device/WarnActivity.java
@@ -0,0 +1,43 @@
+package com.cyanogenmod.settings.device;
+
+import android.os.Bundle;
+import android.content.Intent;
+import android.app.Dialog;
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.view.Window;
+import android.content.DialogInterface;
+import android.util.Log;
+
+public class WarnActivity extends Activity {
+ public static final String KEY_REASON = "sanity_reason";
+ public static final String REASON_INVALID_IMEI = "invalid_imei";
+
+ @Override
+ public void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+ requestWindowFeature(Window.FEATURE_NO_TITLE);
+
+ Bundle extras = getIntent().getExtras();
+ String reason = extras.getString(KEY_REASON);
+
+ if (REASON_INVALID_IMEI.equals(reason)) {
+ showInvalidImei();
+ }
+ }
+
+ private void showInvalidImei() {
+ new AlertDialog.Builder(this)
+ .setTitle(getString(R.string.imei_not_sane_title))
+ .setMessage(getString(R.string.imei_not_sane_message))
+ .setPositiveButton(getString(R.string.imei_not_sane_ok),
+ new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int id) {
+ dialog.cancel();
+ finish();
+ }
+ })
+ .setCancelable(false)
+ .create().show();
+ }
+}
diff --git a/BoardConfigCommon.mk b/BoardConfigCommon.mk
index e4c9b3d..b3325fe 100644
--- a/BoardConfigCommon.mk
+++ b/BoardConfigCommon.mk
@@ -95,6 +95,11 @@ BOARD_CUSTOM_GRAPHICS := ../../../device/samsung/aries-common/recovery/graphics.
BOARD_USES_BML_OVER_MTD := true
BOARD_CUSTOM_BOOTIMG_MK := device/samsung/aries-common/shbootimg.mk
+# Boot Animation
+TARGET_BOOTANIMATION_PRELOAD := true
+TARGET_BOOTANIMATION_TEXTURE_CACHE := true
+TARGET_BOOTANIMATION_USE_RGB565 := true
+
# SkTextBox for libtvout
BOARD_USES_SKTEXTBOX := true