1 /* 2 * Copyright (C) 2022 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.CallbackExecutor; 20 import android.annotation.NonNull; 21 import android.os.OutcomeReceiver; 22 23 import java.util.concurrent.Executor; 24 25 /** 26 * Container for per-request state and APIs for code that runs in the isolated process. 27 * 28 * @hide 29 */ 30 public interface OnDevicePersonalizationContext { 31 /** 32 * Returns a DAO for the REMOTE_DATA table. 33 * @return A {@link ImmutableMap} object that provides access to the REMOTE_DATA table. 34 */ getRemoteData()35 @NonNull ImmutableMap getRemoteData(); 36 37 /** 38 * Returns a DAO for the LOCAL_DATA table. 39 * @return A {@link MutableMap} object that provides access to the LOCAL_DATA table. 40 */ getLocalData()41 @NonNull MutableMap getLocalData(); 42 43 /** Return an Event URL for a single bid. */ getEventUrl( int eventType, @NonNull String bidId, @NonNull EventUrlOptions options, @NonNull @CallbackExecutor Executor executor, @NonNull OutcomeReceiver<String, Exception> receiver)44 void getEventUrl( 45 int eventType, 46 @NonNull String bidId, 47 @NonNull EventUrlOptions options, 48 @NonNull @CallbackExecutor Executor executor, 49 @NonNull OutcomeReceiver<String, Exception> receiver); 50 51 // TODO(b/228200518): Add DAOs for LOCAL_DATA and USER_DATA. 52 } 53