blob: 0d6ed04f2acff2fc8a14f1e9fdcb5d9ec288227b [file] [log] [blame]
Stefan Andonian146701c2022-11-10 23:07:40 +00001package com.android.launcher3
2
3import android.content.Context
4import android.content.SharedPreferences
5
6object 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 Lima03ac3772023-01-06 15:16:41 +000012 LauncherFiles.SHARED_PREFERENCES_KEY,
13 Context.MODE_PRIVATE
14 )
Stefan Andonian146701c2022-11-10 23:07:40 +000015 }
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 Lima03ac3772023-01-06 15:16:41 +000021 LauncherFiles.DEVICE_PREFERENCES_KEY,
22 Context.MODE_PRIVATE
23 )
24 }
25}