• Launcher app prediction


    15、launcher应用列表界面最上面一行应用推荐

    现象:
    Android S上,更新同年四月份gms包后,launcher应用列表上方多出一行图标。
    {相册、时钟、比机、Gmail、YouTube、设置}
    通过studio自带的Layout Inspector查看,这一部分界面属于all_apps_header。也就是应用列表的头信息布局中。
    相关代码:
    launcher view层:
    多出的一行应用:Launcher\quickstep\src\com\android\launcher3\appprediction\PredictionRowView.java这里面初始化最上面一行图标,可以设置图标文字颜色。
    分割线:Launcher\quickstep\src\com\android\launcher3\appprediction\AppsDividerView.java这里面设置分割线的颜色
    多嘴一句,应用列表图标适配器:Launcher\src\com\android\launcher3\allapps\AllAppsGridAdapter.java 这里面标准的adapter,包含多类
    型,根据不同类型显示不同的内容。onCreateViewHolder、onBindViewHolder初始化图标view、设置应用列表图标文字颜色等等。
    launcher model层:
    Launcher\quickstep\src\com\android\launcher3\model\QuickstepModelDelegate.java注册registerPredictor监听,有更新回调时调用PredictionUpdateTask更新数据
    Launcher\quickstep\src\com\android\launcher3\model\PredictionUpdateTask.java更新数据、更新界面信息。
    framework层:—没用太深入的研究,简单看看
    AppPredictionManager、AppPredictionManagerService.java 和其它功能类似,分为manager和service2部分,通过aidl通讯。service负责数据更新和回调。
    SystemServer.java中判断是否配置相关config,来启动对应的service。
    config相关:

    <!-- The package name for the system's app prediction service.
             This service must be trusted, as it can be activated without explicit consent of the user.
             Example: "com.android.intelligence/.AppPredictionService"
    -->
    <string name="config_defaultAppPredictionService" translatable="false"></string>
    
    • 1
    • 2
    • 3
    • 4
    • 5

    gms包:
    新增应用:AndroidSystemIntelligence_Features.apk 包名:com.google.android.as
    新增覆盖:GmsConfigOverlayASI,包名:com.google.android.overlay.gmsconfig.asi,rro技术覆盖framework下面的config文件配置。

    string name="config_defaultAppPredictionService" translatable="false">com.google.android.as/com.google.android.apps.miphone.aiai.app.AiAiPredictionService</string>
    
    • 1

    ========================================================================================================================================
    接上篇15,重新写了一篇
    https://blog.csdn.net/a396604593/article/details/123487805
    本文主要补充说明一下prediction。
    prediction的类型:
    目前有主菜单应用、hotseat应用、widget三种
    Launcher端相关的类:

    Launcher\quickstep\src\com\android\launcher3\uioverrides\PredictedAppIcon.java
    Launcher\quickstep\src\com\android\launcher3\uioverrides\PredictedAppIconInflater.java
    Launcher\quickstep\src\com\android\launcher3\appprediction\PredictionRowView.java
    Launcher\quickstep\src\com\android\launcher3\model\PredictionUpdateTask.java
    Launcher\quickstep\src\com\android\launcher3\hybridhotseat\HotseatPredictionController.java
    Launcher\quickstep\src\com\android\launcher3\hybridhotseat\HotseatPredictionModel.java
    Launcher\quickstep\src\com\android\launcher3\model\WidgetsPredictionUpdateTask.java
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7

    未完待续

  • 相关阅读:
    llama的神经网络结构;llama的神经网络结构中没有MLP吗;nanogpt的神经网络结构;残差是什么;残差连接:主要梯度消失
    关于nginx整合fastdfs时http请求无法访问,nginx正常启动类但是访问不能请求的解决方法
    八大排序代码——总结
    计算机基础知识35
    机器学习实战-系列教程7:SVM分类实战2线性SVM(鸢尾花数据集/软间隔/线性SVM/非线性SVM/scikit-learn框架)项目实战、代码解读
    开始学习Go编程
    Python网络爬虫简介与环境配置
    docker启动rabbitmq无法访问15672端口
    全球产业链:脑机接口产业链
    VisualGLM部署&微调&docker环境
  • 原文地址:https://blog.csdn.net/a396604593/article/details/126060850