1 /* 2 * Copyright (C) 2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef AUTH_CENTER_H 17 #define AUTH_CENTER_H 18 namespace bluetooth { 19 class AuthCenter { 20 public: 21 static AuthCenter &GetInstance(); 22 23 /** 24 * @Description Verify where the app has the permission to use bluetooth 25 * 26 * @param pid the app's process id. 27 * @param uid the app id. 28 * @return int PERMISSION_DENIED or PERMISSION_GRANTED 29 */ 30 static int VerifyUseBluetoothPermission(const int &pid, const int &uid); 31 32 /** 33 * @Description Verify where the app has the permission to discover bluetooth 34 * 35 * @param pid the app's process id. 36 * @param uid the app id. 37 * @return int PERMISSION_DENIED or PERMISSION_GRANTED 38 */ 39 static int VerifyDiscoverBluetoothPermission(const int &pid, const int &uid); 40 41 /** 42 * @Description Verify where the app has the permission to manager bluetooth 43 * 44 * @param pid the app's process id. 45 * @param uid the app id. 46 * @return int PERMISSION_DENIED or PERMISSION_GRANTED 47 */ 48 static int VerifyManageBluetoothPermission(const int &pid, const int &uid); 49 }; 50 } 51 #endif