1 /* 2 * Copyright (C) 2021 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.app.ambientcontext; 18 19 import android.app.PendingIntent; 20 import android.app.ambientcontext.AmbientContextEventRequest; 21 import android.app.ambientcontext.IAmbientContextObserver; 22 import android.os.RemoteCallback; 23 24 /** 25 * Interface for an AmbientContextManager that provides access to AmbientContextEvents. 26 * 27 * @hide 28 */ 29 interface IAmbientContextManager { registerObserver(in AmbientContextEventRequest request, in PendingIntent resultPendingIntent, in RemoteCallback statusCallback)30 void registerObserver(in AmbientContextEventRequest request, 31 in PendingIntent resultPendingIntent, 32 in RemoteCallback statusCallback); 33 34 @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.ACCESS_AMBIENT_CONTEXT_EVENT)") registerObserverWithCallback(in AmbientContextEventRequest request, String packageName, in IAmbientContextObserver observer)35 void registerObserverWithCallback(in AmbientContextEventRequest request, 36 String packageName, 37 in IAmbientContextObserver observer); 38 @EnforcePermission("ACCESS_AMBIENT_CONTEXT_EVENT") unregisterObserver(in String callingPackage)39 void unregisterObserver(in String callingPackage); queryServiceStatus(in int[] eventTypes, in String callingPackage, in RemoteCallback statusCallback)40 void queryServiceStatus(in int[] eventTypes, in String callingPackage, 41 in RemoteCallback statusCallback); startConsentActivity(in int[] eventTypes, in String callingPackage)42 void startConsentActivity(in int[] eventTypes, in String callingPackage); 43 } 44