Android7.0 Messaging源码分析(2)

编程入门 行业动态 更新时间:2024-10-12 18:18:37

Android7.0 Messaging<a href=https://www.elefans.com/category/jswz/34/1770099.html style=源码分析(2)"/>

Android7.0 Messaging源码分析(2)

  Messaging 源码位于 packages/apps/Messaging 目录下,application类名是BugleApplication,

  在 onCreate 方法里做了两件事,
  1 FactoryImpl.register(getApplicationContext(), this);
  2 Thread.setDefaultUncaughtExceptionHandler(this);

  来看看FactoryImpl.register(getApplicationContext(), this);做了什么事情,

         public static Factory register(final Context applicationContext, final BugleApplication application) {// This only gets called once (from BugleApplication.onCreate), but its not called in tests.Assert.isTrue(!sRegistered);Assert.isNull(Factory.get());final FactoryImpl factory = new FactoryImpl();Factory.setInstance(factory);sRegistered = true;// At this point Factory is published. Services can now get initialized and depend on Factory.get().factory.mApplication = application;factory.mApplicationContext = applicationContext;factory.mMemoryCacheManager = new MemoryCacheManager(); // 创建缓缓管理器factory.mMediaCacheManager = new BugleMediaCacheManager(); // 创建媒体缓存管理器factory.mMediaResourceManager = new MediaResourceManager(); // 创建媒体资源管理器factory.mBugleGservices = new

更多推荐

Android7.0 Messaging源码分析(2)

本文发布于:2024-03-09 20:25:21,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1726034.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:源码   Messaging

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!