1. Description of the problem:
OTA upgrade from a high version to a lower version of the success, after the desktop alarm icon is missing, and the desktop alarm clock error, unable to open the app.
The
reference log is as follows:
01-14 20:29:22.290:e/androidruntime (2722): FATAL exception:asynchandler
01-14 20:29:22.290:e/androidruntime (2722): Process:com.android.deskclock, pid:2722
01-14 20:29:22.290:e/androidruntime (2722): Android.database.sqlite.SQLiteException:Can ' t downgrade database From version 7
01-14 20:29:22.290:e/androidruntime (2722): at Android.database.sqlite.SQLiteOpenHelper.onDowngrade ( sqliteopenhelper.java:361)
01-14 20:29:22.290:e/androidruntime (2722): at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked ( sqliteopenhelper.java:255)
01-14 20:29:22.290:e/androidruntime (2722): at Android.database.sqlite.SQLiteOpenHelper.getReadableDatabase ( sqliteopenhelper.java:188)
01-14 20:29:22.290:e/androidruntime (2722): at Com.android.deskclock.provider.ClockProvider.query ( clockprovider.java:96)
01-14 20:29:22.290:e/androidruntime (2722): at Android.content.ContentProvider.query (contentprovider.java:922)
01-14 20:29:22.290:e/androidruntime (2722): at Android.content.contentprovider$transport.query ( contentprovider.java:213)
01-14 20:29:22.290:e/androidruntime (2722): at Android.content.ContentResolver.query (contentresolver.java:462)
01-14 20:29:22.290:e/androidruntime (2722): at Android.content.ContentResolver.query (contentresolver.java:405)
01-14 20:29:22.290:e/androidruntime (2722): at Com.android.deskclock.provider.AlarmInstance.getInstances ( alarminstance.java:188)
01-14 20:29:22.290:e/androidruntime (2722): at Com.android.deskclock.alarms.AlarmStateManager.FixAlarmInstancesForReboot (alarmstatemanager.java:684)
01-14 20:29:22.290:e/androidruntime (2722): at Com.android.deskclock.alarminitreceiver$1.run ( alarminitreceiver.java:102)
01-14 20:29:22.290:e/androidruntime (2722): at Android.os.Handler.handleCallback (handler.java:808)
01-14 20:29:22.290:e/androidruntime (2722): at Android.os.Handler.dispatchMessage (handler.java:103)
01-14 20:29:22.290:e/androidruntime (2722): at Android.os.Looper.loop (looper.java:193)
01-14 20:29:22.290:e/androidruntime (2722): at Android.os.HandlerThread.run (handlerthread.java:61)
2. Analysis results:
As can be seen from the log above, this type of exception is caused by the database cannot be degraded, at which time the factory reset can return to normal. 3. Solution You can circumvent the problem by overriding the Ondowngrade () method of the parent class Sqliteopenhelper.java in Databasehelper.java, or modify the method directly in Sqliteopenhelper.java.
Public
void Ondowngrade (sqlitedatabase db, int oldversion, int newversion) {
throw new SQ Liteexception ("Can ' t downgrade database from version" +
oldversion + "to" + NewVersion);}
About OTA upgrade exception analysis due to database not degraded after upgrading from high to low version