Helena Josol | 4fbbb3e | 2014-10-06 16:06:46 +0100 | [diff] [blame] | 1 | package com.android.launcher3; |
| 2 | |
Alex Chau | 238aaee | 2021-10-06 16:15:24 +0100 | [diff] [blame] | 3 | import java.util.ArrayList; |
Helena Josol | 4fbbb3e | 2014-10-06 16:06:46 +0100 | [diff] [blame] | 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 | |
Helena Josol | 28db280 | 2014-10-09 17:04:09 +0100 | [diff] [blame] | 16 | private static final String XML = ".xml"; |
| 17 | |
Helena Josol | 4fbbb3e | 2014-10-06 16:06:46 +0100 | [diff] [blame] | 18 | public static final String LAUNCHER_DB = "launcher.db"; |
fbaron | 04752a3 | 2024-11-05 10:53:44 -0800 | [diff] [blame] | 19 | public static final String LAUNCHER_5_BY_8_DB = "launcher_5_by_8.db"; |
Alex Chau | ab26c62 | 2021-12-10 18:54:49 +0000 | [diff] [blame] | 20 | public static final String LAUNCHER_6_BY_5_DB = "launcher_6_by_5.db"; |
Jon Miranda | ec1277e | 2021-03-25 10:41:54 -0400 | [diff] [blame] | 21 | public static final String LAUNCHER_4_BY_5_DB = "launcher_4_by_5.db"; |
fbaron | ebc10c9 | 2024-09-03 12:51:41 -0700 | [diff] [blame] | 22 | public static final String LAUNCHER_4_BY_6_DB = "launcher_4_by_6.db"; |
| 23 | public static final String LAUNCHER_5_BY_6_DB = "launcher_5_by_6.db"; |
Tracy Zhou | 7df93d2 | 2020-01-27 13:44:06 -0800 | [diff] [blame] | 24 | public static final String LAUNCHER_4_BY_4_DB = "launcher_4_by_4.db"; |
| 25 | public static final String LAUNCHER_3_BY_3_DB = "launcher_3_by_3.db"; |
| 26 | public static final String LAUNCHER_2_BY_2_DB = "launcher_2_by_2.db"; |
fbaron | d1cd8c2 | 2024-11-26 10:13:36 -0800 | [diff] [blame] | 27 | public static final String LAUNCHER_7_BY_3_DB = "launcher_7_by_3.db"; |
Sebastian Franco | 5353cd8 | 2024-11-15 12:42:40 -0800 | [diff] [blame] | 28 | public static final String LAUNCHER_8_BY_3_DB = "launcher_8_by_3.db"; |
Tracy Zhou | 7df93d2 | 2020-01-27 13:44:06 -0800 | [diff] [blame] | 29 | public static final String BACKUP_DB = "backup.db"; |
Helena Josol | 28db280 | 2014-10-09 17:04:09 +0100 | [diff] [blame] | 30 | public static final String SHARED_PREFERENCES_KEY = "com.android.launcher3.prefs"; |
Tracy Zhou | 7df93d2 | 2020-01-27 13:44:06 -0800 | [diff] [blame] | 31 | public static final String MANAGED_USER_PREFERENCES_KEY = |
| 32 | "com.android.launcher3.managedusers.prefs"; |
Sunny Goyal | a5c8a9e | 2016-07-08 08:32:44 -0700 | [diff] [blame] | 33 | // This preference file is not backed up to cloud. |
| 34 | public static final String DEVICE_PREFERENCES_KEY = "com.android.launcher3.device.prefs"; |
Sunny Goyal | 6a1e95a | 2015-03-20 17:26:30 -0700 | [diff] [blame] | 35 | |
Helena Josol | 4fbbb3e | 2014-10-06 16:06:46 +0100 | [diff] [blame] | 36 | public static final String WIDGET_PREVIEWS_DB = "widgetpreviews.db"; |
Sunny Goyal | 4fbc382 | 2015-02-18 16:46:50 -0800 | [diff] [blame] | 37 | public static final String APP_ICONS_DB = "app_icons.db"; |
Helena Josol | 4fbbb3e | 2014-10-06 16:06:46 +0100 | [diff] [blame] | 38 | |
Alex Chau | 238aaee | 2021-10-06 16:15:24 +0100 | [diff] [blame] | 39 | public static final List<String> GRID_DB_FILES = Collections.unmodifiableList(Arrays.asList( |
Helena Josol | 4fbbb3e | 2014-10-06 16:06:46 +0100 | [diff] [blame] | 40 | LAUNCHER_DB, |
fbaron | 04752a3 | 2024-11-05 10:53:44 -0800 | [diff] [blame] | 41 | LAUNCHER_5_BY_8_DB, |
Alex Chau | ab26c62 | 2021-12-10 18:54:49 +0000 | [diff] [blame] | 42 | LAUNCHER_6_BY_5_DB, |
Jon Miranda | ec1277e | 2021-03-25 10:41:54 -0400 | [diff] [blame] | 43 | LAUNCHER_4_BY_5_DB, |
fbaron | ebc10c9 | 2024-09-03 12:51:41 -0700 | [diff] [blame] | 44 | LAUNCHER_4_BY_6_DB, |
| 45 | LAUNCHER_5_BY_6_DB, |
Tracy Zhou | 7df93d2 | 2020-01-27 13:44:06 -0800 | [diff] [blame] | 46 | LAUNCHER_4_BY_4_DB, |
| 47 | LAUNCHER_3_BY_3_DB, |
Sebastian Franco | 9e4c99b | 2024-10-02 15:16:37 -0700 | [diff] [blame] | 48 | LAUNCHER_2_BY_2_DB, |
fbaron | d1cd8c2 | 2024-11-26 10:13:36 -0800 | [diff] [blame] | 49 | LAUNCHER_7_BY_3_DB, |
Sebastian Franco | 5353cd8 | 2024-11-15 12:42:40 -0800 | [diff] [blame] | 50 | LAUNCHER_8_BY_3_DB)); |
Alex Chau | 238aaee | 2021-10-06 16:15:24 +0100 | [diff] [blame] | 51 | |
| 52 | public static final List<String> OTHER_FILES = Collections.unmodifiableList(Arrays.asList( |
Tracy Zhou | 7df93d2 | 2020-01-27 13:44:06 -0800 | [diff] [blame] | 53 | BACKUP_DB, |
Helena Josol | 28db280 | 2014-10-09 17:04:09 +0100 | [diff] [blame] | 54 | SHARED_PREFERENCES_KEY + XML, |
Sunny Goyal | 4fbc382 | 2015-02-18 16:46:50 -0800 | [diff] [blame] | 55 | WIDGET_PREVIEWS_DB, |
Sunny Goyal | 8a6edce | 2016-03-23 10:47:15 -0700 | [diff] [blame] | 56 | MANAGED_USER_PREFERENCES_KEY + XML, |
Sunny Goyal | a5c8a9e | 2016-07-08 08:32:44 -0700 | [diff] [blame] | 57 | DEVICE_PREFERENCES_KEY + XML, |
Sunny Goyal | 7779d62 | 2015-06-11 16:18:39 -0700 | [diff] [blame] | 58 | APP_ICONS_DB)); |
Alex Chau | 238aaee | 2021-10-06 16:15:24 +0100 | [diff] [blame] | 59 | |
Cole Faust | 50ec4af | 2022-10-15 21:33:28 -0700 | [diff] [blame] | 60 | private static List<String> createAllFiles() { |
| 61 | ArrayList<String> result = new ArrayList<>(); |
| 62 | result.addAll(GRID_DB_FILES); |
| 63 | result.addAll(OTHER_FILES); |
| 64 | return Collections.unmodifiableList(result); |
| 65 | } |
| 66 | |
| 67 | public static final List<String> ALL_FILES = createAllFiles(); |
Helena Josol | 4fbbb3e | 2014-10-06 16:06:46 +0100 | [diff] [blame] | 68 | } |