Reprint Please specify source: http://blog.csdn.net/droyon/article/details/35558375
1. Create a global table for the owner only.
Only create the global table for the singleton ' owner ' user //created for the owner of the global table only. if (Muserhandle = = Userhandle.user_owner) { createglobaltable (db); }
2,//If we are encrypting the device, only the "core" application can be run. Onlycore is True
if (!onlycore) { loadbookmarks (db); }
3. A secure table was created at Settings.db's upgradeversion of 26 o'clock. Transfer some of the configuration items to secure at UpgradeVersion 27, 52, and 55 o'clock.
UpgradeVersion = 70 o'clock, update bookmarks
4. The global table was created at Settings.db's upgradeversion = 82 o'clock. Move to Per-user settings dbs
Create Movetosystem or Movetosecure in Settings.java, and pass Settingsprovider to Databasehelper.
UpgradeVersion = 84, 87,89, 90, 93 o'clock, ported from secure to global.
UpgradeVersion = 85, 88, 90, 91, 93 o'clock, ported from system to global.
5, <fraction name= "Def_window_animation_scale" >100%</fraction>
6, the definition of variables in Settingsprovider, note that the prefix and suffix are important, remember.
The items that match the prefix specification are ported to secure based on the prefix in the search.
private void Moveprefixedsettingstonewtable (Sqlitedatabase db, String SourceTable, String desttable, string[] Prefixestomove) {sqlitestatement insertstmt = null; Sqlitestatement deletestmt = null; Db.begintransaction (); try {insertstmt = db.compilestatement ("INSERT into" + DestTable + "(name,value) SELECT NA Me,value from "+ SourceTable +" WHERE substr (name,0,?) =?"); deletestmt = Db.compilestatement ("DELETE from" + SourceTable + "WHERE substr (name,0,?) =?"); for (String prefix:prefixestomove) {insertstmt.bindlong (1, prefix.length () + 1); Insertstmt.bindstring (2, prefix); Insertstmt.execute (); Deletestmt.bindlong (1, prefix.length () + 1); Deletestmt.bindstring (2, prefix); Deletestmt.execute (); } db.settransactionsuccessful (); } finally {db.endtransaction (); if (insertstmt! = null) {insertstmt.close (); } if (deletestmt! = null) {deletestmt.close (); } } }