/foundation/communication/netmanager_base/services/netpolicymanager/src/common/ |
H A D | net_policy_service_common.cpp | 29 bool isAllowed = false; in IsUidNetAllowed() local 30 DelayedSingleton<NetPolicyService>::GetInstance()->IsUidNetAllowed(uid, metered, isAllowed); in IsUidNetAllowed() 31 return isAllowed; in IsUidNetAllowed()
|
/foundation/communication/netmanager_base/services/netpolicymanager/src/core/ |
H A D | net_policy_firewall.cpp | 40 int32_t NetPolicyFirewall::SetDeviceIdleTrustlist(const std::vector<uint32_t> &uids, bool isAllowed) in SetDeviceIdleTrustlist() argument 46 UpdateFirewallPolicyList(FIREWALL_CHAIN_DEVICE_IDLE, uids, isAllowed); in SetDeviceIdleTrustlist() 48 deviceIdleFirewallRule_->SetAllowedList(uids, isAllowed ? FIREWALL_RULE_ALLOW : FIREWALL_RULE_DENY); in SetDeviceIdleTrustlist() 57 int32_t NetPolicyFirewall::SetPowerSaveTrustlist(const std::vector<uint32_t> &uids, bool isAllowed) in SetPowerSaveTrustlist() argument 63 UpdateFirewallPolicyList(FIREWALL_CHAIN_POWER_SAVE, uids, isAllowed); in SetPowerSaveTrustlist() 69 powerSaveFirewallRule_->SetAllowedList(uids, isAllowed ? FIREWALL_RULE_ALLOW : FIREWALL_RULE_DENY); in SetPowerSaveTrustlist() 78 void NetPolicyFirewall::UpdateFirewallPolicyList(uint32_t chainType, const std::vector<uint32_t> &uids, bool isAllowed) in UpdateFirewallPolicyList() argument 82 if (isAllowed) { in UpdateFirewallPolicyList() 90 if (isAllowed) { in UpdateFirewallPolicyList()
|
H A D | net_policy_callback.cpp | 166 int32_t NetPolicyCallback::NotifyNetBackgroundPolicyChangeAsync(bool isAllowed) in NotifyNetBackgroundPolicyChangeAsync() argument 168 NETMGR_LOG_D("NotifyNetBackgroundPolicyChange isAllowed[%{public}d]", isAllowed); in NotifyNetBackgroundPolicyChangeAsync() 175 netPolicyCallbackFfrtQueue_->submit_h([this, isAllowed, &ret]() { in NotifyNetBackgroundPolicyChangeAsync() 176 ret = this->NotifyNetBackgroundPolicyChange(isAllowed); in NotifyNetBackgroundPolicyChangeAsync() 182 int32_t NetPolicyCallback::NotifyNetBackgroundPolicyChange(bool isAllowed) in NotifyNetBackgroundPolicyChange() argument 186 callback->NetBackgroundPolicyChange(isAllowed); in NotifyNetBackgroundPolicyChange()
|
H A D | net_policy_rule.cpp | 244 int32_t NetPolicyRule::IsUidNetAllowed(uint32_t uid, bool metered, bool &isAllowed) in IsUidNetAllowed() argument 254 isAllowed = false; in IsUidNetAllowed() 259 isAllowed = true; in IsUidNetAllowed() 264 isAllowed = false; in IsUidNetAllowed() 269 isAllowed = true; in IsUidNetAllowed() 274 isAllowed = true; in IsUidNetAllowed() 279 isAllowed = false; in IsUidNetAllowed() 283 isAllowed = true; in IsUidNetAllowed()
|
/foundation/communication/netmanager_base/interfaces/innerkits/netpolicyclient/include/ |
H A D | net_policy_client.h | 72 * @param isAllowed Put the result into "isAllowed". 77 [[nodiscard]] int32_t IsUidNetAllowed(uint32_t uid, bool metered, bool &isAllowed); 84 * @param isAllowed Put the result into "isAllowed". 89 [[nodiscard]] int32_t IsUidNetAllowed(uint32_t uid, const std::string &ifaceName, bool &isAllowed); 94 [[nodiscard]] int32_t IsUidNetAccess(uint32_t uid, bool isMetered, bool &isAllowed); 99 [[nodiscard]] int32_t IsUidNetAccess(uint32_t uid, const std::string &ifaceName, bool &isAllowed); 165 * @param isAllowed Allow apps to use data on background or not. 170 [[nodiscard]] int32_t SetBackgroundPolicy(bool isAllowed); [all...] |
H A D | i_net_policy_service.h | 69 * @param isAllowed True means it's allowed to access the network. 73 virtual int32_t IsUidNetAllowed(uint32_t uid, bool metered, bool &isAllowed) = 0; 80 * @param isAllowed True means it's allowed to access the network. 84 virtual int32_t IsUidNetAllowed(uint32_t uid, const std::string &ifaceName, bool &isAllowed) = 0; 132 * @param isAllowed The UID is into allow list or not. 135 virtual int32_t SetDeviceIdleTrustlist(const std::vector<uint32_t> &uids, bool isAllowed) = 0; 164 * @param isAllowed Allow apps to use data on background. 167 virtual int32_t SetBackgroundPolicy(bool isAllowed) = 0; 200 * @param isAllowed The UID is into allow list or not. 203 virtual int32_t SetPowerSaveTrustlist(const std::vector<uint32_t> &uids, bool isAllowed) [all...] |
H A D | net_policy_service_proxy.h | 34 int32_t IsUidNetAllowed(uint32_t uid, bool metered, bool &isAllowed) override; 35 int32_t IsUidNetAllowed(uint32_t uid, const std::string &ifaceName, bool &isAllowed) override; 45 int32_t SetDeviceIdleTrustlist(const std::vector<uint32_t> &uids, bool isAllowed) override; 49 int32_t SetPowerSaveTrustlist(const std::vector<uint32_t> &uids, bool isAllowed) override;
|
/foundation/ability/ability_runtime/test/unittest/dialog_session_manager_test/ |
H A D | dialog_session_manager_test.cpp | 107 bool isAllowed = false; in HWTEST_F() local 108 int32_t ret = dialogSessionManager.SendDialogResult(want, TEST_DIALOG_SESSION_ID, isAllowed); in HWTEST_F() 111 isAllowed = true; in HWTEST_F() 112 ret = dialogSessionManager.SendDialogResult(want, TEST_DIALOG_SESSION_ID, isAllowed); in HWTEST_F() 116 ret = dialogSessionManager.SendDialogResult(want, TEST_DIALOG_SESSION_ID, isAllowed); in HWTEST_F() 132 bool isAllowed = true; in HWTEST_F() local 137 int32_t ret = dialogSessionManager.SendDialogResult(want, TEST_DIALOG_SESSION_ID, isAllowed); in HWTEST_F() 141 ret = dialogSessionManager.SendDialogResult(want, TEST_DIALOG_SESSION_ID, isAllowed); in HWTEST_F()
|
/foundation/communication/netmanager_base/services/netpolicymanager/include/ |
H A D | net_policy_firewall.h | 34 * @param isAllowed The UID is into allow list or not. 37 int32_t SetDeviceIdleTrustlist(const std::vector<uint32_t> &uids, bool isAllowed); 65 * @param isAllowed The UID is into allow list or not. 68 int32_t SetPowerSaveTrustlist(const std::vector<uint32_t> &uids, bool isAllowed); 95 void UpdateFirewallPolicyList(uint32_t chainType, const std::vector<uint32_t> &uids, bool isAllowed);
|
H A D | net_policy_service.h | 84 * @param isAllowed Return true means it's allowed to access the network. 88 int32_t IsUidNetAllowed(uint32_t uid, bool metered, bool &isAllowed) override; 94 * @param isAllowed Return true means it's allowed to access the network. 98 int32_t IsUidNetAllowed(uint32_t uid, const std::string &ifaceName, bool &isAllowed) override; 171 * @param isAllowed The UID is into allowed list or not. 174 int32_t SetDeviceIdleTrustlist(const std::vector<uint32_t> &uids, bool isAllowed) override; 201 * @param isAllowed The UID is into allowed list or not. 204 int32_t SetPowerSaveTrustlist(const std::vector<uint32_t> &uids, bool isAllowed) override;
|
H A D | net_policy_callback.h | 86 int32_t NotifyNetBackgroundPolicyChangeAsync(bool isAllowed); 95 int32_t NotifyNetBackgroundPolicyChange(bool isAllowed);
|
/foundation/communication/netmanager_base/test/netpolicymanager/unittest/net_policy_manager_test/ |
H A D | ut_net_policy_client.cpp | 142 bool isAllowed = false; in HWTEST_F() local 143 int32_t ret = g_netPolicyClient->IsUidNetAllowed(TEST_UID, false, isAllowed); in HWTEST_F() 146 ASSERT_TRUE(isAllowed == true); in HWTEST_F() 157 bool isAllowed = false; in HWTEST_F() local 159 int32_t ret = g_netPolicyClient->IsUidNetAllowed(TEST_UID, ifaceName, isAllowed); in HWTEST_F() 161 std::cout << "NetPolicyClient005 IsUidNetAllowed isAllowed:" << isAllowed << std::endl; in HWTEST_F() 162 ASSERT_TRUE(isAllowed == true); in HWTEST_F() 173 bool isAllowed = false; in HWTEST_F() local 174 int32_t ret = g_netPolicyClient->IsUidNetAccess(TEST_UID, false, isAllowed); in HWTEST_F() 188 bool isAllowed = false; HWTEST_F() local 482 bool isAllowed = true; HWTEST_F() local [all...] |
H A D | net_policy_exception_service_test.cpp | 52 bool isAllowed = false; in HWTEST_F() local 53 int32_t ret = DelayedSingleton<NetPolicyService>::GetInstance()->IsUidNetAllowed(uit, metered, isAllowed); in HWTEST_F()
|
H A D | net_policy_service_stub_test.cpp | 51 int32_t IsUidNetAllowed(uint32_t uid, bool metered, bool &isAllowed) override 56 int32_t IsUidNetAllowed(uint32_t uid, const std::string &ifaceName, bool &isAllowed) override 86 int32_t SetDeviceIdleTrustlist(const std::vector<uint32_t> &uids, bool isAllowed) override 106 int32_t SetBackgroundPolicy(bool isAllowed) override 126 int32_t SetPowerSaveTrustlist(const std::vector<uint32_t> &uids, bool isAllowed) override
|
H A D | ut_net_policy_rule.cpp | 97 bool isAllowed = false; in HWTEST_F() local 98 g_netPolicyRule->IsUidNetAllowed(15000, false, isAllowed); in HWTEST_F() 99 ASSERT_TRUE(isAllowed); in HWTEST_F()
|
H A D | ut_net_policy_service.cpp | 94 bool isAllowed = false; in HWTEST_F() local 95 int32_t ret = instance_->IsUidNetAllowed(uid, policy, isAllowed); in HWTEST_F() 108 bool isAllowed = false; in HWTEST_F() local 109 int32_t ret = instance_->IsUidNetAllowed(uid, ifaceName, isAllowed); in HWTEST_F()
|
H A D | net_policy_manager_test.cpp | 177 bool isAllowed = false; in HWTEST_F() local 178 int32_t result = DelayedSingleton<NetPolicyClient>::GetInstance()->IsUidNetAllowed(TEST_UID7, false, isAllowed); in HWTEST_F() 180 ASSERT_TRUE(isAllowed); in HWTEST_F() 191 bool isAllowed = false; in HWTEST_F() local 193 DelayedSingleton<NetPolicyClient>::GetInstance()->IsUidNetAllowed(TEST_UID7, std::string("test"), isAllowed); in HWTEST_F() 195 ASSERT_TRUE(isAllowed); in HWTEST_F()
|
/foundation/communication/netmanager_base/frameworks/native/netpolicyclient/src/ |
H A D | net_policy_client.cpp | 64 int32_t NetPolicyClient::IsUidNetAllowed(uint32_t uid, bool metered, bool &isAllowed) in IsUidNetAllowed() argument 71 return proxy->IsUidNetAllowed(uid, metered, isAllowed); in IsUidNetAllowed() 74 int32_t NetPolicyClient::IsUidNetAllowed(uint32_t uid, const std::string &ifaceName, bool &isAllowed) in IsUidNetAllowed() argument 82 return proxy->IsUidNetAllowed(uid, ifaceName, isAllowed); in IsUidNetAllowed() 85 int32_t NetPolicyClient::IsUidNetAccess(uint32_t uid, bool isMetered, bool &isAllowed) in IsUidNetAccess() argument 87 return IsUidNetAllowed(uid, isMetered, isAllowed); in IsUidNetAccess() 90 int32_t NetPolicyClient::IsUidNetAccess(uint32_t uid, const std::string &ifaceName, bool &isAllowed) in IsUidNetAccess() argument 92 return IsUidNetAllowed(uid, ifaceName, isAllowed); in IsUidNetAccess() 320 int32_t NetPolicyClient::SetDeviceIdleTrustlist(const std::vector<uint32_t> &uids, bool isAllowed) in SetDeviceIdleTrustlist() argument 328 return proxy->SetDeviceIdleTrustlist(uids, isAllowed); in SetDeviceIdleTrustlist() 369 SetPowerSaveTrustlist(const std::vector<uint32_t> &uids, bool isAllowed) SetPowerSaveTrustlist() argument [all...] |
H A D | net_policy_service_proxy.cpp | 148 int32_t NetPolicyServiceProxy::IsUidNetAllowed(uint32_t uid, bool metered, bool &isAllowed) in IsUidNetAllowed() argument 181 if (!reply.ReadBool(isAllowed)) { in IsUidNetAllowed() 188 int32_t NetPolicyServiceProxy::IsUidNetAllowed(uint32_t uid, const std::string &ifaceName, bool &isAllowed) in IsUidNetAllowed() argument 221 if (!reply.ReadBool(isAllowed)) { in IsUidNetAllowed() 489 int32_t NetPolicyServiceProxy::SetDeviceIdleTrustlist(const std::vector<uint32_t> &uids, bool isAllowed) in SetDeviceIdleTrustlist() argument 501 if (!data.WriteBool(isAllowed)) { in SetDeviceIdleTrustlist() 628 int32_t NetPolicyServiceProxy::SetPowerSaveTrustlist(const std::vector<uint32_t> &uids, bool isAllowed) in SetPowerSaveTrustlist() argument 647 if (!data.WriteBool(isAllowed)) { in SetPowerSaveTrustlist()
|
/foundation/communication/netmanager_base/services/netpolicymanager/src/stub/ |
H A D | net_policy_service_stub.cpp | 294 bool isAllowed = false; in OnIsUidNetAllowedMetered() local 295 int32_t result = IsUidNetAllowed(uid, metered, isAllowed); in OnIsUidNetAllowedMetered() 302 if (!reply.WriteBool(isAllowed)) { in OnIsUidNetAllowedMetered() 326 bool isAllowed = false; in OnIsUidNetAllowedIfaceName() local 327 int32_t result = IsUidNetAllowed(uid, ifaceName, isAllowed); in OnIsUidNetAllowedIfaceName() 333 if (!reply.WriteBool(isAllowed)) { in OnIsUidNetAllowedIfaceName() 546 bool isAllowed = false; in OnSetDeviceIdleTrustlist() local 547 if (!data.ReadBool(isAllowed)) { in OnSetDeviceIdleTrustlist() 552 int32_t result = SetDeviceIdleTrustlist(uids, isAllowed); in OnSetDeviceIdleTrustlist() 585 bool isAllowed in OnSetDeviceIdlePolicy() local 629 bool isAllowed = false; OnSetPowerSaveTrustlist() local 648 bool isAllowed = false; OnSetPowerSavePolicy() local [all...] |
/foundation/communication/netmanager_base/services/netpolicymanager/src/ |
H A D | net_policy_service.cpp | 155 int32_t NetPolicyService::IsUidNetAllowed(uint32_t uid, bool metered, bool &isAllowed) in IsUidNetAllowed() argument 159 isAllowed = true; in IsUidNetAllowed() 163 return netPolicyRule_->IsUidNetAllowed(uid, metered, isAllowed); in IsUidNetAllowed() 168 int32_t NetPolicyService::IsUidNetAllowed(uint32_t uid, const std::string &ifaceName, bool &isAllowed) in IsUidNetAllowed() argument 173 return IsUidNetAllowed(uid, true, isAllowed); in IsUidNetAllowed() 175 return IsUidNetAllowed(uid, false, isAllowed); in IsUidNetAllowed() 282 int32_t NetPolicyService::SetDeviceIdleTrustlist(const std::vector<uint32_t> &uids, bool isAllowed) in SetDeviceIdleTrustlist() argument 289 return netPolicyFirewall_->SetDeviceIdleTrustlist(uids, isAllowed); in SetDeviceIdleTrustlist() 322 int32_t NetPolicyService::SetPowerSaveTrustlist(const std::vector<uint32_t> &uids, bool isAllowed) in SetPowerSaveTrustlist() argument 329 return netPolicyFirewall_->SetPowerSaveTrustlist(uids, isAllowed); in SetPowerSaveTrustlist() [all...] |
/foundation/ability/ability_runtime/services/abilitymgr/src/interceptor/ |
H A D | disposed_rule_interceptor.cpp | 141 bool isAllowed = disposedRule.controlType == AppExecFwk::ControlType::ALLOWED_LIST; in CheckDisposedRule() local 143 return !isAllowed; in CheckDisposedRule() 152 return !isAllowed; in CheckDisposedRule() 155 return isAllowed; in CheckDisposedRule()
|
/foundation/communication/netmanager_base/services/netpolicymanager/src/firewall_rule/ |
H A D | firewall_rule.cpp | 145 void FirewallRule::SetUidFirewallRule(uint uid, bool isAllowed) in SetUidFirewallRule() argument 147 netsys_->FirewallSetUidRule(chainType_, {uid}, isAllowed ? FIREWALL_RULE_ALLOW : FIREWALL_RULE_DENY); in SetUidFirewallRule()
|
/foundation/multimedia/camera_framework/services/camera_service/src/ |
H A D | camera_util.cpp | 345 bool isAllowed = true; in IsInForeGround() local 347 MEDIA_DEBUG_LOG("HCameraService::IsInForeGround isAllowed!"); in IsInForeGround() 348 return isAllowed; in IsInForeGround() 351 isAllowed = Security::AccessToken::PrivacyKit::IsAllowedUsingPermission(callerToken, OHOS_PERMISSION_CAMERA); in IsInForeGround() 353 return isAllowed; in IsInForeGround()
|
/foundation/communication/netmanager_ext/test/vpnmanager/unittest/conn_vpn_manager_test/ |
H A D | ut_net_policy_service.cpp | 94 bool isAllowed = false; in HWTEST_F() local 95 int32_t ret = instance_->IsUidNetAllowed(uid, policy, isAllowed); in HWTEST_F() 108 bool isAllowed = false; in HWTEST_F() local 109 int32_t ret = instance_->IsUidNetAllowed(uid, ifaceName, isAllowed); in HWTEST_F()
|