From 8a92c2ee8ec27ac0e0a8bd15b46e0defb790f598 Mon Sep 17 00:00:00 2001 From: fengjunqing Date: Wed, 19 Jul 2023 18:08:09 +0800 Subject: [PATCH] =?UTF-8?q?fs=20watcher=E7=9B=B8=E5=85=B3=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3systemapi=E8=BD=ACpublicapi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: fengjunqing --- .../kits/js/src/mod_fs/properties/watcher.cpp | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/interfaces/kits/js/src/mod_fs/properties/watcher.cpp b/interfaces/kits/js/src/mod_fs/properties/watcher.cpp index 596e525a0..24b046851 100644 --- a/interfaces/kits/js/src/mod_fs/properties/watcher.cpp +++ b/interfaces/kits/js/src/mod_fs/properties/watcher.cpp @@ -23,22 +23,12 @@ #include "file_utils.h" #include "filemgmt_libhilog.h" -#include "ipc_skeleton.h" -#include "tokenid_kit.h" #include "../class_watcher/watcher_entity.h" #include "../class_watcher/watcher_n_exporter.h" namespace OHOS::FileManagement::ModuleFileIO { using namespace std; using namespace OHOS::FileManagement::LibN; -namespace { - bool IsSystemApp() - { - uint64_t fullTokenId = OHOS::IPCSkeleton::GetCallingFullTokenID(); - return Security::AccessToken::TokenIdKit::IsSystemAppByFullTokenID(fullTokenId); - } -} - static tuple CreateAndCheckForWatcherEntity(napi_env env) { if (FileWatcher::GetInstance().GetNotifyId() < 0 && !FileWatcher::GetInstance().InitNotify()) { @@ -96,12 +86,6 @@ shared_ptr ParseParam(const napi_env &env, const napi_callback_i napi_value Watcher::CreateWatcher(napi_env env, napi_callback_info info) { - if (!IsSystemApp()) { - HILOGE("The hap is not system app."); - NError(E_PERMISSION_SYS).ThrowErr(env); - return nullptr; - } - int errCode = 0; auto infoArg = ParseParam(env, info, errCode); if (errCode != 0) { -- Gitee