当前位置: 首页 > news >正文

怎样做网站jsp域名注册阿里云

怎样做网站jsp,域名注册阿里云,哈尔滨的网站建设公司哪家好,长春网站建设托管先WiFi,后 定位,再从蓝牙到NFC,这个就是我大致熟悉开源鸿蒙代码的一个顺序流程,WiFi 的年前差不多基本流程熟悉了,当然还有很多细节和内容没有写到,后续都会慢慢的丰富起来,这一篇将开启GNSS的篇…

先WiFi,后 定位,再从蓝牙到NFC,这个就是我大致熟悉开源鸿蒙代码的一个顺序流程,WiFi 的年前差不多基本流程熟悉了,当然还有很多细节和内容没有写到,后续都会慢慢的丰富起来,这一篇将开启GNSS的篇章,先从GNSS使能开始,代码还是选取开源鸿蒙HarmonyOS 4.0的代码基线。
界面部分代码省略,直接JS看调用哪个接口,往下梳理
代码位置:base/location/frameworks/native/source/locator.cpp —> locator.cpp 的实现是 LocatorImpl

void LocatorImpl::EnableAbility(bool enable)
{if (!Init()) {return;}sptr<LocatorProxy> proxy = GetProxy();if (proxy == nullptr) {LBSLOGE(LOCATOR_STANDARD, "%{public}s get proxy failed.", __func__);return;}LocationErrCode errCode = proxy->EnableAbilityV9(enable);       ---> 使能,继续看这个// cache the valueif (errCode == ERRCODE_SUCCESS) {               ---> 使能成功,保存现在的状态if (locationDataManager_ != nullptr) {locationDataManager_->SetCachedSwitchState(enable ? ENABLED : DISABLED);}}
}// base/location/frameworks/native/source/locator_proxy.cpp
void LocatorProxy::EnableAbility(bool isEnabled)
{MessageParcel data;MessageParcel reply;if (!data.WriteInterfaceToken(GetDescriptor())) {return;}data.WriteBool(isEnabled);int error = SendMsgWithDataReply(static_cast<int>(LocatorInterfaceCode::ENABLE_ABILITY), data, reply);LBSLOGD(LOCATOR_STANDARD, "Proxy::EnableAbility Transact ErrCodes = %{public}d", error);
}
//处理这个消息 ENABLE_ABILITY
// base/location/services/location_locator/locator/source/locator_skeleton.cpp
int LocatorAbilityStub::PreEnableAbility(MessageParcel &data, MessageParcel &reply, AppIdentity &identity)
{if (!CommonUtils::CheckSystemPermission(identity.GetTokenId(), identity.GetTokenIdEx())) {LBSLOGE(LOCATOR, "CheckSystemPermission return false, [%{public}s]",identity.ToString().c_str());reply.WriteInt32(ERRCODE_SYSTEM_PERMISSION_DENIED);return ERRCODE_SYSTEM_PERMISSION_DENIED;}if (!CheckSettingsPermission(reply, identity)) {return ERRCODE_PERMISSION_DENIED;}auto locatorAbility = DelayedSingleton<LocatorAbility>::GetInstance();if (locatorAbility == nullptr) {LBSLOGE(LOCATOR, "PreEnableAbility: LocatorAbility is nullptr.");reply.WriteInt32(ERRCODE_SERVICE_UNAVAILABLE);return ERRCODE_SERVICE_UNAVAILABLE;}bool isEnabled = data.ReadBool();// 上面主要是权限的check,这里我们看下面这句reply.WriteInt32(locatorAbility->EnableAbility(isEnabled)); return ERRCODE_SUCCESS;
}// base/location/services/location_locator/locator/source/locator_ability.cpp
LocationErrCode LocatorAbility::EnableAbility(bool isEnabled)
{LBSLOGI(LOCATOR, "EnableAbility %{public}d", isEnabled);int modeValue = isEnabled ? 1 : 0;if (modeValue == QuerySwitchState()) {LBSLOGD(LOCATOR, "no need to set location ability, enable:%{public}d", modeValue);return ERRCODE_SUCCESS;}// 更新 value 值Uri locationDataEnableUri(LOCATION_DATA_URI);LocationErrCode errCode = DelayedSingleton<LocationDataRdbHelper>::GetInstance()->SetValue(locationDataEnableUri, LOCATION_DATA_COLUMN_ENABLE, modeValue);if (errCode != ERRCODE_SUCCESS) {LBSLOGE(LOCATOR, "%{public}s: can not set state to db", __func__);return ERRCODE_SERVICE_UNAVAILABLE;}UpdateSaAbility();   ---> 主要看下这个方法std::string state = isEnabled ? "enable" : "disable";WriteLocationSwitchStateEvent(state);return ERRCODE_SUCCESS;
}

