Stefan Andonian | 146701c | 2022-11-10 23:07:40 +0000 | [diff] [blame] | 1 | package com.android.launcher3 |
| 2 | |
| 3 | import android.content.Context |
| 4 | import android.content.SharedPreferences |
| 5 | |
| 6 | object LauncherPrefs { |
| 7 | |
| 8 | @JvmStatic |
| 9 | fun getPrefs(context: Context): SharedPreferences { |
| 10 | // Use application context for shared preferences, so that we use a single cached instance |
| 11 | return context.applicationContext.getSharedPreferences( |
Thales Lima | 03ac377 | 2023-01-06 15:16:41 +0000 | [diff] [blame^] | 12 | LauncherFiles.SHARED_PREFERENCES_KEY, |
| 13 | Context.MODE_PRIVATE |
| 14 | ) |
Stefan Andonian | 146701c | 2022-11-10 23:07:40 +0000 | [diff] [blame] | 15 | } |
| 16 | |
| 17 | @JvmStatic |
| 18 | fun getDevicePrefs(context: Context): SharedPreferences { |
| 19 | // Use application context for shared preferences, so that we use a single cached instance |
| 20 | return context.applicationContext.getSharedPreferences( |
Thales Lima | 03ac377 | 2023-01-06 15:16:41 +0000 | [diff] [blame^] | 21 | LauncherFiles.DEVICE_PREFERENCES_KEY, |
| 22 | Context.MODE_PRIVATE |
| 23 | ) |
| 24 | } |
| 25 | } |