1 package com.android.launcher3; 2 3 import java.util.ArrayList; 4 import java.util.Arrays; 5 import java.util.Collections; 6 import java.util.List; 7 8 /** 9 * Central list of files the Launcher writes to the application data directory. 10 * 11 * To add a new Launcher file, create a String constant referring to the filename, and add it to 12 * ALL_FILES, as shown below. 13 */ 14 public class LauncherFiles { 15 16 private static final String XML = ".xml"; 17 18 public static final String LAUNCHER_DB = "launcher.db"; 19 public static final String LAUNCHER_6_BY_5_DB = "launcher_6_by_5.db"; 20 public static final String LAUNCHER_4_BY_5_DB = "launcher_4_by_5.db"; 21 public static final String LAUNCHER_4_BY_4_DB = "launcher_4_by_4.db"; 22 public static final String LAUNCHER_3_BY_3_DB = "launcher_3_by_3.db"; 23 public static final String LAUNCHER_2_BY_2_DB = "launcher_2_by_2.db"; 24 public static final String BACKUP_DB = "backup.db"; 25 public static final String SHARED_PREFERENCES_KEY = "com.android.launcher3.prefs"; 26 public static final String MANAGED_USER_PREFERENCES_KEY = 27 "com.android.launcher3.managedusers.prefs"; 28 // This preference file is not backed up to cloud. 29 public static final String DEVICE_PREFERENCES_KEY = "com.android.launcher3.device.prefs"; 30 31 public static final String WIDGET_PREVIEWS_DB = "widgetpreviews.db"; 32 public static final String APP_ICONS_DB = "app_icons.db"; 33 34 public static final List<String> GRID_DB_FILES = Collections.unmodifiableList(Arrays.asList( 35 LAUNCHER_DB, 36 LAUNCHER_6_BY_5_DB, 37 LAUNCHER_4_BY_5_DB, 38 LAUNCHER_4_BY_4_DB, 39 LAUNCHER_3_BY_3_DB, 40 LAUNCHER_2_BY_2_DB)); 41 42 public static final List<String> OTHER_FILES = Collections.unmodifiableList(Arrays.asList( 43 BACKUP_DB, 44 SHARED_PREFERENCES_KEY + XML, 45 WIDGET_PREVIEWS_DB, 46 MANAGED_USER_PREFERENCES_KEY + XML, 47 DEVICE_PREFERENCES_KEY + XML, 48 APP_ICONS_DB)); 49 createAllFiles()50 private static List<String> createAllFiles() { 51 ArrayList<String> result = new ArrayList<>(); 52 result.addAll(GRID_DB_FILES); 53 result.addAll(OTHER_FILES); 54 return Collections.unmodifiableList(result); 55 } 56 57 public static final List<String> ALL_FILES = createAllFiles(); 58 } 59