|
@@ -75,6 +75,10 @@ public class DataManager extends Application {
|
|
|
return appModelList;
|
|
|
}
|
|
|
|
|
|
+ public static List<AppModel> getInstalledApps() {
|
|
|
+ return mInstalledAppsList;
|
|
|
+ }
|
|
|
+
|
|
|
public static List<ContactModel> loadRecent() {
|
|
|
if (Constant.DEBUG) {
|
|
|
List<ContactModel> recentList = new ArrayList<>();
|
|
@@ -151,10 +155,15 @@ public class DataManager extends Application {
|
|
|
|
|
|
public static void replaceQuickApps(int viewIndex, int appIndex, AppModel appModel) {
|
|
|
mQuickAppsList.set(viewIndex * (Constant.COUNT_VIEW_APP) + appIndex, appModel.copy());
|
|
|
- }
|
|
|
|
|
|
- public static List<AppModel> getInstalledApps() {
|
|
|
- return mInstalledAppsList;
|
|
|
+ //保存数据库
|
|
|
+ StringBuilder s = new StringBuilder();
|
|
|
+ for (AppModel model: mQuickAppsList) {
|
|
|
+ s.append(model.getPackageName()).append(";");
|
|
|
+ }
|
|
|
+ if (!Constant.DEBUG) {
|
|
|
+ DatabaseHelper.update(sContext, MetaData.KEY_SETTING_QUICKAPP, s.toString());
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public static List<AppModel> getQuickApps() {
|
|
@@ -225,6 +234,9 @@ public class DataManager extends Application {
|
|
|
|
|
|
public static void setFaceIndex(int index) {
|
|
|
mFaceIndex = index;
|
|
|
+ if (!Constant.DEBUG) {
|
|
|
+ DatabaseHelper.update(sContext, MetaData.KEY_SETTING_WATCHFACE, String.valueOf(index));
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public static void loadWeatherIndex() {
|