• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package com.android.customization.testing;
2 
3 import android.content.Context;
4 
5 import com.android.customization.module.DefaultCustomizationPreferences;
6 
7 import java.util.HashSet;
8 import java.util.Set;
9 
10 /**
11  * Test implementation of {@link DefaultCustomizationPreferences}.
12  */
13 public class TestDefaultCustomizationPreferences extends DefaultCustomizationPreferences {
14 
15     private String mCustomThemes;
16     private final Set<String> mTabVisited = new HashSet<>();
17 
TestDefaultCustomizationPreferences(Context context)18     public TestDefaultCustomizationPreferences(Context context) {
19         super(context);
20     }
21 
22     @Override
getSerializedCustomThemes()23     public String getSerializedCustomThemes() {
24         return mCustomThemes;
25     }
26 
27     @Override
storeCustomThemes(String serializedCustomThemes)28     public void storeCustomThemes(String serializedCustomThemes) {
29         mCustomThemes = serializedCustomThemes;
30     }
31 
32     @Override
getTabVisited(String id)33     public boolean getTabVisited(String id) {
34         return mTabVisited.contains(id);
35     }
36 
37     @Override
setTabVisited(String id)38     public void setTabVisited(String id) {
39         mTabVisited.add(id);
40     }
41 }
42