blob: d730cea80415d52f570c2cf8125c25584f74985b [file] [log] [blame]
Helena Josol4fbbb3e2014-10-06 16:06:46 +01001package com.android.launcher3;
2
Alex Chau238aaee2021-10-06 16:15:24 +01003import java.util.ArrayList;
Helena Josol4fbbb3e2014-10-06 16:06:46 +01004import java.util.Arrays;
5import java.util.Collections;
6import 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 */
14public class LauncherFiles {
15
Helena Josol28db2802014-10-09 17:04:09 +010016 private static final String XML = ".xml";
17
Helena Josol4fbbb3e2014-10-06 16:06:46 +010018 public static final String LAUNCHER_DB = "launcher.db";
Alex Chauab26c622021-12-10 18:54:49 +000019 public static final String LAUNCHER_6_BY_5_DB = "launcher_6_by_5.db";
Jon Mirandaec1277e2021-03-25 10:41:54 -040020 public static final String LAUNCHER_4_BY_5_DB = "launcher_4_by_5.db";
Tracy Zhou7df93d22020-01-27 13:44:06 -080021 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";
Helena Josol28db2802014-10-09 17:04:09 +010025 public static final String SHARED_PREFERENCES_KEY = "com.android.launcher3.prefs";
Tracy Zhou7df93d22020-01-27 13:44:06 -080026 public static final String MANAGED_USER_PREFERENCES_KEY =
27 "com.android.launcher3.managedusers.prefs";
Sunny Goyala5c8a9e2016-07-08 08:32:44 -070028 // This preference file is not backed up to cloud.
29 public static final String DEVICE_PREFERENCES_KEY = "com.android.launcher3.device.prefs";
Sunny Goyal6a1e95a2015-03-20 17:26:30 -070030
Helena Josol4fbbb3e2014-10-06 16:06:46 +010031 public static final String WIDGET_PREVIEWS_DB = "widgetpreviews.db";
Sunny Goyal4fbc3822015-02-18 16:46:50 -080032 public static final String APP_ICONS_DB = "app_icons.db";
Helena Josol4fbbb3e2014-10-06 16:06:46 +010033
Alex Chau238aaee2021-10-06 16:15:24 +010034 public static final List<String> GRID_DB_FILES = Collections.unmodifiableList(Arrays.asList(
Helena Josol4fbbb3e2014-10-06 16:06:46 +010035 LAUNCHER_DB,
Alex Chauab26c622021-12-10 18:54:49 +000036 LAUNCHER_6_BY_5_DB,
Jon Mirandaec1277e2021-03-25 10:41:54 -040037 LAUNCHER_4_BY_5_DB,
Tracy Zhou7df93d22020-01-27 13:44:06 -080038 LAUNCHER_4_BY_4_DB,
39 LAUNCHER_3_BY_3_DB,
Alex Chau238aaee2021-10-06 16:15:24 +010040 LAUNCHER_2_BY_2_DB));
41
42 public static final List<String> OTHER_FILES = Collections.unmodifiableList(Arrays.asList(
Tracy Zhou7df93d22020-01-27 13:44:06 -080043 BACKUP_DB,
Helena Josol28db2802014-10-09 17:04:09 +010044 SHARED_PREFERENCES_KEY + XML,
Sunny Goyal4fbc3822015-02-18 16:46:50 -080045 WIDGET_PREVIEWS_DB,
Sunny Goyal8a6edce2016-03-23 10:47:15 -070046 MANAGED_USER_PREFERENCES_KEY + XML,
Sunny Goyala5c8a9e2016-07-08 08:32:44 -070047 DEVICE_PREFERENCES_KEY + XML,
Sunny Goyal7779d622015-06-11 16:18:39 -070048 APP_ICONS_DB));
Alex Chau238aaee2021-10-06 16:15:24 +010049
Cole Faust50ec4af2022-10-15 21:33:28 -070050 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();
Helena Josol4fbbb3e2014-10-06 16:06:46 +010058}