1c960695f38ae0564dff3a6897fd1843c8e74c604Alan Viverette/*
2c960695f38ae0564dff3a6897fd1843c8e74c604Alan Viverette * Copyright (C) 2011 The Android Open Source Project
3c960695f38ae0564dff3a6897fd1843c8e74c604Alan Viverette *
4c960695f38ae0564dff3a6897fd1843c8e74c604Alan Viverette * Licensed under the Apache License, Version 2.0 (the "License");
5c960695f38ae0564dff3a6897fd1843c8e74c604Alan Viverette * you may not use this file except in compliance with the License.
6c960695f38ae0564dff3a6897fd1843c8e74c604Alan Viverette * You may obtain a copy of the License at
7c960695f38ae0564dff3a6897fd1843c8e74c604Alan Viverette *
8c960695f38ae0564dff3a6897fd1843c8e74c604Alan Viverette *      http://www.apache.org/licenses/LICENSE-2.0
9c960695f38ae0564dff3a6897fd1843c8e74c604Alan Viverette *
10c960695f38ae0564dff3a6897fd1843c8e74c604Alan Viverette * Unless required by applicable law or agreed to in writing, software
11c960695f38ae0564dff3a6897fd1843c8e74c604Alan Viverette * distributed under the License is distributed on an "AS IS" BASIS,
12c960695f38ae0564dff3a6897fd1843c8e74c604Alan Viverette * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13c960695f38ae0564dff3a6897fd1843c8e74c604Alan Viverette * See the License for the specific language governing permissions and
14c960695f38ae0564dff3a6897fd1843c8e74c604Alan Viverette * limitations under the License.
15c960695f38ae0564dff3a6897fd1843c8e74c604Alan Viverette */
16c960695f38ae0564dff3a6897fd1843c8e74c604Alan Viverette
17c960695f38ae0564dff3a6897fd1843c8e74c604Alan Viverettepackage com.android.inputmethod.compat;
18c960695f38ae0564dff3a6897fd1843c8e74c604Alan Viverette
19c960695f38ae0564dff3a6897fd1843c8e74c604Alan Viveretteimport java.lang.reflect.Field;
20c960695f38ae0564dff3a6897fd1843c8e74c604Alan Viverette
211e11c44d1b5f9ddf593c5407cb14c458be0056f2Tadashi G. Takaokapublic final class SettingsSecureCompatUtils {
22b6ca354431367b625daf9fff5fbe4b1f5ef996abKen Wakasa    // Note that Settings.Secure.ACCESSIBILITY_SPEAK_PASSWORD has been introduced
23b6ca354431367b625daf9fff5fbe4b1f5ef996abKen Wakasa    // in API level 15 (Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1).
24c960695f38ae0564dff3a6897fd1843c8e74c604Alan Viverette    private static final Field FIELD_ACCESSIBILITY_SPEAK_PASSWORD = CompatUtils.getField(
25c960695f38ae0564dff3a6897fd1843c8e74c604Alan Viverette            android.provider.Settings.Secure.class, "ACCESSIBILITY_SPEAK_PASSWORD");
26c960695f38ae0564dff3a6897fd1843c8e74c604Alan Viverette
27c960695f38ae0564dff3a6897fd1843c8e74c604Alan Viverette    private SettingsSecureCompatUtils() {
28c960695f38ae0564dff3a6897fd1843c8e74c604Alan Viverette        // This class is non-instantiable.
29c960695f38ae0564dff3a6897fd1843c8e74c604Alan Viverette    }
30c960695f38ae0564dff3a6897fd1843c8e74c604Alan Viverette
31c960695f38ae0564dff3a6897fd1843c8e74c604Alan Viverette    /**
32c960695f38ae0564dff3a6897fd1843c8e74c604Alan Viverette     * Whether to speak passwords while in accessibility mode.
33c960695f38ae0564dff3a6897fd1843c8e74c604Alan Viverette     */
34c960695f38ae0564dff3a6897fd1843c8e74c604Alan Viverette    public static final String ACCESSIBILITY_SPEAK_PASSWORD = (String) CompatUtils.getFieldValue(
35b6ca354431367b625daf9fff5fbe4b1f5ef996abKen Wakasa            null /* receiver */, null /* defaultValue */, FIELD_ACCESSIBILITY_SPEAK_PASSWORD);
36c960695f38ae0564dff3a6897fd1843c8e74c604Alan Viverette}
37