1*4d7e907cSAndroid Build Coastguard Worker/* 2*4d7e907cSAndroid Build Coastguard Worker * Copyright (C) 2018 The Android Open Source Project 3*4d7e907cSAndroid Build Coastguard Worker * 4*4d7e907cSAndroid Build Coastguard Worker * Licensed under the Apache License, Version 2.0 (the "License"); 5*4d7e907cSAndroid Build Coastguard Worker * you may not use this file except in compliance with the License. 6*4d7e907cSAndroid Build Coastguard Worker * You may obtain a copy of the License at 7*4d7e907cSAndroid Build Coastguard Worker * 8*4d7e907cSAndroid Build Coastguard Worker * http://www.apache.org/licenses/LICENSE-2.0 9*4d7e907cSAndroid Build Coastguard Worker * 10*4d7e907cSAndroid Build Coastguard Worker * Unless required by applicable law or agreed to in writing, software 11*4d7e907cSAndroid Build Coastguard Worker * distributed under the License is distributed on an "AS IS" BASIS, 12*4d7e907cSAndroid Build Coastguard Worker * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13*4d7e907cSAndroid Build Coastguard Worker * See the License for the specific language governing permissions and 14*4d7e907cSAndroid Build Coastguard Worker * limitations under the License. 15*4d7e907cSAndroid Build Coastguard Worker */ 16*4d7e907cSAndroid Build Coastguard Worker 17*4d7e907cSAndroid Build Coastguard Workerpackage [email protected]; 18*4d7e907cSAndroid Build Coastguard Worker 19*4d7e907cSAndroid Build Coastguard Workerimport IGnssVisibilityControlCallback; 20*4d7e907cSAndroid Build Coastguard Worker 21*4d7e907cSAndroid Build Coastguard Worker/** 22*4d7e907cSAndroid Build Coastguard Worker * Represents the GNSS location reporting permissions and notification interface. 23*4d7e907cSAndroid Build Coastguard Worker * 24*4d7e907cSAndroid Build Coastguard Worker * This interface is used to tell the GNSS HAL implementation whether the framework user has 25*4d7e907cSAndroid Build Coastguard Worker * granted permission to the GNSS HAL implementation to provide GNSS location information for 26*4d7e907cSAndroid Build Coastguard Worker * non-framework (NFW), non-user initiated emergency use cases, and to notify the framework user 27*4d7e907cSAndroid Build Coastguard Worker * of these GNSS location information deliveries. 28*4d7e907cSAndroid Build Coastguard Worker * 29*4d7e907cSAndroid Build Coastguard Worker * For user initiated emergency cases (and for the configured extended emergency session duration), 30*4d7e907cSAndroid Build Coastguard Worker * the GNSS HAL implementation must serve the emergency location supporting network initiated 31*4d7e907cSAndroid Build Coastguard Worker * location requests immediately irrespective of this permission settings. 32*4d7e907cSAndroid Build Coastguard Worker * 33*4d7e907cSAndroid Build Coastguard Worker * There is no separate need for the GNSS HAL implementation to monitor the global device location 34*4d7e907cSAndroid Build Coastguard Worker * on/off setting. Permission to use GNSS for non-framework use cases is expressly controlled 35*4d7e907cSAndroid Build Coastguard Worker * by the method enableNfwLocationAccess(). The framework monitors the location permission settings 36*4d7e907cSAndroid Build Coastguard Worker * of the configured proxy applications(s), and device location settings, and calls the method 37*4d7e907cSAndroid Build Coastguard Worker * enableNfwLocationAccess() whenever the user control proxy applications have, or do not have, 38*4d7e907cSAndroid Build Coastguard Worker * location permission. The proxy applications are used to provide user visibility and control of 39*4d7e907cSAndroid Build Coastguard Worker * location access by the non-framework on/off device entities they are representing. 40*4d7e907cSAndroid Build Coastguard Worker * 41*4d7e907cSAndroid Build Coastguard Worker * For device user visibility, the GNSS HAL implementation must call the method 42*4d7e907cSAndroid Build Coastguard Worker * IGnssVisibilityControlCallback.nfwNotifyCb() whenever location request is rejected or 43*4d7e907cSAndroid Build Coastguard Worker * location information is provided to non-framework entities (on or off device). This includes 44*4d7e907cSAndroid Build Coastguard Worker * the network initiated location requests for user-initiated emergency use cases as well. 45*4d7e907cSAndroid Build Coastguard Worker * 46*4d7e907cSAndroid Build Coastguard Worker * The HAL implementations that support this interface must not report GNSS location, measurement, 47*4d7e907cSAndroid Build Coastguard Worker * status, or other information that can be used to derive user location to any entity when not 48*4d7e907cSAndroid Build Coastguard Worker * expressly authorized by this HAL. This includes all endpoints for location information 49*4d7e907cSAndroid Build Coastguard Worker * off the device, including carriers, vendors, OEM and others directly or indirectly. 50*4d7e907cSAndroid Build Coastguard Worker */ 51*4d7e907cSAndroid Build Coastguard Workerinterface IGnssVisibilityControl { 52*4d7e907cSAndroid Build Coastguard Worker /** 53*4d7e907cSAndroid Build Coastguard Worker * Enables/disables non-framework entity location access permission in the GNSS HAL. 54*4d7e907cSAndroid Build Coastguard Worker * 55*4d7e907cSAndroid Build Coastguard Worker * The framework will call this method to update GNSS HAL implementation every time the 56*4d7e907cSAndroid Build Coastguard Worker * framework user, through the given proxy application(s) and/or device location settings, 57*4d7e907cSAndroid Build Coastguard Worker * explicitly grants/revokes the location access permission for non-framework, non-user 58*4d7e907cSAndroid Build Coastguard Worker * initiated emergency use cases. 59*4d7e907cSAndroid Build Coastguard Worker * 60*4d7e907cSAndroid Build Coastguard Worker * Whenever the user location information is delivered to non-framework entities, the HAL 61*4d7e907cSAndroid Build Coastguard Worker * implementation must call the method IGnssVisibilityControlCallback.nfwNotifyCb() to notify 62*4d7e907cSAndroid Build Coastguard Worker * the framework for user visibility. 63*4d7e907cSAndroid Build Coastguard Worker * 64*4d7e907cSAndroid Build Coastguard Worker * @param proxyApps Full list of package names of proxy Android applications representing 65*4d7e907cSAndroid Build Coastguard Worker * the non-framework location access entities (on/off the device) for which the framework 66*4d7e907cSAndroid Build Coastguard Worker * user has granted non-framework location access permission. The GNSS HAL implementation 67*4d7e907cSAndroid Build Coastguard Worker * must provide location information only to non-framework entities represented by these 68*4d7e907cSAndroid Build Coastguard Worker * proxy applications. 69*4d7e907cSAndroid Build Coastguard Worker * 70*4d7e907cSAndroid Build Coastguard Worker * The package name of the proxy Android application follows the standard Java language 71*4d7e907cSAndroid Build Coastguard Worker * package naming format. For example, com.example.myapp. 72*4d7e907cSAndroid Build Coastguard Worker * 73*4d7e907cSAndroid Build Coastguard Worker * @return success True if the operation was successful. 74*4d7e907cSAndroid Build Coastguard Worker */ 75*4d7e907cSAndroid Build Coastguard Worker enableNfwLocationAccess(vec<string> proxyApps) generates (bool success); 76*4d7e907cSAndroid Build Coastguard Worker 77*4d7e907cSAndroid Build Coastguard Worker /** 78*4d7e907cSAndroid Build Coastguard Worker * Registers the callback for HAL implementation to use. 79*4d7e907cSAndroid Build Coastguard Worker * 80*4d7e907cSAndroid Build Coastguard Worker * @param callback Handle to IGnssVisibilityControlCallback interface. 81*4d7e907cSAndroid Build Coastguard Worker */ 82*4d7e907cSAndroid Build Coastguard Worker setCallback(IGnssVisibilityControlCallback callback) generates (bool success); 83*4d7e907cSAndroid Build Coastguard Worker};