blob: e1c658be4c261b228f2ffb8697926a26cadbeede [file] [log] [blame]
Robert Snoebergerb300a4e2019-02-13 20:13:53 +00001/*
2 * Copyright (C) 2019 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package com.android.keyguard.clock;
17
18import android.content.ContentResolver;
19import android.provider.Settings;
20
21/**
22 * Wrapper around Settings used for testing.
23 */
24public class SettingsWrapper {
25
26 private static final String CUSTOM_CLOCK_FACE = Settings.Secure.LOCK_SCREEN_CUSTOM_CLOCK_FACE;
27 private static final String DOCKED_CLOCK_FACE = Settings.Secure.DOCKED_CLOCK_FACE;
28
29 private ContentResolver mContentResolver;
30
31 public SettingsWrapper(ContentResolver contentResolver) {
32 mContentResolver = contentResolver;
33 }
34
35 /**
36 * Gets the value stored in settings for the custom clock face.
Robert Snoeberger372e13f2019-04-08 17:07:14 -040037 *
38 * @param userId ID of the user.
Robert Snoebergerb300a4e2019-02-13 20:13:53 +000039 */
Robert Snoeberger372e13f2019-04-08 17:07:14 -040040 public String getLockScreenCustomClockFace(int userId) {
41 return Settings.Secure.getStringForUser(mContentResolver, CUSTOM_CLOCK_FACE, userId);
Robert Snoebergerb300a4e2019-02-13 20:13:53 +000042 }
43
44 /**
45 * Gets the value stored in settings for the clock face to use when docked.
Robert Snoeberger372e13f2019-04-08 17:07:14 -040046 *
47 * @param userId ID of the user.
Robert Snoebergerb300a4e2019-02-13 20:13:53 +000048 */
Robert Snoeberger372e13f2019-04-08 17:07:14 -040049 public String getDockedClockFace(int userId) {
50 return Settings.Secure.getStringForUser(mContentResolver, DOCKED_CLOCK_FACE, userId);
Robert Snoebergerb300a4e2019-02-13 20:13:53 +000051 }
52}