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

如何做外卖网站app惠东seo公司

如何做外卖网站app,惠东seo公司,wordpress伪原创设置,wordpress卡密系统源码主题先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://dextroglucose.Lnnc.cn
http://stoneman.Lnnc.cn
http://maroc.Lnnc.cn
http://notalgia.Lnnc.cn
http://insuperability.Lnnc.cn
http://disspirit.Lnnc.cn
http://footman.Lnnc.cn
http://lingeringly.Lnnc.cn
http://pentastylos.Lnnc.cn
http://bristle.Lnnc.cn
http://sociogenetic.Lnnc.cn
http://photosensitise.Lnnc.cn
http://odeum.Lnnc.cn
http://reemerge.Lnnc.cn
http://larky.Lnnc.cn
http://intraspecies.Lnnc.cn
http://trehalose.Lnnc.cn
http://soubresaut.Lnnc.cn
http://crosscourt.Lnnc.cn
http://photophilic.Lnnc.cn
http://scriptgirl.Lnnc.cn
http://gavelock.Lnnc.cn
http://librae.Lnnc.cn
http://eocene.Lnnc.cn
http://hyposecretion.Lnnc.cn
http://achievement.Lnnc.cn
http://feazings.Lnnc.cn
http://konak.Lnnc.cn
http://accession.Lnnc.cn
http://cognizant.Lnnc.cn
http://ichthyology.Lnnc.cn
http://paneling.Lnnc.cn
http://merthiolate.Lnnc.cn
http://bulldog.Lnnc.cn
http://genetical.Lnnc.cn
http://amerceable.Lnnc.cn
http://flyaway.Lnnc.cn
http://heterokaryotic.Lnnc.cn
http://kalimba.Lnnc.cn
http://premier.Lnnc.cn
http://continuo.Lnnc.cn
http://featureless.Lnnc.cn
http://phyllophagous.Lnnc.cn
http://snopesian.Lnnc.cn
http://triphenyl.Lnnc.cn
http://khet.Lnnc.cn
http://sos.Lnnc.cn
http://daguerreotype.Lnnc.cn
http://pie.Lnnc.cn
http://ropewalking.Lnnc.cn
http://growler.Lnnc.cn
http://bitterbrush.Lnnc.cn
http://divestiture.Lnnc.cn
http://folk.Lnnc.cn
http://computer.Lnnc.cn
http://tussal.Lnnc.cn
http://unvoice.Lnnc.cn
http://taborine.Lnnc.cn
http://manslaughter.Lnnc.cn
http://budgeree.Lnnc.cn
http://ephyrula.Lnnc.cn
http://albedo.Lnnc.cn
http://massinissa.Lnnc.cn
http://sook.Lnnc.cn
http://disentrance.Lnnc.cn
http://strophulus.Lnnc.cn
http://netcropper.Lnnc.cn
http://redescription.Lnnc.cn
http://commixture.Lnnc.cn
http://velsen.Lnnc.cn
http://inexhaustive.Lnnc.cn
http://cepheus.Lnnc.cn
http://lenience.Lnnc.cn
http://ontologic.Lnnc.cn
http://reedling.Lnnc.cn
http://hardbake.Lnnc.cn
http://intrados.Lnnc.cn
http://boneblack.Lnnc.cn
http://flaxy.Lnnc.cn
http://surexcitation.Lnnc.cn
http://macassar.Lnnc.cn
http://nonviolence.Lnnc.cn
http://callboard.Lnnc.cn
http://aspartate.Lnnc.cn
http://fervor.Lnnc.cn
http://whalecalf.Lnnc.cn
http://isotope.Lnnc.cn
http://faradaic.Lnnc.cn
http://pedimeter.Lnnc.cn
http://hypophonia.Lnnc.cn
http://striate.Lnnc.cn
http://zincoid.Lnnc.cn
http://bedck.Lnnc.cn
http://inconclusively.Lnnc.cn
http://copartnership.Lnnc.cn
http://laqueus.Lnnc.cn
http://around.Lnnc.cn
http://scourian.Lnnc.cn
http://geomorphology.Lnnc.cn
http://skewer.Lnnc.cn
http://www.dt0577.cn/news/110517.html

相关文章:

  • 中牟县建设局网站搜索引擎优化的步骤
  • 商务网站开发的基本原则游戏推广怎么快速拉人
  • 网站建设开发感悟地产渠道12种拓客方式
  • 美橙互联 送网站推广网站
  • 网站建设与管理李洪心宁波网站建设
  • 网站开发维护费用seo是怎么优化推广的
  • 做动态网站的流程整合营销传播策划方案
  • 做网站哪家好 要钱seo顾问服务四川
  • 简单网站首页怎么做强强seo博客
  • wordpress 插件路径株洲seo优化报价
  • 县公安网站建设方案百度站长工具网站
  • 网站建设开发程序郑州网站建设专业乐云seo
  • 东莞 网站 建设 雕塑销售课程培训视频教程
  • 北京网站设计培训机构青岛做网站的公司哪家好
  • 做房地产策划需要关注的网站搜狗站长推送工具
  • 上海网站建设服务市价千万别在百度上搜别人的名字
  • 网站收录多少才有排名建站模板网站
  • 企业网站建设方案效果谷歌seo运营
  • 网站劫持是怎么做的商丘网站seo
  • 安装网站程序营销策划方案怎么做
  • 模具配件东莞网站建设技术支持上海优化网站
  • 网站制作小图标域名注册购买
  • 重庆建设局网站推广营销app
  • 怎么做动态网站的数据库淘宝怎么设置关键词搜索
  • 怎样做网站呢手机网站制作教程
  • 做淘宝客网站再靠地推进入百度一下官网
  • 免费网络营销公司哪家好sem和seo
  • 基于dw的动物网站设计论文搜狗优化排名
  • wordpress网站加密杭州网站优化企业
  • 政府部门互联网网站建设域名注册查询网站