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 com.android.server.broadcastradio; 18 19 /** 20 * Controller interface to handle users in 21 * {@link com.android.server.broadcastradio.BroadcastRadioService} 22 */ 23 public interface RadioServiceUserController { 24 25 /** 26 * Check if the user calling the method in Broadcast Radio Service is the current user or the 27 * system user. 28 * 29 * @return {@code true} if the user calling this method is the current user of system user, 30 * {@code false} otherwise. 31 */ isCurrentOrSystemUser()32 boolean isCurrentOrSystemUser(); 33 34 /** 35 * Get current foreground user for Broadcast Radio Service 36 * 37 * @return foreground user id. 38 */ getCurrentUser()39 int getCurrentUser(); 40 41 /** 42 * Get id of the user handle assigned to the process that sent the binder transaction that is 43 * being processed 44 * 45 * @return Id of the user handle 46 */ getCallingUserId()47 int getCallingUserId(); 48 }