blob: 649eeedee8953ed69efdf53dbb71df158fd9f763 [file] [log] [blame]
Andres Morales38a7ed02013-11-14 19:02:56 -08001/*
2 * Copyright (C) 2013 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 */
16
17package android.nfc;
18
19import android.nfc.Tag;
20import java.util.List;
21
22/**
23 * Interface to NFC unlock functionality.
24 *
25 * @hide
26 */
27interface INfcUnlockSettings {
28
29 /**
30 * Checks the validity of the tag and attempts to unlock the screen.
31 *
32 * @return true if the screen was successfuly unlocked.
33 */
34 boolean tryUnlock(int userId, in Tag tag);
35
36 /**
37 * Registers the given tag as an unlock tag. Subsequent calls to {@code tryUnlock}
38 * with the same {@code tag} should succeed.
39 *
40 * @return true if the tag was successfully registered.
41 */
42 boolean registerTag(int userId, in Tag tag);
43
44 /**
45 * Deregisters the tag with the corresponding timestamp.
46 * Subsequent calls to {@code tryUnlock} with the same tag should fail.
47 *
48 * @return true if the tag was successfully deleted.
49 */
50 boolean deregisterTag(int userId, long timestamp);
51
52 /**
53 * Used for user-visible rendering of registered tags.
54 *
55 * @return a list of the times in millis since epoch when the registered tags were paired.
56 */
57 long[] getTagRegistryTimes(int userId);
58
59 /**
60 * Determines the state of the NFC unlock feature.
61 *
62 * @return true if NFC unlock is enabled.
63 */
64 boolean getNfcUnlockEnabled(int userId);
65
66 /**
67 * Sets the state [ON | OFF] of the NFC unlock feature.
68 */
69 void setNfcUnlockEnabled(int userId, boolean enabled);
70}