美文网首页
Android进程管理

Android进程管理

作者: dexteryu | 来源:发表于2017-07-31 15:33 被阅读0次
Process ADJ
// ProcessList
    // This is a process only hosting activities that are not visible,
    // so it can be killed without any disruption.
    static final int CACHED_APP_MAX_ADJ = 15;
    static final int CACHED_APP_MIN_ADJ = 9;

    // The B list of SERVICE_ADJ -- these are the old and decrepit
    // services that aren't as shiny and interesting as the ones in the A list.
    static final int SERVICE_B_ADJ = 8;

    // This is the process of the previous application that the user was in.
    // This process is kept above other things, because it is very common to
    // switch back to the previous app.  This is important both for recent
    // task switch (toggling between the two top recent apps) as well as normal
    // UI flow such as clicking on a URI in the e-mail app to view in the browser,
    // and then pressing back to return to e-mail.
    static final int PREVIOUS_APP_ADJ = 7;

    // This is a process holding the home application -- we want to try
    // avoiding killing it, even if it would normally be in the background,
    // because the user interacts with it so much.
    static final int HOME_APP_ADJ = 6;

    // This is a process holding an application service -- killing it will not
    // have much of an impact as far as the user is concerned.
    static final int SERVICE_ADJ = 5;

    // This is a process with a heavy-weight application.  It is in the
    // background, but we want to try to avoid killing it.  Value set in
    // system/rootdir/init.rc on startup.
    static final int HEAVY_WEIGHT_APP_ADJ = 4;

    // This is a process currently hosting a backup operation.  Killing it
    // is not entirely fatal but is generally a bad idea.
    static final int BACKUP_APP_ADJ = 3;

    // This is a process only hosting components that are perceptible to the
    // user, and we really want to avoid killing them, but they are not
    // immediately visible. An example is background music playback.
    static final int PERCEPTIBLE_APP_ADJ = 2;

    // This is a process only hosting activities that are visible to the
    // user, so we'd prefer they don't disappear.
    static final int VISIBLE_APP_ADJ = 1;

    // This is the process running the current foreground app.  We'd really
    // rather not kill it!
    static final int FOREGROUND_APP_ADJ = 0;
    // This is a process that the system or a persistent process has bound to,
    // and indicated it is important.
    static final int PERSISTENT_SERVICE_ADJ = -11;

    // This is a system persistent process, such as telephony.  Definitely
    // don't want to kill it, but doing so is not completely fatal.
    static final int PERSISTENT_PROC_ADJ = -12;

    // The system process runs at the default adjustment.
    static final int SYSTEM_ADJ = -16;

    // Special code for native processes that are not being managed by the system (so
    // don't have an oom adj assigned by the system).
    static final int NATIVE_ADJ = -17;
进程生命周期
相关资料

相关文章

  • android进程管理篇总结

    这个系列针对Android用户空间进程管理做个总结,未完待续... 系列文章:Android进程管理篇(一)-应用...

  • 服务(Service)

    概述 进程 :进程是一个应用程序运行的载体。在Android中,进程的底层是Linux管理的。Android中应用...

  • Android-进程管理机制

    一、Android进程管理的特殊设计 Linux系统对进程的管理方式是一旦进程活动停止,系统就会结束该进程。尽管A...

  • Android 内存优化

    Android 内存管理机制 内存管理 进程(由Application FrameWork和Linux内核管理) ...

  • Android进程间通信(四)——系统服务注册到servicem

    Android进程间通信(三)——系统服务管理进程servicemanager启动源码分析[https://www...

  • Android进程管理

    Process ADJ 进程生命周期 相关资料 进程和线程 AMS进程管理

  • Android进程管理

    进程的优先级 优先级的分类 优先级的转换 查看进程的系统资源占用情况 Profiler low memory ki...

  • Android进程管理总结

    目录 概述 Android系统的进程管理理念是希望应用进程能够尽量长时间的存活,提升用户体验。Android的应用...

  • Android的进程管理机制

    Linux系统对进程的管理方式是一旦进程活动停止,系统就会结束该进程。Android系统虽基于Linux,但在进程...

  • 解读Android进程优先级ADJ算法

    一、概述 1.1 进程 Android框架对进程创建与管理进行了封装,对于APP开发者只需知道Android四大组...

网友评论

      本文标题:Android进程管理

      本文链接:https://www.haomeiwen.com/subject/jefhhxtx.html