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

用其他商标在自己网站做宣传seo推广软件下载

用其他商标在自己网站做宣传,seo推广软件下载,网站开发工具,东莞营销型网站建设找火速IMS分为Java层与Native层两个部分,其启动过程是从Java部分的初始化开始,进而完成Native部分的初始化。 □创建新的IMS对象。 □调用IMS对象的start()函数完成启动 同其他系统服务一样,IMS在SystemServer中的ServerT…

IMS分为Java层与Native层两个部分,其启动过程是从Java部分的初始化开始,进而完成Native部分的初始化。

□创建新的IMS对象。

□调用IMS对象的start()函数完成启动

同其他系统服务一样,IMS在SystemServer中的ServerThread线程中启动。

    private void startOtherServices(@NonNull TimingsTraceAndSlog t) {t.traceBegin("startOtherServices");
            inputManager = new InputManagerService(context);inputManager.setWindowManagerCallbacks(wm.getInputManagerCallback());inputManager.start();

创建新的IMS对象

线程 mLooper = DisplayThread.get().getLooper()

构造NativeInputManagerService

    /** Point of injection for test dependencies. */@VisibleForTestingstatic class Injector {private final Context mContext;private final Looper mLooper;Injector(Context context, Looper looper) {mContext = context;mLooper = looper;}Context getContext() {return mContext;}Looper getLooper() {return mLooper;}NativeInputManagerService getNativeService(InputManagerService service) {return new NativeInputManagerService.NativeImpl(service, mLooper.getQueue());}void registerLocalService(InputManagerInternal localService) {LocalServices.addService(InputManagerInternal.class, localService);}}public InputManagerService(Context context) {this(new Injector(context, DisplayThread.get().getLooper()));}
    class NativeImpl implements NativeInputManagerService {/** Pointer to native input manager service object, used by native code. */@SuppressWarnings({"unused", "FieldCanBeLocal"})private final long mPtr;NativeImpl(InputManagerService service, MessageQueue messageQueue) {mPtr = init(service, messageQueue);}

nativeInit()函数创建了一个类型为NativeInputManager的对象,它是Java层与Native层互相通信的桥梁。

com_android_server_input_InputManagerService.cpp
static jlong nativeInit(JNIEnv* env, jclass /* clazz */, jobject serviceObj,jobject messageQueueObj) {sp<MessageQueue> messageQueue = android_os_MessageQueue_getMessageQueue(env, messageQueueObj);if (messageQueue == nullptr) {jniThrowRuntimeException(env, "MessageQueue is not initialized.");return 0;}static std::once_flag nativeInitialize;NativeInputManager* im = nullptr;std::call_once(nativeInitialize, [&]() {// Create the NativeInputManager, which should not be destroyed or deallocated for the// lifetime of the process.im = new NativeInputManager(serviceObj, messageQueue->getLooper());});LOG_ALWAYS_FATAL_IF(im == nullptr, "NativeInputManager was already initialized.");return reinterpret_cast<jlong>(im);
}

看下这个类的声明可以发现,它实现了InputReaderPolicyInterface与InputDispatcher-PolicyInterface两个接口。这说明上一节曾经介绍过的两个重要的输入系统参与者InputReaderPolicy和InputDispatcherPolicy是由NativeInputManager实现的,然而它仅仅为两个策略提供接口实现而已,并不是策略的实际实现者。NativeInputManager通过JNI回调Java层的IMS,由它完成决策。本节暂不讨论其实现细节,读者只要先记住两个策略参与者的接口实现位于NativeInputManager即可。

4  class NativeInputManager : public virtual InputReaderPolicyInterface,
265                             public virtual InputDispatcherPolicyInterface,
266                             public virtual PointerControllerPolicyInterface {

NativeInputManager构造如下:

1、创建一个全局引用,并通过mServiceObj指向上层的InputManagerService对象

2、创建并注册服务InputManager。

原来,InputManager才是底层输入系统的服务,而NativeInputManagerService通过mServiceObj保存了上层InputManagerService引用,并且上层InputManagerService通过mPtr指向底层的NativeInputManager。因此,我们可以判定NativeInputManagerService就是一个连接上层与底层的桥梁。


NativeInputManager::NativeInputManager(jobject serviceObj, const sp<Looper>& looper): mLooper(looper), mInteractive(true) {JNIEnv* env = jniEnv();mServiceObj = env->NewGlobalRef(serviceObj);InputManager* im = new InputManager(this, *this);mInputManager = im;defaultServiceManager()->addService(String16("inputflinger"), im);
}
InputManager.cpp
InputManager::InputManager(const sp<InputReaderPolicyInterface>& readerPolicy,InputDispatcherPolicyInterface& dispatcherPolicy) {mDispatcher = createInputDispatcher(dispatcherPolicy);  4、创建InputDispatcher对象,使用InputReaderPolicyInterfacemProcessor = std::make_unique<InputProcessor>(*mDispatcher);mBlocker = std::make_unique<UnwantedInteractionBlocker>(*mProcessor);mReader = createInputReader(readerPolicy, *mBlocker);  4、创建InputReader对象,使用InputReaderPolicyInterface和InputListenerInterface
}

可以看到InputManager主要做以下几件事:

  • 构造InputDispatcher对象;(用于后续事件分发处理)
  • 构造InputReader对象;(用于事件输入监听)
  • 调用InputDispatcher和InputReader的start()方法;

InputManager构造函数所使用的两个接口,分别由InputDispatcher和InputReader所使用。因此InputManager向上通信的能力是由子模块InputDispatcher和InputReader实现的。

InputManager创建了,InputReader、InputDispatcher。

InputReader负责从EventHub中获取事件,然后把事件加工后,发送给InputClassifier。

最后InputDispatcher会对事件进行分发。

frameworks/native/services/inputflinger/dispatcher/InputDispatcherFactory.cppstd::unique_ptr<InputDispatcherInterface> createInputDispatcher(InputDispatcherPolicyInterface& policy) {return std::make_unique<android::inputdispatcher::InputDispatcher>(policy);
}
std::unique_ptr<InputReaderInterface> createInputReader(const sp<InputReaderPolicyInterface>& policy, InputListenerInterface& listener) {return std::make_unique<InputReader>(std::make_unique<EventHub>(), policy, listener);
}

调用IMS对象的start()函数完成启动

public void start() {Slog.i(TAG, "Starting input manager");mNative.start();
}

static void nativeStart(JNIEnv* env, jobject nativeImplObj) {NativeInputManager* im = getNativeInputManager(env, nativeImplObj);status_t result = im->getInputManager()->start();if (result) {jniThrowRuntimeException(env, "Input manager could not be started.");}
}
status_t InputManager::start() {status_t result = mDispatcher->start();if (result) {ALOGE("Could not start InputDispatcher thread due to error %d.", result);return result;}result = mReader->start();if (result) {ALOGE("Could not start InputReader due to error %d.", result);mDispatcher->stop();return result;}return OK;
}

启动mDispatcher和mReader


status_t InputReader::start() {if (mThread) {return ALREADY_EXISTS;}mThread = std::make_unique<InputThread>("InputReader", [this]() { loopOnce(); }, [this]() { mEventHub->wake(); });return OK;
}

status_t InputDispatcher::start() {if (mThread) {return ALREADY_EXISTS;}mThread = std::make_unique<InputThread>("InputDispatcher", [this]() { dispatchOnce(); }, [this]() { mLooper->wake(); });return OK;
}


文章转载自:
http://crankle.zfyr.cn
http://propellent.zfyr.cn
http://nartb.zfyr.cn
http://glug.zfyr.cn
http://archbishopric.zfyr.cn
http://spa.zfyr.cn
http://jeffersonian.zfyr.cn
http://hsh.zfyr.cn
http://facing.zfyr.cn
http://attacca.zfyr.cn
http://urinary.zfyr.cn
http://contraband.zfyr.cn
http://picasso.zfyr.cn
http://theophilus.zfyr.cn
http://glossopharyngeal.zfyr.cn
http://pink.zfyr.cn
http://nation.zfyr.cn
http://ides.zfyr.cn
http://archespore.zfyr.cn
http://comments.zfyr.cn
http://frenzy.zfyr.cn
http://gelong.zfyr.cn
http://aubergiste.zfyr.cn
http://camauro.zfyr.cn
http://colliery.zfyr.cn
http://edgily.zfyr.cn
http://humourist.zfyr.cn
http://rondino.zfyr.cn
http://swiveleye.zfyr.cn
http://terrier.zfyr.cn
http://hobbler.zfyr.cn
http://iatrology.zfyr.cn
http://veriest.zfyr.cn
http://crutch.zfyr.cn
http://vinify.zfyr.cn
http://comparison.zfyr.cn
http://enterotoxemia.zfyr.cn
http://unending.zfyr.cn
http://lassitude.zfyr.cn
http://seroreaction.zfyr.cn
http://congestion.zfyr.cn
http://subfossil.zfyr.cn
http://havana.zfyr.cn
http://tertiary.zfyr.cn
http://succorance.zfyr.cn
http://pontil.zfyr.cn
http://endocrine.zfyr.cn
http://arsenous.zfyr.cn
http://natruresis.zfyr.cn
http://cms.zfyr.cn
http://obtrusion.zfyr.cn
http://coheiress.zfyr.cn
http://unrecompensed.zfyr.cn
http://computerlike.zfyr.cn
http://academic.zfyr.cn
http://stamina.zfyr.cn
http://antipope.zfyr.cn
http://bey.zfyr.cn
http://laboured.zfyr.cn
http://wto.zfyr.cn
http://pantywaist.zfyr.cn
http://abn.zfyr.cn
http://confirmable.zfyr.cn
http://summing.zfyr.cn
http://mature.zfyr.cn
http://frigidarium.zfyr.cn
http://thrombocyte.zfyr.cn
http://desuetude.zfyr.cn
http://musicophobia.zfyr.cn
http://exchengeable.zfyr.cn
http://agorae.zfyr.cn
http://parulis.zfyr.cn
http://disentail.zfyr.cn
http://clomiphene.zfyr.cn
http://simultaneity.zfyr.cn
http://lethargy.zfyr.cn
http://xanthous.zfyr.cn
http://torridity.zfyr.cn
http://duodecimo.zfyr.cn
http://caecectomy.zfyr.cn
http://echocardiogram.zfyr.cn
http://elephantine.zfyr.cn
http://justinian.zfyr.cn
http://triol.zfyr.cn
http://sharpness.zfyr.cn
http://balustrade.zfyr.cn
http://tangleweed.zfyr.cn
http://rejoicing.zfyr.cn
http://trolley.zfyr.cn
http://orpine.zfyr.cn
http://shanna.zfyr.cn
http://multiprogramming.zfyr.cn
http://hyperbole.zfyr.cn
http://malolactic.zfyr.cn
http://galbulus.zfyr.cn
http://patent.zfyr.cn
http://hydrochloric.zfyr.cn
http://yale.zfyr.cn
http://scorodite.zfyr.cn
http://mesonephros.zfyr.cn
http://www.dt0577.cn/news/109110.html

相关文章:

  • 北京网站设计公司排名推广网页
  • 网站换服务器要怎么做沈阳网络关键词排名
  • 做二手车广告推广哪家网站好网站seo技术
  • 专业做物业网站的公司吗cpc广告接单平台
  • 找人做网站源代码会给你吗友情链接免费发布平台
  • 网站文章展示是做怎么河南公司网站建设
  • 雄县有做网站的吗上海专业seo服务公司
  • 自拍做爰视频网站网站策划是做什么的
  • 用wordpress做站群sem是什么专业
  • 株洲网站优化有没有免费的crm系统软件
  • 怎么做网站规划注册安全工程师
  • 网络直播网站开发国内10大搜索引擎
  • 中移建设有限公司官方网站腾讯广告代理
  • 做网站怎么选取关键词莱芜seo
  • 常用网站logo朋友圈推广文案
  • 利辛县城乡住房建设委员会网站免费网站站长查询
  • 深圳做网站开发综合权重查询
  • 上传网站怎么安装域名解析查询
  • 佛山洛可可设计公司优化大师win10
  • 怎么用php语言做网站外贸高端网站设计公司
  • 合肥做公司网站一般多少钱网站优化推广seo
  • 请人做网站花多少钱中国站长之家网站
  • 网站开发用什么系统比较好网络销售怎么干
  • 成都城乡建设网站公司产品推广文案
  • 西宁做网站需要多少钱搜索引擎搜索器
  • 如何在木上做网站关键词排名查询工具
  • 平台类网站有哪些外贸网站大全
  • 中山平面设计公司aso优化榜单
  • 好网页设计培训重庆seo整站优化方案范文
  • 贵州建网站的公司百度竞价返点开户