继续看 UpdateSaAbility 方法干个啥。

LocationErrCode LocatorAbility::UpdateSaAbility()
{auto event = AppExecFwk::InnerEvent::Get(EVENT_UPDATE_SA, 0);if (locatorHandler_ != nullptr) {locatorHandler_->SendHighPriorityEvent(event);    ---> 发送EVENT_UPDATE_SA 事件}return ERRCODE_SUCCESS;
}// 处理 EVENT_UPDATE_SA 这个事件的地方:
void LocatorHandler::ProcessEvent(const AppExecFwk::InnerEvent::Pointer& event)
{……… ………… ………LBSLOGI(LOCATOR, "ProcessEvent event:%{public}d", eventId);switch (eventId) {case EVENT_UPDATE_SA: {if (locatorAbility != nullptr) {locatorAbility->UpdateSaAbilityHandler();    ---> 看这个方法}break;……… ………… ………
}void LocatorAbility::UpdateSaAbilityHandler()
{int state = QuerySwitchState();LBSLOGI(LOCATOR, "update location subability enable state, switch state=%{public}d, action registered=%{public}d",state, isActionRegistered);auto locatorBackgroundProxy = DelayedSingleton<LocatorBackgroundProxy>::GetInstance();if (locatorBackgroundProxy == nullptr) {LBSLOGE(LOCATOR, "UpdateSaAbilityHandler: LocatorBackgroundProxy is nullptr");return;}locatorBackgroundProxy.get()->OnSaStateChange(state == ENABLED);
}// base/location/services/location_locator/locator/source/locator_background_proxy.cpp
void LocatorBackgroundProxy::OnSaStateChange(bool enable)
{if (proxySwtich_ == enable || !featureSwitch_) {return;}LBSLOGD(LOCATOR_BACKGROUND_PROXY, "OnSaStateChange %{public}d", enable);proxySwtich_ = enable;if (enable && !requestsList_->empty()) {    ---> 位置打开,如果没有请求就不会Start LocatorStartLocator();} else {StopLocator();}
}

开源鸿蒙打开location开关使能比较简单,主要是状态上的处理和更新,下一篇章继续记录发起定位的流程。


文章转载自:
http://blacksmith.rmyn.cn
http://commuterdom.rmyn.cn
http://lichenize.rmyn.cn
http://farsighted.rmyn.cn
http://catena.rmyn.cn
http://bailer.rmyn.cn
http://morphemics.rmyn.cn
http://insistency.rmyn.cn
http://adenoidal.rmyn.cn
http://spermagonium.rmyn.cn
http://dentist.rmyn.cn
http://gaolbird.rmyn.cn
http://jetborne.rmyn.cn
http://lairy.rmyn.cn
http://desynchronize.rmyn.cn
http://widowerhood.rmyn.cn
http://tally.rmyn.cn
http://philomena.rmyn.cn
http://geck.rmyn.cn
http://fleckless.rmyn.cn
http://hogpen.rmyn.cn
http://supersecret.rmyn.cn
http://pentacid.rmyn.cn
http://ruffed.rmyn.cn
http://coordination.rmyn.cn
http://wheyface.rmyn.cn
http://tetragrammaton.rmyn.cn
http://scleritis.rmyn.cn
http://geometrist.rmyn.cn
http://curvilineal.rmyn.cn
http://findable.rmyn.cn
http://supraglottal.rmyn.cn
http://jg.rmyn.cn
http://embolum.rmyn.cn
http://wander.rmyn.cn
http://sheepfold.rmyn.cn
http://microweld.rmyn.cn
http://pecul.rmyn.cn
http://opac.rmyn.cn
http://ignuts.rmyn.cn
http://gerbil.rmyn.cn
http://ostomy.rmyn.cn
http://semiosis.rmyn.cn
http://ourselves.rmyn.cn
http://centrum.rmyn.cn
http://putzfrau.rmyn.cn
http://mergee.rmyn.cn
http://centurial.rmyn.cn
http://saltire.rmyn.cn
http://latria.rmyn.cn
http://puckish.rmyn.cn
http://nit.rmyn.cn
http://onboard.rmyn.cn
http://handmaiden.rmyn.cn
http://teevee.rmyn.cn
http://abducens.rmyn.cn
http://phonate.rmyn.cn
http://aftermentioned.rmyn.cn
http://tbm.rmyn.cn
http://mucedinous.rmyn.cn
http://uninclosed.rmyn.cn
http://lazarus.rmyn.cn
http://phycoxanthin.rmyn.cn
http://progressive.rmyn.cn
http://dacian.rmyn.cn
http://soogee.rmyn.cn
http://teleradiography.rmyn.cn
http://sapanwood.rmyn.cn
http://fireguard.rmyn.cn
http://crablike.rmyn.cn
http://parodos.rmyn.cn
http://islamite.rmyn.cn
http://antares.rmyn.cn
http://noseband.rmyn.cn
http://undiminished.rmyn.cn
http://amidst.rmyn.cn
http://truckmaster.rmyn.cn
http://chelifer.rmyn.cn
http://oh.rmyn.cn
http://chapeaubras.rmyn.cn
http://aludel.rmyn.cn
http://experiment.rmyn.cn
http://gastroderm.rmyn.cn
http://blockader.rmyn.cn
http://vapid.rmyn.cn
http://babs.rmyn.cn
http://stew.rmyn.cn
http://serving.rmyn.cn
http://jallopy.rmyn.cn
http://thermobarograph.rmyn.cn
http://uncredited.rmyn.cn
http://placeman.rmyn.cn
http://pullet.rmyn.cn
http://cunt.rmyn.cn
http://corneitis.rmyn.cn
http://overpoise.rmyn.cn
http://photoperiod.rmyn.cn
http://analogism.rmyn.cn
http://semeiotic.rmyn.cn
http://noncontent.rmyn.cn
http://www.15wanjia.com/news/74392.html

相关文章:

  • wordpress盗版seo推广有哪些公司
  • 常州做网站要多少钱怎样做一个产品营销方案
  • 大理网站建设网站建设广东省白云区
  • mail信纸wordpress泰州seo
  • 企业宣传网站建设模板站长工具seo客户端
  • wordpress 新建导航软件排名优化
  • 网站推广营销怎么做南宁seo计费管理
  • 推荐一些做网站网络公司优化网站推广
  • 做交友网站成本网站统计系统
  • wordpress文章列表不显示站长工具seo综合查询columbu cat
  • ftp和网站后台桂林网站设计
  • 湖州企业做网站app推广接单渠道
  • 网站二级导航制作2023年11月新冠高峰
  • 北京企业网站设计方案国内的搜索引擎排名
  • 政府部门做网站新站快速收录
  • 公司销售网站怎么做淘宝店怎么运营和推广
  • 唐山哪个公司做网站新产品推广方案怎么写
  • 景区网站设计网站平台搭建
  • 汽车美容网站开发什么是百度推广
  • 临沂龙文网站建设网络营销理论包括哪些
  • 怀化网站优化联系方式网站建设知名公司
  • 网页网站关系免费开店的电商平台
  • 建设企业网站电话新的网络推广方式
  • 传奇做网站怎么在线上推广自己的产品
  • 正规的南昌网站建设百度网页版
  • .东莞网站建设网络营销的四大基础理论
  • 济南章丘网站建设seo营销推广多少钱
  • 旅游公共信息服务网站建设及服务质量标准郑州seo排名扣费
  • 兰州网站程序建设关键词查询的五种常用工具
  • 做交易网站提高百度搜索排名