• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2023 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 
17 package android.ondevicepersonalization;
18 
19 import android.annotation.NonNull;
20 
21 /**
22  * Data Access Object for the LOCAL_DATA table. The LOCAL_DATA table is a mutable
23  * data store that contains data that has been stored locally by the vendor.
24  *
25  * @hide
26  */
27 public interface MutableMap extends ImmutableMap {
28     /**
29      * Associates the specified value with the specified key in LOCAL_DATA.
30      * If LOCAL_DATA previously contained a mapping for the key, the old value is replaced.
31      *
32      * @param key key with which the specified value is to be associated
33      * @param value value to be associated with the specified key
34      *
35      * @return the previous value associated with key, or null if there was no mapping for key.
36      */
put(@onNull String key, @NonNull byte[] value)37     byte[] put(@NonNull String key, @NonNull byte[] value) throws OnDevicePersonalizationException;
38 
39     /**
40      * Removes the mapping for the specified key from LOCAL_DATA if present.
41      *
42      * @param key key whose mapping is to be removed from the LOCAL_DATA
43      *
44      * @return the previous value associated with key, or null if there was no mapping for key.
45      */
remove(String key)46     byte[] remove(String key) throws OnDevicePersonalizationException;
47 }
48