mirror of
https://github.com/openharmony/ability_ability_runtime.git
synced 2026-08-26 18:47:03 -04:00
Signed-off-by: zhongjianfei <zhongjianfei@huawei.com> Change-Id: Idd034683292787ef3a0454ca4522e4a518662efa
This commit is contained in:
@@ -446,6 +446,7 @@ private:
|
||||
std::shared_ptr<AbilityLifecycleCallbacks> abilityLifecycleCallbacks_;
|
||||
std::shared_ptr<ApplicationImpl> applactionImpl_;
|
||||
std::shared_ptr<ContextDeal> contextDeal_;
|
||||
std::shared_ptr<Configuration> configuration_ = nullptr;
|
||||
|
||||
private:
|
||||
/**
|
||||
|
||||
@@ -815,8 +815,17 @@ Uri AbilityImpl::DenormalizeUri(const Uri &uri)
|
||||
void AbilityImpl::ScheduleUpdateConfiguration(const Configuration &config)
|
||||
{
|
||||
APP_LOGI("%{public}s begin.", __func__);
|
||||
|
||||
// Update for the first time
|
||||
if (!configuration_) {
|
||||
configuration_ = std::make_shared<Configuration>(config);
|
||||
APP_LOGI("AbilityImpl::Init the configuration");
|
||||
return;
|
||||
}
|
||||
|
||||
if (ability_ == nullptr) {
|
||||
APP_LOGE("AbilityImpl::ScheduleUpdateConfiguration ability_ is nullptr");
|
||||
return;
|
||||
}
|
||||
|
||||
ability_->OnConfigurationUpdated(config);
|
||||
|
||||
@@ -179,6 +179,11 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual int ClearUpApplicationData(const std::string &bundleName) override
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
enum RequestCode {
|
||||
E_STATE_INITIAL = 0,
|
||||
E_STATE_INACTIVE,
|
||||
|
||||
@@ -147,6 +147,11 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual int ClearUpApplicationData(const std::string &bundleName) override
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
AbilityLifeCycleState curstate_ = AbilityLifeCycleState::ABILITY_STATE_INITIAL;
|
||||
sptr<IAbilityScheduler> abilityScheduler_; // kit interface used to schedule ability life
|
||||
Want want_;
|
||||
|
||||
@@ -164,6 +164,11 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual int ClearUpApplicationData(const std::string &bundleName) override
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
sptr<IAbilityScheduler> abilityScheduler_ = nullptr; // kit interface used to schedule ability life
|
||||
Want want_;
|
||||
bool startAbility = false;
|
||||
|
||||
@@ -306,6 +306,15 @@ public:
|
||||
*/
|
||||
ErrCode KillProcess(const std::string &bundleName);
|
||||
|
||||
/**
|
||||
* ClearUpApplicationData, call ClearUpApplicationData() through proxy project,
|
||||
* clear the application data.
|
||||
*
|
||||
* @param bundleName, bundle name in Application record.
|
||||
* @return
|
||||
*/
|
||||
ErrCode ClearUpApplicationData(const std::string &bundleName);
|
||||
|
||||
/**
|
||||
* @brief Checks whether this ability is the first ability in a mission.
|
||||
*
|
||||
|
||||
@@ -324,6 +324,11 @@ enum {
|
||||
* Result(2097216) for KillProcess: keep alive process can not be killed
|
||||
*/
|
||||
KILL_PROCESS_KEEP_ALIVE,
|
||||
|
||||
/**
|
||||
* Result(2097217) for clear the application data fail.
|
||||
*/
|
||||
CLEAR_APPLICATION_DATA_FAIL,
|
||||
};
|
||||
|
||||
enum {
|
||||
|
||||
@@ -320,6 +320,15 @@ public:
|
||||
*/
|
||||
virtual int KillProcess(const std::string &bundleName) = 0;
|
||||
|
||||
/**
|
||||
* ClearUpApplicationData, call ClearUpApplicationData() through proxy project,
|
||||
* clear the application data.
|
||||
*
|
||||
* @param bundleName, bundle name in Application record.
|
||||
* @return
|
||||
*/
|
||||
virtual int ClearUpApplicationData(const std::string &bundleName) = 0;
|
||||
|
||||
/**
|
||||
* Uninstall app
|
||||
*
|
||||
@@ -708,6 +717,8 @@ public:
|
||||
|
||||
GET_SYSTEM_MEMORY_ATTR,
|
||||
|
||||
CLEAR_UP_APPLICATION_DATA,
|
||||
|
||||
START_ABILITY_FOR_OPTIONS,
|
||||
|
||||
// ipc id for continue ability(1101)
|
||||
|
||||
@@ -42,6 +42,8 @@ ohos_shared_library("abilitymanager") {
|
||||
"//foundation/appexecfwk/standard/services/appmgr:libams",
|
||||
"//foundation/distributedschedule/safwk/interfaces/innerkits/safwk:system_ability_fwk",
|
||||
"//foundation/distributedschedule/samgr/interfaces/innerkits/samgr_proxy:samgr_proxy",
|
||||
"//foundation/multimedia/image_standard/interfaces/innerkits:image",
|
||||
"//foundation/multimedia/image_standard/interfaces/innerkits:image_native",
|
||||
"//utils/native/base:utils",
|
||||
]
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include <pthread.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "ability_manager_client.h"
|
||||
#include "ability_manager_interface.h"
|
||||
#include "app_mgr_interface.h"
|
||||
#include "hilog_wrapper.h"
|
||||
@@ -1694,7 +1695,8 @@ napi_value NAPI_KillProcessesByBundleName(napi_env env, napi_callback_info info)
|
||||
auto NAPI_ClearUpApplicationDataAsyncExecuteCallback = [](napi_env env, void *data) {
|
||||
HILOG_INFO("clearUpApplicationData called(CallBack Mode)...");
|
||||
AsyncClearUpApplicationDataCallbackInfo *async_callback_info = (AsyncClearUpApplicationDataCallbackInfo *)data;
|
||||
async_callback_info->result = GetAppManagerInstance()->ClearUpApplicationData(async_callback_info->bundleName);
|
||||
async_callback_info->result = AAFwk::AbilityManagerClient::GetInstance()->
|
||||
ClearUpApplicationData(async_callback_info->bundleName);
|
||||
};
|
||||
|
||||
auto NAPI_ClearUpApplicationDataAsyncCompleteCallback = [](napi_env env, napi_status status, void *data) {
|
||||
|
||||
@@ -2977,7 +2977,7 @@ napi_value WrapResultSet(napi_env env, const std::shared_ptr<NativeRdb::AbsShare
|
||||
HILOG_INFO("%{public}s,called", __func__);
|
||||
if (resultSet == nullptr) {
|
||||
HILOG_ERROR("%{public}s, input parameter resultSet is nullptr", __func__);
|
||||
return nullptr;
|
||||
return WrapVoidToJS(env);
|
||||
}
|
||||
|
||||
return RdbJsKit::ResultSetProxy::NewInstance(env, resultSet);
|
||||
|
||||
@@ -96,6 +96,15 @@
|
||||
}
|
||||
],
|
||||
"test_list": [
|
||||
"//foundation/aafwk/standard/frameworks/kits/content/cpp/test:unittest",
|
||||
"//foundation/aafwk/standard/frameworks/kits/ability/native/test:unittest",
|
||||
"//foundation/aafwk/standard/frameworks/kits/test:moduletest",
|
||||
"//foundation/aafwk/standard/services/test:moduletest",
|
||||
"//foundation/aafwk/standard/services:unittest",
|
||||
"//foundation/aafwk/standard/tools/test:systemtest",
|
||||
"//foundation/aafwk/standard/tools/test:moduletest",
|
||||
"//foundation/aafwk/standard/tools/test:unittest",
|
||||
"//foundation/aafwk/standard/tools/zip/test:unittest"
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
@@ -51,6 +51,12 @@ const std::string PHONE_SERVICE_BUNDLE_NAME = "com.ohos.callui";
|
||||
const std::string PHONE_SERVICE_ABILITY_NAME = "com.ohos.callui.ServiceAbility";
|
||||
const std::string LOCK_SCREEN_EVENT_NAME = "lock_screen";
|
||||
|
||||
const std::string CONTACTS_ABILITY_NAME = "com.ohos.contacts.ServiceAbility";
|
||||
const std::string CONTACTS_BUNDLE_NAME = "com.ohos.contacts";
|
||||
|
||||
const std::string MMS_ABILITY_NAME = "com.ohos.mms.ServiceAbility";
|
||||
const std::string MMS_BUNDLE_NAME = "com.ohos.mms";
|
||||
|
||||
const std::string SETTINGS_DATA_ABILITY_NAME = "com.ohos.settingsdata.DataAbility";
|
||||
const std::string SETTINGS_DATA_BUNDLE_NAME = "com.ohos.settingsdata";
|
||||
} // namespace AbilityConfig
|
||||
|
||||
@@ -301,6 +301,15 @@ public:
|
||||
*/
|
||||
virtual int KillProcess(const std::string &bundleName) override;
|
||||
|
||||
/**
|
||||
* ClearUpApplicationData, call ClearUpApplicationData() through proxy project,
|
||||
* clear the application data.
|
||||
*
|
||||
* @param bundleName, bundle name in Application record.
|
||||
* @return
|
||||
*/
|
||||
virtual int ClearUpApplicationData(const std::string &bundleName) override;
|
||||
|
||||
/**
|
||||
* Uninstall app
|
||||
*
|
||||
|
||||
@@ -370,6 +370,15 @@ public:
|
||||
*/
|
||||
virtual int KillProcess(const std::string &bundleName) override;
|
||||
|
||||
/**
|
||||
* ClearUpApplicationData, call ClearUpApplicationData() through proxy project,
|
||||
* clear the application data.
|
||||
*
|
||||
* @param bundleName, bundle name in Application record.
|
||||
* @return ERR_OK, return back success, others fail.
|
||||
*/
|
||||
virtual int ClearUpApplicationData(const std::string &bundleName) override;
|
||||
|
||||
/**
|
||||
* Uninstall app
|
||||
*
|
||||
@@ -713,6 +722,18 @@ private:
|
||||
*/
|
||||
void StartingSystemUiAbility(const SatrtUiMode &mode);
|
||||
|
||||
/**
|
||||
* starting contacts ability.
|
||||
*
|
||||
*/
|
||||
void StartingContactsAbility();
|
||||
|
||||
/**
|
||||
* starting mms ability.
|
||||
*
|
||||
*/
|
||||
void StartingMmsAbility();
|
||||
|
||||
/**
|
||||
* connet bms.
|
||||
*
|
||||
|
||||
@@ -103,6 +103,7 @@ private:
|
||||
int SetShowOnLockScreenInner(MessageParcel &data, MessageParcel &reply);
|
||||
|
||||
int GetSystemMemoryAttrInner(MessageParcel &data, MessageParcel &reply);
|
||||
int ClearUpApplicationDataInner(MessageParcel &data, MessageParcel &reply);
|
||||
|
||||
int StartContinuationInner(MessageParcel &data, MessageParcel &reply);
|
||||
int NotifyContinuationResultInner(MessageParcel &data, MessageParcel &reply);
|
||||
|
||||
@@ -725,6 +725,7 @@ private:
|
||||
void CheckMissionRecordIsResume(const std::shared_ptr<MissionRecord> &mission);
|
||||
int ChangedPowerStorageAbilityToActive(std::shared_ptr<PowerStorage> &powerStorage,
|
||||
bool isPowerStateLockScreen = false);
|
||||
void HandleActiveTimeout(const std::shared_ptr<AbilityRecord> &ability);
|
||||
bool IsLockScreenState();
|
||||
bool CheckMissionRecordInWhiteList(const std::shared_ptr<MissionRecord> &mission);
|
||||
bool DeleteMissionRecordInStackOnLockScreen(const std::shared_ptr<MissionRecord> &missionRecord);
|
||||
|
||||
@@ -35,6 +35,8 @@ const std::string STARTUP_PHONE_SERVICE {"startup_phone_service"};
|
||||
const std::string MISSION_SAVE_TIME {"mission_save_time"};
|
||||
const std::string SYSTEM_CONFIGURATION {"system_configuration"};
|
||||
const std::string SYSTEM_ORIENTATION {"system_orientation"};
|
||||
const std::string STARTUP_CONTACTS {"startup_contacts"};
|
||||
const std::string STARTUP_MMS {"startup_mms"};
|
||||
} // namespace AmsConfig
|
||||
|
||||
enum class SatrtUiMode { STATUSBAR = 1, NAVIGATIONBAR = 2, STARTUIBOTH = 3 };
|
||||
@@ -73,6 +75,16 @@ public:
|
||||
* return false : ams do not start phone service
|
||||
*/
|
||||
bool GetPhoneServiceState() const;
|
||||
/**
|
||||
* return true : ams can start contacts
|
||||
* return false : ams do not start contacts
|
||||
*/
|
||||
bool GetStartContactsState() const;
|
||||
/**
|
||||
* return true : ams can start mms
|
||||
* return false : ams do not start mms
|
||||
*/
|
||||
bool GetStartMmsState() const;
|
||||
/**
|
||||
* Get profile information
|
||||
*/
|
||||
@@ -109,6 +121,8 @@ private:
|
||||
bool canStartUiStatusBar_ {false};
|
||||
bool canStartUiNavigationBar_ {false};
|
||||
bool canStartPhoneService_ {false};
|
||||
bool canStartContacts {false};
|
||||
bool canStartMms {false};
|
||||
std::string orientation_ {""};
|
||||
int missionSaveTime_ {12 * 60 * 60 * 1000};
|
||||
std::map<std::string, std::string> memThreshold_;
|
||||
|
||||
@@ -182,6 +182,13 @@ public:
|
||||
*/
|
||||
int KillApplication(const std::string &bundleName);
|
||||
|
||||
/**
|
||||
* clear the application data
|
||||
*
|
||||
* @param bundleName.
|
||||
*/
|
||||
int ClearUpApplicationData(const std::string &bundleName);
|
||||
|
||||
void AttachTimeOut(const sptr<IRemoteObject> &token);
|
||||
|
||||
void PrepareTerminate(const sptr<IRemoteObject> &token);
|
||||
@@ -204,6 +211,11 @@ public:
|
||||
*/
|
||||
void GetSystemMemoryAttr(AppExecFwk::SystemMemoryAttr &memoryInfo, std::string &strConfig);
|
||||
|
||||
/**
|
||||
* Start a resident process
|
||||
*/
|
||||
void StartupResidentProcess();
|
||||
|
||||
protected:
|
||||
/**
|
||||
* OnAbilityRequestDone, app manager service call this interface after ability request done.
|
||||
|
||||
@@ -30,9 +30,11 @@ public:
|
||||
void Atach(const std::weak_ptr<ConfigurationHolder> &ob);
|
||||
void Detach(const std::weak_ptr<ConfigurationHolder> &ob);
|
||||
void UpdateConfiguration(const AppExecFwk::Configuration &newConfig);
|
||||
void InitConfiguration(const AppExecFwk::Configuration &);
|
||||
private:
|
||||
std::list<std::weak_ptr<ConfigurationHolder>> observerList_;
|
||||
std::mutex configLock_;
|
||||
AppExecFwk::Configuration config_;
|
||||
};
|
||||
} // namespace AAFwk
|
||||
} // namespace OHOS
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
"startup_system_ui_status_bar" : true,
|
||||
"startup_system_ui_navigation_bar" : true,
|
||||
"startup_phone_service" : true,
|
||||
"startup_contacts":true,
|
||||
"startup_mms":true,
|
||||
"mission_save_time" : 43200000
|
||||
},
|
||||
"memorythreshold":{
|
||||
|
||||
@@ -882,6 +882,28 @@ void AbilityConnectManager::HandleAbilityDiedTask(const std::shared_ptr<AbilityR
|
||||
return;
|
||||
}
|
||||
|
||||
if (abilityRecord->GetAbilityInfo().name == AbilityConfig::CONTACTS_ABILITY_NAME) {
|
||||
AbilityRequest requestInfo;
|
||||
requestInfo.want = abilityRecord->GetWant();
|
||||
requestInfo.abilityInfo = abilityRecord->GetAbilityInfo();
|
||||
requestInfo.appInfo = abilityRecord->GetApplicationInfo();
|
||||
|
||||
RemoveServiceAbility(abilityRecord);
|
||||
StartAbilityLocked(requestInfo);
|
||||
return;
|
||||
}
|
||||
|
||||
if (abilityRecord->GetAbilityInfo().name == AbilityConfig::MMS_ABILITY_NAME) {
|
||||
AbilityRequest requestInfo;
|
||||
requestInfo.want = abilityRecord->GetWant();
|
||||
requestInfo.abilityInfo = abilityRecord->GetAbilityInfo();
|
||||
requestInfo.appInfo = abilityRecord->GetApplicationInfo();
|
||||
|
||||
RemoveServiceAbility(abilityRecord);
|
||||
StartAbilityLocked(requestInfo);
|
||||
return;
|
||||
}
|
||||
|
||||
ConnectListType connlist = abilityRecord->GetConnectRecordList();
|
||||
for (auto &connectRecord : connlist) {
|
||||
HILOG_WARN("This record complete disconnect directly. recordId:%{public}d", connectRecord->GetRecordId());
|
||||
|
||||
@@ -296,6 +296,13 @@ ErrCode AbilityManagerClient::KillProcess(const std::string &bundleName)
|
||||
return abms->KillProcess(bundleName);
|
||||
}
|
||||
|
||||
ErrCode AbilityManagerClient::ClearUpApplicationData(const std::string &bundleName)
|
||||
{
|
||||
CHECK_REMOTE_OBJECT_AND_RETURN(remoteObject_, ABILITY_SERVICE_NOT_CONNECTED);
|
||||
sptr<IAbilityManager> abms = iface_cast<IAbilityManager>(remoteObject_);
|
||||
return abms->ClearUpApplicationData(bundleName);
|
||||
}
|
||||
|
||||
ErrCode AbilityManagerClient::IsFirstInMission(const sptr<IRemoteObject> &token)
|
||||
{
|
||||
if (token == nullptr) {
|
||||
|
||||
@@ -771,6 +771,27 @@ int AbilityManagerProxy::KillProcess(const std::string &bundleName)
|
||||
return reply.ReadInt32();
|
||||
}
|
||||
|
||||
int AbilityManagerProxy::ClearUpApplicationData(const std::string &bundleName)
|
||||
{
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option;
|
||||
|
||||
if (!WriteInterfaceToken(data)) {
|
||||
return INNER_ERR;
|
||||
}
|
||||
if (!data.WriteString16(Str8ToStr16(bundleName))) {
|
||||
HILOG_ERROR("bundleName write failed.");
|
||||
return ERR_INVALID_VALUE;
|
||||
}
|
||||
int error = Remote()->SendRequest(IAbilityManager::CLEAR_UP_APPLICATION_DATA, data, reply, option);
|
||||
if (error != NO_ERROR) {
|
||||
HILOG_ERROR("Send request error: %{public}d", error);
|
||||
return error;
|
||||
}
|
||||
return reply.ReadInt32();
|
||||
}
|
||||
|
||||
int AbilityManagerProxy::UninstallApp(const std::string &bundleName)
|
||||
{
|
||||
MessageParcel data;
|
||||
|
||||
@@ -676,6 +676,8 @@ void AbilityManagerService::GetGlobalConfiguration()
|
||||
std::string direction = amsConfigResolver_->GetOrientation();
|
||||
HILOG_INFO("current global direction is : %{public}s", direction.c_str());
|
||||
GetConfiguration()->AddItem(GlobalConfigurationKey::SYSTEM_ORIENTATION, direction);
|
||||
|
||||
DelayedSingleton<ConfigurationDistributor>::GetInstance()->InitConfiguration(*GetConfiguration());
|
||||
}
|
||||
|
||||
std::shared_ptr<AppExecFwk::Configuration> AbilityManagerService::GetConfiguration()
|
||||
@@ -1258,21 +1260,23 @@ int AbilityManagerService::AttachAbilityThread(
|
||||
auto abilityInfo = abilityRecord->GetAbilityInfo();
|
||||
auto type = abilityInfo.type;
|
||||
|
||||
if (type != AppExecFwk::AbilityType::DATA) {
|
||||
int returnCode = -1;
|
||||
if (type == AppExecFwk::AbilityType::SERVICE || type == AppExecFwk::AbilityType::EXTENSION) {
|
||||
returnCode = connectManager_->AttachAbilityThreadLocked(scheduler, token);
|
||||
} else if (type == AppExecFwk::AbilityType::DATA) {
|
||||
returnCode = dataAbilityManager_->AttachAbilityThread(scheduler, token);
|
||||
} else if (IsSystemUiApp(abilityInfo)) {
|
||||
returnCode = kernalAbilityManager_->AttachAbilityThread(scheduler, token);
|
||||
} else {
|
||||
returnCode = currentMissionListManager_->AttachAbilityThread(scheduler, token);
|
||||
}
|
||||
|
||||
HILOG_INFO("attach ability type [%{public}d] | returnCode [%{public}d]", type, returnCode);
|
||||
if (SUCCEEDED(returnCode) && type != AppExecFwk::AbilityType::DATA) {
|
||||
DelayedSingleton<ConfigurationDistributor>::GetInstance()->Atach(abilityRecord);
|
||||
}
|
||||
|
||||
if (type == AppExecFwk::AbilityType::SERVICE || type == AppExecFwk::AbilityType::EXTENSION) {
|
||||
return connectManager_->AttachAbilityThreadLocked(scheduler, token);
|
||||
}
|
||||
if (type == AppExecFwk::AbilityType::DATA) {
|
||||
return dataAbilityManager_->AttachAbilityThread(scheduler, token);
|
||||
}
|
||||
if (IsSystemUiApp(abilityInfo)) {
|
||||
return kernalAbilityManager_->AttachAbilityThread(scheduler, token);
|
||||
}
|
||||
|
||||
return currentMissionListManager_->AttachAbilityThread(scheduler, token);
|
||||
return returnCode;
|
||||
}
|
||||
|
||||
void AbilityManagerService::DumpFuncInit()
|
||||
@@ -1682,6 +1686,46 @@ void AbilityManagerService::StartingPhoneServiceAbility()
|
||||
(void)StartAbility(phoneServiceWant, DEFAULT_INVAL_VALUE);
|
||||
}
|
||||
|
||||
void AbilityManagerService::StartingContactsAbility()
|
||||
{
|
||||
HILOG_DEBUG("%{public}s", __func__);
|
||||
if (!iBundleManager_) {
|
||||
HILOG_INFO("bms service is null");
|
||||
return;
|
||||
}
|
||||
|
||||
AppExecFwk::AbilityInfo contactsInfo;
|
||||
Want contactsWant;
|
||||
contactsWant.SetElementName(AbilityConfig::CONTACTS_BUNDLE_NAME, AbilityConfig::CONTACTS_ABILITY_NAME);
|
||||
|
||||
while (!(iBundleManager_->QueryAbilityInfo(contactsWant, contactsInfo))) {
|
||||
HILOG_INFO("Waiting query contacts service completed.");
|
||||
usleep(REPOLL_TIME_MICRO_SECONDS);
|
||||
}
|
||||
|
||||
(void)StartAbility(contactsWant, DEFAULT_INVAL_VALUE);
|
||||
}
|
||||
|
||||
void AbilityManagerService::StartingMmsAbility()
|
||||
{
|
||||
HILOG_DEBUG("%{public}s", __func__);
|
||||
if (!iBundleManager_) {
|
||||
HILOG_INFO("bms service is null");
|
||||
return;
|
||||
}
|
||||
|
||||
AppExecFwk::AbilityInfo mmsInfo;
|
||||
Want mmsWant;
|
||||
mmsWant.SetElementName(AbilityConfig::MMS_BUNDLE_NAME, AbilityConfig::MMS_ABILITY_NAME);
|
||||
|
||||
while (!(iBundleManager_->QueryAbilityInfo(mmsWant, mmsInfo))) {
|
||||
HILOG_INFO("Waiting query mms service completed.");
|
||||
usleep(REPOLL_TIME_MICRO_SECONDS);
|
||||
}
|
||||
|
||||
(void)StartAbility(mmsWant, DEFAULT_INVAL_VALUE);
|
||||
}
|
||||
|
||||
void AbilityManagerService::StartSystemUi(const std::string abilityName)
|
||||
{
|
||||
HILOG_INFO("Starting system ui app.");
|
||||
@@ -1844,6 +1888,16 @@ int AbilityManagerService::KillProcess(const std::string &bundleName)
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
int AbilityManagerService::ClearUpApplicationData(const std::string &bundleName)
|
||||
{
|
||||
HILOG_DEBUG("ClearUpApplicationData, bundleName: %{public}s", bundleName.c_str());
|
||||
int ret = DelayedSingleton<AppScheduler>::GetInstance()->ClearUpApplicationData(bundleName);
|
||||
if (ret != ERR_OK) {
|
||||
return CLEAR_APPLICATION_DATA_FAIL;
|
||||
}
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
int AbilityManagerService::UninstallApp(const std::string &bundleName)
|
||||
{
|
||||
HILOG_DEBUG("Uninstall app, bundleName: %{public}s", bundleName.c_str());
|
||||
@@ -2207,6 +2261,19 @@ void AbilityManagerService::StartSystemApplication()
|
||||
HILOG_INFO("start navigation bar");
|
||||
StartingSystemUiAbility(SatrtUiMode::NAVIGATIONBAR);
|
||||
}
|
||||
|
||||
if (amsConfigResolver_->GetStartContactsState()) {
|
||||
HILOG_INFO("start contacts");
|
||||
StartingContactsAbility();
|
||||
}
|
||||
|
||||
if (amsConfigResolver_->GetStartMmsState()) {
|
||||
HILOG_INFO("start mms");
|
||||
StartingMmsAbility();
|
||||
}
|
||||
|
||||
// Location may change
|
||||
DelayedSingleton<AppScheduler>::GetInstance()->StartupResidentProcess();
|
||||
}
|
||||
|
||||
void AbilityManagerService::ConnectBmsService()
|
||||
|
||||
@@ -105,6 +105,7 @@ void AbilityManagerStub::SecondStepInit()
|
||||
requestFuncMap_[UPDATE_CONFIGURATION] = &AbilityManagerStub::UpdateConfigurationInner;
|
||||
requestFuncMap_[SET_SHOW_ON_LOCK_SCREEN] = &AbilityManagerStub::SetShowOnLockScreenInner;
|
||||
requestFuncMap_[GET_SYSTEM_MEMORY_ATTR] = &AbilityManagerStub::GetSystemMemoryAttrInner;
|
||||
requestFuncMap_[CLEAR_UP_APPLICATION_DATA] = &AbilityManagerStub::ClearUpApplicationDataInner;
|
||||
requestFuncMap_[LOCK_MISSION_FOR_CLEANUP] = &AbilityManagerStub::LockMissionForCleanupInner;
|
||||
requestFuncMap_[UNLOCK_MISSION_FOR_CLEANUP] = &AbilityManagerStub::UnlockMissionForCleanupInner;
|
||||
requestFuncMap_[REGISTER_MISSION_LISTENER] = &AbilityManagerStub::RegisterMissionListenerInner;
|
||||
@@ -363,6 +364,17 @@ int AbilityManagerStub::KillProcessInner(MessageParcel &data, MessageParcel &rep
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
int AbilityManagerStub::ClearUpApplicationDataInner(MessageParcel &data, MessageParcel &reply)
|
||||
{
|
||||
std::string bundleName = Str16ToStr8(data.ReadString16());
|
||||
int result = ClearUpApplicationData(bundleName);
|
||||
if (!reply.WriteInt32(result)) {
|
||||
HILOG_ERROR("ClearUpApplicationData error");
|
||||
return ERR_INVALID_VALUE;
|
||||
}
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
int AbilityManagerStub::UninstallAppInner(MessageParcel &data, MessageParcel &reply)
|
||||
{
|
||||
std::string bundleName = Str16ToStr8(data.ReadString16());
|
||||
|
||||
@@ -2770,8 +2770,7 @@ void AbilityStackManager::BackToLauncher()
|
||||
auto fullScreenStack = GetTopFullScreenStackIncludeSplitScreen();
|
||||
CHECK_POINTER(fullScreenStack);
|
||||
auto currentTopAbility = fullScreenStack->GetTopAbilityRecord();
|
||||
if (currentTopAbility && (currentTopAbility->IsAbilityState(AbilityState::ACTIVE) ||
|
||||
currentTopAbility->IsAbilityState(AbilityState::ACTIVATING))) {
|
||||
if (currentTopAbility && (currentTopAbility->IsAbilityState(AbilityState::ACTIVE))) {
|
||||
HILOG_WARN("Current top ability is active, no need to start launcher.");
|
||||
return;
|
||||
}
|
||||
@@ -2938,7 +2937,7 @@ void AbilityStackManager::OnTimeOut(uint32_t msgId, int64_t eventId)
|
||||
ActiveTopAbility(abilityRecord);
|
||||
break;
|
||||
case AbilityManagerService::ACTIVE_TIMEOUT_MSG:
|
||||
DelayedStartLauncher();
|
||||
HandleActiveTimeout(abilityRecord);
|
||||
break;
|
||||
case AbilityManagerService::INACTIVE_TIMEOUT_MSG:
|
||||
case AbilityManagerService::FOREGROUNDNEW_TIMEOUT_MSG:
|
||||
@@ -2949,6 +2948,31 @@ void AbilityStackManager::OnTimeOut(uint32_t msgId, int64_t eventId)
|
||||
}
|
||||
}
|
||||
|
||||
void AbilityStackManager::HandleActiveTimeout(const std::shared_ptr<AbilityRecord> &ability)
|
||||
{
|
||||
HILOG_DEBUG("Handle active timeout");
|
||||
CHECK_POINTER(ability);
|
||||
DelayedSingleton<AppScheduler>::GetInstance()->AttachTimeOut(ability->GetToken());
|
||||
|
||||
if (ability->IsLauncherRoot()) {
|
||||
HILOG_INFO("Launcher root load timeout, restart.");
|
||||
BackToLauncher();
|
||||
return;
|
||||
}
|
||||
|
||||
auto missionRecord = ability->GetMissionRecord();
|
||||
CHECK_POINTER(missionRecord);
|
||||
auto stack = missionRecord->GetMissionStack();
|
||||
CHECK_POINTER(stack);
|
||||
missionRecord->RemoveAbilityRecord(ability);
|
||||
if (missionRecord->IsEmpty()) {
|
||||
RemoveMissionRecordById(missionRecord->GetMissionRecordId());
|
||||
JudgingIsRemoveMultiScreenStack(stack);
|
||||
}
|
||||
|
||||
BackToLauncher();
|
||||
}
|
||||
|
||||
int AbilityStackManager::MoveMissionToFloatingStack(const MissionOption &missionOption)
|
||||
{
|
||||
HILOG_DEBUG("Move mission to floating stack, missionId: %{public}d", missionOption.missionId);
|
||||
@@ -3620,7 +3644,7 @@ void AbilityStackManager::ActiveTopAbility(const std::shared_ptr<AbilityRecord>
|
||||
|
||||
if (abilityRecord->IsLauncherRoot()) {
|
||||
HILOG_INFO("Launcher root load timeout, restart.");
|
||||
DelayedStartLauncher();
|
||||
BackToLauncher();
|
||||
return;
|
||||
}
|
||||
if (abilityRecord->IsLockScreenRoot()) {
|
||||
|
||||
@@ -52,6 +52,16 @@ bool AmsConfigurationParameter::GetPhoneServiceState() const
|
||||
return canStartPhoneService_;
|
||||
}
|
||||
|
||||
bool AmsConfigurationParameter::GetStartContactsState() const
|
||||
{
|
||||
return canStartContacts;
|
||||
}
|
||||
|
||||
bool AmsConfigurationParameter::GetStartMmsState() const
|
||||
{
|
||||
return canStartMms;
|
||||
}
|
||||
|
||||
bool AmsConfigurationParameter::NonConfigFile() const
|
||||
{
|
||||
return nonConfigFile_;
|
||||
@@ -124,6 +134,8 @@ int AmsConfigurationParameter::LoadAppConfigurationForStartUpService(nlohmann::j
|
||||
Object.at(AmsConfig::SERVICE_ITEM_AMS).at(AmsConfig::STARTUP_NAVIGATION_BAR).get<bool>();
|
||||
canStartPhoneService_ =
|
||||
Object.at(AmsConfig::SERVICE_ITEM_AMS).at(AmsConfig::STARTUP_PHONE_SERVICE).get<bool>();
|
||||
canStartContacts = Object.at(AmsConfig::SERVICE_ITEM_AMS).at(AmsConfig::STARTUP_CONTACTS).get<bool>();
|
||||
canStartMms = Object.at(AmsConfig::SERVICE_ITEM_AMS).at(AmsConfig::STARTUP_MMS).get<bool>();
|
||||
missionSaveTime_ = Object.at(AmsConfig::SERVICE_ITEM_AMS).at(AmsConfig::MISSION_SAVE_TIME).get<int>();
|
||||
HILOG_INFO("get ams service config succes!");
|
||||
ret = 0;
|
||||
|
||||
@@ -173,6 +173,17 @@ int AppScheduler::KillApplication(const std::string &bundleName)
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
int AppScheduler::ClearUpApplicationData(const std::string &bundleName)
|
||||
{
|
||||
CHECK_POINTER_AND_RETURN(appMgrClient_, INNER_ERR);
|
||||
int ret = (int)appMgrClient_->ClearUpApplicationData(bundleName);
|
||||
if (ret != ERR_OK) {
|
||||
HILOG_ERROR("Fail to clear application data.");
|
||||
return INNER_ERR;
|
||||
}
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
void AppScheduler::AttachTimeOut(const sptr<IRemoteObject> &token)
|
||||
{
|
||||
CHECK_POINTER(appMgrClient_);
|
||||
@@ -215,5 +226,11 @@ void AppScheduler::GetSystemMemoryAttr(AppExecFwk::SystemMemoryAttr &memoryInfo,
|
||||
CHECK_POINTER(appMgrClient_);
|
||||
appMgrClient_->GetSystemMemoryAttr(memoryInfo, strConfig);
|
||||
}
|
||||
|
||||
void AppScheduler::StartupResidentProcess()
|
||||
{
|
||||
CHECK_POINTER(appMgrClient_);
|
||||
appMgrClient_->StartupResidentProcess();
|
||||
}
|
||||
} // namespace AAFwk
|
||||
} // namespace OHOS
|
||||
|
||||
@@ -37,9 +37,13 @@ void ConfigurationDistributor::Atach(const std::weak_ptr<ConfigurationHolder> &o
|
||||
HILOG_INFO("Atach ob is null");
|
||||
return;
|
||||
}
|
||||
int id = ob.lock()->GetId();
|
||||
auto ability = ob.lock();
|
||||
int id = ability->GetId();
|
||||
HILOG_INFO("Atach ob id[%{public}d]", id);
|
||||
observerList_.emplace_back(ob);
|
||||
|
||||
// Init ability thread configurtion object
|
||||
ability->UpdateConfiguration(config_);
|
||||
}
|
||||
|
||||
void ConfigurationDistributor::Detach(const std::weak_ptr<ConfigurationHolder> &ob)
|
||||
@@ -77,5 +81,11 @@ void ConfigurationDistributor::UpdateConfiguration(const AppExecFwk::Configurati
|
||||
}
|
||||
HILOG_INFO("notify done");
|
||||
}
|
||||
|
||||
void ConfigurationDistributor::InitConfiguration(const AppExecFwk::Configuration &newConfig)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(configLock_);
|
||||
config_ = newConfig;
|
||||
}
|
||||
} // namespace AAFwk
|
||||
} // namespace OHOS
|
||||
@@ -65,11 +65,6 @@ sptr<IAbilityScheduler> DataAbilityManager::Acquire(
|
||||
HILOG_ERROR("Data ability manager acquire: invalid client token.");
|
||||
return nullptr;
|
||||
}
|
||||
if (abilityRequest.abilityInfo.bundleName == clientAbilityRecord->GetAbilityInfo().bundleName &&
|
||||
abilityRequest.abilityInfo.name == clientAbilityRecord->GetAbilityInfo().name) {
|
||||
HILOG_ERROR("Data ability '%{public}s' cannot acquires itself.", dataAbilityName.c_str());
|
||||
return nullptr;
|
||||
}
|
||||
HILOG_INFO("Ability '%{public}s' acquiring data ability '%{public}s'...",
|
||||
clientAbilityRecord->GetAbilityInfo().name.c_str(),
|
||||
dataAbilityName.c_str());
|
||||
|
||||
@@ -139,6 +139,17 @@ void AppScheduler::GetSystemMemoryAttr(AppExecFwk::SystemMemoryAttr &memoryInfo,
|
||||
memoryInfo.threshold_ = testValue;
|
||||
}
|
||||
|
||||
void AppScheduler::StartupResidentProcess()
|
||||
{
|
||||
HILOG_INFO("Test AppScheduler::StartupResidentProcess()");
|
||||
}
|
||||
|
||||
int AppScheduler::ClearUpApplicationData(const std::string &bundleName)
|
||||
{
|
||||
HILOG_INFO("Test AppScheduler::ClearUpApplicationData()");
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
void AppScheduler::UpdateAbilityState(const sptr<IRemoteObject> &token, const AppExecFwk::AbilityState state)
|
||||
{
|
||||
HILOG_INFO("Test AppScheduler::UpdateAbilityState()");
|
||||
|
||||
+5
@@ -294,6 +294,11 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual int ClearUpApplicationData(const std::string &bundleName) override
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
MOCK_METHOD2(TerminateAbilityByCaller, int(const sptr<IRemoteObject> &callerToken, int requestCode));
|
||||
MOCK_METHOD3(StartAbility, int(const Want &want, const sptr<IRemoteObject> &callerToken, int requestCode));
|
||||
MOCK_METHOD2(
|
||||
|
||||
+5
@@ -304,6 +304,11 @@ public:
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual int ClearUpApplicationData(const std::string &bundleName) override
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
} // namespace AAFwk
|
||||
} // namespace OHOS
|
||||
|
||||
@@ -101,6 +101,7 @@ public:
|
||||
MOCK_METHOD1(CleanMission, int(int32_t missionId));
|
||||
MOCK_METHOD0(CleanAllMissions, int());
|
||||
MOCK_METHOD1(MoveMissionToFront, int(int32_t missionId));
|
||||
MOCK_METHOD1(ClearUpApplicationData, int(const std::string &));
|
||||
|
||||
void Wait()
|
||||
{
|
||||
|
||||
@@ -1817,14 +1817,17 @@ HWTEST_F(AbilityMgrModuleTest, UpdateConfiguration_028, TestSize.Level1)
|
||||
|
||||
int displeyId = 1001;
|
||||
std::string key = GlobalConfigurationKey::SYSTEM_LANGUAGE;
|
||||
std::string val = "中文";
|
||||
std::string val = "Chinese";
|
||||
auto Compare = [displeyId, key, val](const AppExecFwk::Configuration &config) {
|
||||
auto item = config.GetItem(displeyId, key);
|
||||
EXPECT_EQ(item, val);
|
||||
};
|
||||
|
||||
sptr<MockAbilityScheduler> scheduler(new MockAbilityScheduler());
|
||||
EXPECT_CALL(*scheduler, ScheduleUpdateConfiguration(_)).Times(1).WillOnce(Invoke(Compare));
|
||||
EXPECT_CALL(*scheduler, ScheduleUpdateConfiguration(_))
|
||||
.Times(2)
|
||||
.WillOnce(Return())
|
||||
.WillOnce(Invoke(Compare));
|
||||
|
||||
auto ref = abilityMgrServ_->AttachAbilityThread(scheduler, abilityRecord->GetToken());
|
||||
EXPECT_EQ(ref, 0);
|
||||
@@ -1872,14 +1875,72 @@ HWTEST_F(AbilityMgrModuleTest, UpdateConfiguration_029, TestSize.Level1)
|
||||
|
||||
int displeyId = 1001;
|
||||
std::string key = GlobalConfigurationKey::SYSTEM_LANGUAGE;
|
||||
std::string val = "德文";
|
||||
std::string val = "German";
|
||||
auto Compare = [displeyId, key, val](const AppExecFwk::Configuration &config) {
|
||||
auto item = config.GetItem(displeyId, key);
|
||||
EXPECT_EQ(item, val);
|
||||
};
|
||||
|
||||
sptr<MockAbilityScheduler> scheduler(new MockAbilityScheduler());
|
||||
EXPECT_CALL(*scheduler, ScheduleUpdateConfiguration(_)).Times(1).WillOnce(Invoke(Compare));
|
||||
EXPECT_CALL(*scheduler, ScheduleUpdateConfiguration(_))
|
||||
.Times(2)
|
||||
.WillOnce(Return())
|
||||
.WillOnce(Invoke(Compare));
|
||||
|
||||
abilityMgrServ_->AttachAbilityThread(scheduler, abilityRecord->GetToken());
|
||||
|
||||
int size = DelayedSingleton<ConfigurationDistributor>::GetInstance()->observerList_.size();
|
||||
EXPECT_TRUE(size > 0);
|
||||
|
||||
AppExecFwk::Configuration newConfig;
|
||||
newConfig.AddItem(displeyId, key, val);
|
||||
|
||||
auto updateRef = abilityMgrServ_->UpdateConfiguration(newConfig);
|
||||
EXPECT_EQ(updateRef, 0);
|
||||
|
||||
PacMap saveData;
|
||||
abilityMgrServ_->AbilityTransitionDone(abilityRecord->GetToken(), 0, saveData);
|
||||
|
||||
int num = size - 1;
|
||||
size = DelayedSingleton<ConfigurationDistributor>::GetInstance()->observerList_.size();
|
||||
EXPECT_EQ(size, num);
|
||||
}
|
||||
|
||||
/*
|
||||
* Feature: AbilityManagerService
|
||||
* Function: UpdateConfiguration
|
||||
* SubFunction: NA
|
||||
* FunctionPoints: NA
|
||||
* EnvConditions: NA
|
||||
* CaseDescription: luncher ability
|
||||
*/
|
||||
HWTEST_F(AbilityMgrModuleTest, UpdateConfiguration_030, TestSize.Level1)
|
||||
{
|
||||
EXPECT_TRUE(abilityMgrServ_);
|
||||
std::string abilityName = "luncher";
|
||||
std::string bundleName = "com.ix.hiworld";
|
||||
|
||||
SetActive();
|
||||
Want want = CreateWant(abilityName, bundleName);
|
||||
auto startRef = abilityMgrServ_->StartAbility(want);
|
||||
EXPECT_EQ(startRef, 0);
|
||||
|
||||
std::shared_ptr<AbilityRecord> abilityRecord = abilityMgrServ_->GetStackManager()->GetCurrentTopAbility();
|
||||
EXPECT_TRUE(abilityRecord);
|
||||
|
||||
int displeyId = 1001;
|
||||
std::string key = GlobalConfigurationKey::SYSTEM_LANGUAGE;
|
||||
std::string val = "Italian";
|
||||
auto Compare = [displeyId, key, val](const AppExecFwk::Configuration &config) {
|
||||
auto item = config.GetItem(displeyId, key);
|
||||
EXPECT_EQ(item, val);
|
||||
};
|
||||
|
||||
sptr<MockAbilityScheduler> scheduler(new MockAbilityScheduler());
|
||||
EXPECT_CALL(*scheduler, ScheduleUpdateConfiguration(_))
|
||||
.Times(2)
|
||||
.WillOnce(Return())
|
||||
.WillOnce(Invoke(Compare));
|
||||
|
||||
abilityMgrServ_->AttachAbilityThread(scheduler, abilityRecord->GetToken());
|
||||
|
||||
|
||||
@@ -127,6 +127,7 @@ public:
|
||||
MOCK_METHOD1(CleanMission, int(int32_t missionId));
|
||||
MOCK_METHOD0(CleanAllMissions, int());
|
||||
MOCK_METHOD1(MoveMissionToFront, int(int32_t missionId));
|
||||
MOCK_METHOD1(ClearUpApplicationData, int(const std::string &));
|
||||
|
||||
public:
|
||||
std::string powerState_;
|
||||
|
||||
@@ -75,7 +75,6 @@ private:
|
||||
std::string path_;
|
||||
|
||||
void StripTrailingSeparatorsInternal();
|
||||
int FindDriveLetter(const std::string &path);
|
||||
bool AreAllSeparators(const std::string &input);
|
||||
};
|
||||
} // namespace LIBZIP
|
||||
|
||||
+11
-30
@@ -106,14 +106,8 @@ void FilePath::GetComponents(std::vector<std::string> &components)
|
||||
|
||||
// Capture root, if any.
|
||||
base = current.BaseName();
|
||||
if (!base.path_.empty() && base.path_ != kCurrentDirectory)
|
||||
if (!base.path_.empty() && base.path_ != kCurrentDirectory) {
|
||||
components.push_back(current.BaseName().path_);
|
||||
|
||||
// Capture drive letter, if any.
|
||||
FilePath dir = current.DirName();
|
||||
int letter = FindDriveLetter(dir.path_);
|
||||
if (letter != static_cast<int>(std::string::npos)) {
|
||||
components.push_back(std::string(dir.path_, 0, letter + 1));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,22 +116,22 @@ FilePath FilePath::DirName()
|
||||
FilePath newPath(path_);
|
||||
newPath.StripTrailingSeparatorsInternal();
|
||||
|
||||
int letter = FindDriveLetter(newPath.path_);
|
||||
std::string::size_type lastSeparator =
|
||||
newPath.path_.find_last_of(kSeparators, std::string::npos, kSeparatorsLength - 1);
|
||||
int one = 1;
|
||||
int two = 2;
|
||||
int three = 3;
|
||||
std::string::size_type zero = 0;
|
||||
std::string::size_type one = 1;
|
||||
std::string::size_type two = 2;
|
||||
|
||||
if (lastSeparator == std::string::npos) {
|
||||
// path_ is in the current directory.
|
||||
newPath.path_.resize(letter + one);
|
||||
} else if (lastSeparator == letter + one) {
|
||||
newPath.path_.resize(zero);
|
||||
} else if (lastSeparator == zero) {
|
||||
// path_ is in the root directory.
|
||||
newPath.path_.resize(letter + two);
|
||||
} else if (lastSeparator == letter + two && IsSeparator(newPath.path_[letter + one])) {
|
||||
newPath.path_.resize(one);
|
||||
} else if (lastSeparator == one && IsSeparator(newPath.path_[zero])) {
|
||||
// path_ is in "//" (possibly with a drive letter); leave the double
|
||||
// separator intact indicating alternate root.
|
||||
newPath.path_.resize(letter + three);
|
||||
newPath.path_.resize(two);
|
||||
} else if (lastSeparator != 0) {
|
||||
// path_ is somewhere else, trim the basename.
|
||||
newPath.path_.resize(lastSeparator);
|
||||
@@ -154,11 +148,6 @@ FilePath FilePath::BaseName()
|
||||
{
|
||||
FilePath newPath(path_);
|
||||
newPath.StripTrailingSeparatorsInternal();
|
||||
// The drive letter, if any, is always stripped.
|
||||
int letter = FindDriveLetter(newPath.path_);
|
||||
if (letter != static_cast<int>(std::string::npos)) {
|
||||
newPath.path_.erase(0, letter + 1);
|
||||
}
|
||||
|
||||
// Keep everything after the final separator, but if the pathname is only
|
||||
// one character and it's a separator, leave it alone.
|
||||
@@ -178,10 +167,7 @@ void FilePath::StripTrailingSeparatorsInternal()
|
||||
}
|
||||
int one = 1;
|
||||
int two = 2;
|
||||
int start = FindDriveLetter(path_) + two;
|
||||
if (start <= 0) {
|
||||
return;
|
||||
}
|
||||
int start = 1;
|
||||
std::string::size_type lastStripped = std::string::npos;
|
||||
for (std::string::size_type pos = path_.length(); pos > start && FilePath::IsSeparator(path_[pos - one]); --pos) {
|
||||
if (pos != start + one || lastStripped == start + two || !FilePath::IsSeparator(path_[start - one])) {
|
||||
@@ -191,11 +177,6 @@ void FilePath::StripTrailingSeparatorsInternal()
|
||||
}
|
||||
}
|
||||
|
||||
int FilePath::FindDriveLetter(const std::string &path)
|
||||
{
|
||||
return (int)std::string::npos;
|
||||
}
|
||||
|
||||
bool FilePath::AreAllSeparators(const std::string &input)
|
||||
{
|
||||
for (std::string::const_iterator it = input.begin(); it != input.end(); ++it) {
|
||||
|
||||
Reference in New Issue
Block a user