diff --git a/frameworks/ability_lite/example/config.json b/frameworks/ability_lite/example/config.json index d7c5da3c1481f267ef3d4cf69d428080ec0c5e6d..31b864dd602480184ea5e220bc6188a8bf97201c 100644 --- a/frameworks/ability_lite/example/config.json +++ b/frameworks/ability_lite/example/config.json @@ -1,6 +1,6 @@ { "app": { - "bundleName": "com.huawei.hiability", + "bundleName": "com.ohos.hiability", "vendor": "huawei", "version": { "code": 1, diff --git a/interfaces/kits/js/napi/js_aafwk.cpp b/interfaces/kits/js/napi/js_aafwk.cpp index 058a000c10c069a6c6dd47584a1a3009f954e680..b728f8717115d4631f798cb082604f97eae26ab5 100644 --- a/interfaces/kits/js/napi/js_aafwk.cpp +++ b/interfaces/kits/js/napi/js_aafwk.cpp @@ -14,7 +14,6 @@ */ #include -#include #include "ability_manager.h" #include "napi/native_api.h" #include "napi/native_node_api.h" @@ -46,18 +45,15 @@ static int JSAafwkStartAbility(napi_env env, napi_callback_info info) size_t argc = 1; napi_value args[1] = {0}; status = napi_get_cb_info(env, info, &argc, args, NULL, NULL); - assert(status == napi_ok); napi_valuetype types[1]; status = napi_typeof(env, args[0], types); - assert(status == napi_ok); - assert(argc == 1 && types[0] == napi_object); Want want; if (memset_s(&want, sizeof(Want), 0x00, sizeof(Want)) != 0) { return MEMORY_MALLOC_ERROR; } - if (GetWantFromNapiValue(env, args[0], want) == false) { + if (!GetWantFromNapiValue(env, args[0], want)) { return PARAM_CHECK_ERROR; } StartAbility(&want); @@ -70,18 +66,15 @@ static int JSAafwkStopAbility(napi_env env, napi_callback_info info) size_t argc = 1; napi_value args[1] = {0};; status = napi_get_cb_info(env, info, &argc, args, NULL, NULL); - assert(status == napi_ok); napi_valuetype types[1]; status = napi_typeof(env, args[0], types); - assert(status == napi_ok); - assert(argc == 1 && types[0] == napi_object); Want want; if (memset_s(&want, sizeof(Want), 0x00, sizeof(Want)) != 0) { return MEMORY_MALLOC_ERROR; } - if (GetWantFromNapiValue(env, args[0], want) == false) { + if (!GetWantFromNapiValue(env, args[0], want)) { return PARAM_CHECK_ERROR; } StopAbility(&want); diff --git a/services/abilitymgr_lite/src/ability_mgr_feature.cpp b/services/abilitymgr_lite/src/ability_mgr_feature.cpp index e0f17cd7909fda9e724d48f80c5cdf05423bc0e2..5bb22e303ba81c3aeae3983fe27dd0a0ace2f629 100644 --- a/services/abilitymgr_lite/src/ability_mgr_feature.cpp +++ b/services/abilitymgr_lite/src/ability_mgr_feature.cpp @@ -215,7 +215,7 @@ int32 AbilityMgrFeature::StartRemoteAbilityInner(const Want *want, const char *d { IUnknown *iUnknown = SAMGR_GetInstance()->GetFeatureApi(DISTRIBUTED_SCHEDULE_SERVICE, DMSLITE_FEATURE); DmsProxy *dmsInterface = NULL; - if (iUnknown == NULL) { + if (iUnknown == nullptr) { return EC_INVALID; } int32 retVal = iUnknown->QueryInterface(iUnknown, DEFAULT_VERSION, (void**) &dmsInterface); diff --git a/services/abilitymgr_lite/src/ability_service.cpp b/services/abilitymgr_lite/src/ability_service.cpp index 2fd14b92a06933c8bfcdd842ab9d6dbf89dbf06d..c716b92551a4fe0d908caf8001f6d18402923cd1 100644 --- a/services/abilitymgr_lite/src/ability_service.cpp +++ b/services/abilitymgr_lite/src/ability_service.cpp @@ -38,7 +38,7 @@ using namespace OHOS::ACELite; namespace OHOS { -constexpr char LAUNCHER_BUNDLE_NAME[] = "com.huawei.launcher"; +constexpr char LAUNCHER_BUNDLE_NAME[] = "com.ohos.launcher"; constexpr uint16_t LAUNCHER_TOKEN = 0; constexpr int32_t QUEUE_LENGTH = 32; constexpr int32_t APP_TASK_PRI = 25; diff --git a/services/abilitymgr_lite/src/util/abilityms_helper.cpp b/services/abilitymgr_lite/src/util/abilityms_helper.cpp index 71eb3835dbc42d54b1710cccdba4ea556002a1ff..bb93ba482a761cd492147ab4d1147758129bdc49 100755 --- a/services/abilitymgr_lite/src/util/abilityms_helper.cpp +++ b/services/abilitymgr_lite/src/util/abilityms_helper.cpp @@ -24,7 +24,7 @@ #include "samgr_lite.h" namespace OHOS { -const char * const LAUNCHER_BUNDLE_NAME = "com.huawei.launcher"; +const char * const LAUNCHER_BUNDLE_NAME = "com.ohos.launcher"; const char * const LAUNCHER_ABILITY_NAME = "MainAbility"; const char * const ACE_ABILITY_NAME = "AceAbility"; const int MAX_BUNDLE_NAME_SIZE = 128; diff --git a/services/abilitymgr_lite/tools/src/ability_tool.cpp b/services/abilitymgr_lite/tools/src/ability_tool.cpp index 310d1694808494b48f4c8a6e31ad4d9b8417d0eb..2ab1a1f4916580ef03b6ee86b61847ab056f6510 100755 --- a/services/abilitymgr_lite/tools/src/ability_tool.cpp +++ b/services/abilitymgr_lite/tools/src/ability_tool.cpp @@ -151,6 +151,7 @@ Want* AbilityTool::BuildWant() if (extra_ != nullptr) { SetWantData(want, extra_, strlen(extra_) + 1); } + return want; } diff --git a/services/abilitymgr_lite/tools/src/main.cpp b/services/abilitymgr_lite/tools/src/main.cpp index 7f8cc25103da8d2f9cd2909dad5628f5dd2280c0..d16ae17c2823495d74338d74d7ebc0ce7df1b04f 100755 --- a/services/abilitymgr_lite/tools/src/main.cpp +++ b/services/abilitymgr_lite/tools/src/main.cpp @@ -32,7 +32,7 @@ static void PrintUsage() printf("\n"); printf("Options:\n"); printf(" -h (--help) Show the help information. [eg: aa -h]\n"); - printf(" -p (--bundlename) Appoint the bundlename name. [eg: -p com.huawei]\n"); + printf(" -p (--bundlename) Appoint the bundlename name. [eg: -p com.ohos]\n"); printf(" -n (--abilityname) Appoint the ability name. [eg: -n MyAbility]\n"); printf(" -a (--all) [Unnecessary]dump all ability info. [eg: -a]\n"); printf(" -e (--extra) [Unnecessary]extra info when dump. [eg: -e]\n"); diff --git a/services/abilitymgr_lite/unittest/test_lv0/page_ability_test/page_ability_test.cpp b/services/abilitymgr_lite/unittest/test_lv0/page_ability_test/page_ability_test.cpp index d107eec4963be3c962ba9185321095ad732302f4..c50ac2a54f90b5e0bc1591a6e0ba7a801b0a358b 100644 --- a/services/abilitymgr_lite/unittest/test_lv0/page_ability_test/page_ability_test.cpp +++ b/services/abilitymgr_lite/unittest/test_lv0/page_ability_test/page_ability_test.cpp @@ -20,7 +20,7 @@ using namespace testing::ext; namespace OHOS { - constexpr char BUNDLE_NAME[] = "com.huawei.setting"; + constexpr char BUNDLE_NAME[] = "com.ohos.setting"; constexpr char ABILITY_NAME[] = "SettingMainAbility"; static Want g_want = {}; diff --git a/services/abilitymgr_lite/unittest/utils/ability_test_helper.cpp b/services/abilitymgr_lite/unittest/utils/ability_test_helper.cpp index 77090bc3f35e4e83c0371a3f6c203248d8a305d8..6f37e241c1ea7a95fe6079cc20d6d2b4e36db7e3 100644 --- a/services/abilitymgr_lite/unittest/utils/ability_test_helper.cpp +++ b/services/abilitymgr_lite/unittest/utils/ability_test_helper.cpp @@ -205,7 +205,10 @@ namespace OHOS { record->state = static_cast(g_resultString[end + strlen(SLICE_STATE)] - '0'); sliceList.push_back(record); } - + if (sliceList == nullptr) { + printf("slice List is null\n"); + return nullptr; + } return sliceList; }