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

商城网站建设 亚马逊靠网络营销火起来的企业

商城网站建设 亚马逊,靠网络营销火起来的企业,怎么用公司网站做公司域名多个,珠海移动网站建设费用系列文章 Android S从桌面点击图标启动APP流程 (一)Android S从桌面点击图标启动APP流程 (二) Android S从桌面点击图标启动APP流程 (三) Android S从桌面点击图标启动APP流程 (四) Android S从桌面点击图标启动APP流程 (五) Android 12的源码链接: android 1…

系列文章

Android S从桌面点击图标启动APP流程 (一)
Android S从桌面点击图标启动APP流程 (二)

Android S从桌面点击图标启动APP流程 (三)

Android S从桌面点击图标启动APP流程 (四)

Android S从桌面点击图标启动APP流程 (五)

Android 12的源码链接:

android 12 aospicon-default.png?t=N7T8http://aospxref.com/android-12.0.0_r3/上文讲到了 Process.start, 这里接着往下讲解

ZygoteProcess#start

frameworks/base/core/java/android/os/ZygoteProcess.java

    public final Process.ProcessStartResult start(@NonNull final String processClass,final String niceName,int uid, int gid, @Nullable int[] gids,int runtimeFlags, int mountExternal,int targetSdkVersion,@Nullable String seInfo,@NonNull String abi,@Nullable String instructionSet,@Nullable String appDataDir,@Nullable String invokeWith,@Nullable String packageName,int zygotePolicyFlags,boolean isTopApp,@Nullable long[] disabledCompatChanges,@Nullable Map<String, Pair<String, Long>>pkgDataInfoMap,@Nullable Map<String, Pair<String, Long>>allowlistedDataInfoList,boolean bindMountAppsData,boolean bindMountAppStorageDirs,@Nullable String[] zygoteArgs) {// TODO (chriswailes): Is there a better place to check this value?if (fetchUsapPoolEnabledPropWithMinInterval()) {informZygotesOfUsapPoolStatus();}try {return startViaZygote(processClass, niceName, uid, gid, gids,runtimeFlags, mountExternal, targetSdkVersion, seInfo,abi, instructionSet, appDataDir, invokeWith, /*startChildZygote=*/ false,packageName, zygotePolicyFlags, isTopApp, disabledCompatChanges,pkgDataInfoMap, allowlistedDataInfoList, bindMountAppsData,bindMountAppStorageDirs, zygoteArgs);} catch (ZygoteStartFailedEx ex) {Log.e(LOG_TAG,"Starting VM process through Zygote failed");throw new RuntimeException("Starting VM process through Zygote failed", ex);}}

ZygoteProcess#startViaZygote

该过程主要工作是生成argsForZygote数组

frameworks/base/core/java/android/os/ZygoteProcess.java

    private Process.ProcessStartResult startViaZygote(@NonNull final String processClass,@Nullable final String niceName,final int uid, final int gid,@Nullable final int[] gids,int runtimeFlags, int mountExternal,int targetSdkVersion,@Nullable String seInfo,@NonNull String abi,@Nullable String instructionSet,@Nullable String appDataDir,@Nullable String invokeWith,boolean startChildZygote,@Nullable String packageName,int zygotePolicyFlags,boolean isTopApp,@Nullable long[] disabledCompatChanges,@Nullable Map<String, Pair<String, Long>>pkgDataInfoMap,@Nullable Map<String, Pair<String, Long>>allowlistedDataInfoList,boolean bindMountAppsData,boolean bindMountAppStorageDirs,@Nullable String[] extraArgs)throws ZygoteStartFailedEx {ArrayList<String> argsForZygote = new ArrayList<>();// --runtime-args, --setuid=, --setgid=,// and --setgroups= must go firstargsForZygote.add("--runtime-args");argsForZygote.add("--setuid=" + uid);argsForZygote.add("--setgid=" + gid);argsForZygote.add("--runtime-flags=" + runtimeFlags);if (mountExternal == Zygote.MOUNT_EXTERNAL_DEFAULT) {argsForZygote.add("--mount-external-default");} else if (mountExternal == Zygote.MOUNT_EXTERNAL_INSTALLER) {argsForZygote.add("--mount-external-installer");} else if (mountExternal == Zygote.MOUNT_EXTERNAL_PASS_THROUGH) {argsForZygote.add("--mount-external-pass-through");} else if (mountExternal == Zygote.MOUNT_EXTERNAL_ANDROID_WRITABLE) {argsForZygote.add("--mount-external-android-writable");}argsForZygote.add("--target-sdk-version=" + targetSdkVersion);// --setgroups is a comma-separated listif (gids != null && gids.length > 0) {final StringBuilder sb = new StringBuilder();sb.append("--setgroups=");final int sz = gids.length;for (int i = 0; i < sz; i++) {if (i != 0) {sb.append(',');}sb.append(gids[i]);}argsForZygote.add(sb.toString());}if (niceName != null) {argsForZygote.add("--nice-name=" + niceName);}if (seInfo != null) {argsForZygote.add("--seinfo=" + seInfo);}if (instructionSet != null) {argsForZygote.add("--instruction-set=" + instructionSet);}if (appDataDir != null) {argsForZygote.add("--app-data-dir=" + appDataDir);}if (invokeWith != null) {argsForZygote.add("--invoke-with");argsForZygote.add(invokeWith);}if (startChildZygote) {argsForZygote.add("--start-child-zygote");}if (packageName != null) {argsForZygote.add("--package-name=" + packageName);}if (isTopApp) {argsForZygote.add(Zygote.START_AS_TOP_APP_ARG);}
......argsForZygote.add(processClass);if (extraArgs != null) {Collections.addAll(argsForZygote, extraArgs);}synchronized(mLock) {// The USAP pool can not be used if the application will not use the systems graphics// driver.  If that driver is requested use the Zygote application start path.
根据当前的abi来选择与zygote还是zygote64来进行通信。return zygoteSendArgsAndGetResult(openZygoteSocketIfNeeded(abi),zygotePolicyFlags,argsForZygote);}}

ZygoteProcess#zygoteSendArgsAndGetResult

这个方法的主要功能是通过socket通道向Zygote进程发送一个参数列表,然后进入阻塞等待状态,直到远端的socket服务端发送回来新创建的进程pid才返回。

frameworks/base/core/java/android/os/ZygoteProcess.java

    private Process.ProcessStartResult zygoteSendArgsAndGetResult(ZygoteState zygoteState, int zygotePolicyFlags, @NonNull ArrayList<String> args)throws ZygoteStartFailedEx {// Throw early if any of the arguments are malformed. This means we can// avoid writing a partial response to the zygote.for (String arg : args) {// Making two indexOf calls here is faster than running a manually fused loop due// to the fact that indexOf is an optimized intrinsic.if (arg.indexOf('\n') >= 0) {throw new ZygoteStartFailedEx("Embedded newlines not allowed");} else if (arg.indexOf('\r') >= 0) {throw new ZygoteStartFailedEx("Embedded carriage returns not allowed");}}/** See com.android.internal.os.ZygoteArguments.parseArgs()* Presently the wire format to the zygote process is:* a) a count of arguments (argc, in essence)* b) a number of newline-separated argument strings equal to count** After the zygote process reads these it will write the pid of* the child or -1 on failure, followed by boolean to* indicate whether a wrapper process was used.*/String msgStr = args.size() + "\n" + String.join("\n", args) + "\n";if (shouldAttemptUsapLaunch(zygotePolicyFlags, args)) {try {return attemptUsapSendArgsAndGetResult(zygoteState, msgStr);} catch (IOException ex) {// If there was an IOException using the USAP pool we will log the error and// attempt to start the process through the Zygote.Log.e(LOG_TAG, "IO Exception while communicating with USAP pool - "+ ex.getMessage());}}return attemptZygoteSendArgsAndGetResult(zygoteState, msgStr);}

ZygoteProcess#attemptZygoteSendArgsAndGetResult

frameworks/base/core/java/android/os/ZygoteProcess.java

    private Process.ProcessStartResult attemptZygoteSendArgsAndGetResult(ZygoteState zygoteState, String msgStr) throws ZygoteStartFailedEx {try {final BufferedWriter zygoteWriter = zygoteState.mZygoteOutputWriter;final DataInputStream zygoteInputStream = zygoteState.mZygoteInputStream;zygoteWriter.write(msgStr);zygoteWriter.flush();// Always read the entire result from the input stream to avoid leaving// bytes in the stream for future process starts to accidentally stumble// upon.Process.ProcessStartResult result = new Process.ProcessStartResult();
等待socket服务端-zygote返回新创建的进程pid;result.pid = zygoteInputStream.readInt();result.usingWrapper = zygoteInputStream.readBoolean();if (result.pid < 0) {throw new ZygoteStartFailedEx("fork() failed");}return result;} catch (IOException ex) {zygoteState.close();Log.e(LOG_TAG, "IO Exception while communicating with Zygote - "+ ex.toString());throw new ZygoteStartFailedEx(ex);}}

system_server进程通过调用attemptZygoteSendArgsAndGetResult()方法通过socket方式向Zygote进程发送消息,这样会唤醒Zygote进程,来响应socket客户端的请求(即system_server端),接下来的操作便是在Zygote来创建进程

ZygoteInit#main

然后会走进zygote进程创建进程,由于步骤太多,此处省略,直接到ActivityThread.main这里开始讲解。后文接着讲ActivityThread#main


文章转载自:
http://oversexed.qpqb.cn
http://niersteiner.qpqb.cn
http://gentisin.qpqb.cn
http://lethargy.qpqb.cn
http://dendrophilous.qpqb.cn
http://outwash.qpqb.cn
http://temerity.qpqb.cn
http://kwangju.qpqb.cn
http://stepwise.qpqb.cn
http://premillennial.qpqb.cn
http://rhizocaline.qpqb.cn
http://radiogenetics.qpqb.cn
http://variability.qpqb.cn
http://cambridge.qpqb.cn
http://ambition.qpqb.cn
http://bag.qpqb.cn
http://nance.qpqb.cn
http://inkpot.qpqb.cn
http://cervid.qpqb.cn
http://miscounsel.qpqb.cn
http://theology.qpqb.cn
http://meteoric.qpqb.cn
http://burnt.qpqb.cn
http://middlesbrough.qpqb.cn
http://hindooize.qpqb.cn
http://yamal.qpqb.cn
http://mojave.qpqb.cn
http://poesy.qpqb.cn
http://asme.qpqb.cn
http://echinulate.qpqb.cn
http://padouk.qpqb.cn
http://zebrawood.qpqb.cn
http://neoformation.qpqb.cn
http://turkmenian.qpqb.cn
http://photocomposer.qpqb.cn
http://limen.qpqb.cn
http://luciferase.qpqb.cn
http://jazzophile.qpqb.cn
http://impartial.qpqb.cn
http://hydrotaxis.qpqb.cn
http://silas.qpqb.cn
http://argumentive.qpqb.cn
http://tartly.qpqb.cn
http://charka.qpqb.cn
http://pelorize.qpqb.cn
http://capriote.qpqb.cn
http://culmination.qpqb.cn
http://foetor.qpqb.cn
http://hydroplane.qpqb.cn
http://inqilab.qpqb.cn
http://schefflera.qpqb.cn
http://galvanomagnetic.qpqb.cn
http://gapa.qpqb.cn
http://psychometric.qpqb.cn
http://assimilate.qpqb.cn
http://crummy.qpqb.cn
http://overhit.qpqb.cn
http://contrariwise.qpqb.cn
http://yeshivah.qpqb.cn
http://kisangani.qpqb.cn
http://rubensesque.qpqb.cn
http://tormentil.qpqb.cn
http://codger.qpqb.cn
http://chemosterilization.qpqb.cn
http://gunport.qpqb.cn
http://tried.qpqb.cn
http://defogger.qpqb.cn
http://jointed.qpqb.cn
http://rhodopsin.qpqb.cn
http://shirtfront.qpqb.cn
http://carse.qpqb.cn
http://yicker.qpqb.cn
http://nonfissionable.qpqb.cn
http://inventory.qpqb.cn
http://gran.qpqb.cn
http://stroud.qpqb.cn
http://promptitude.qpqb.cn
http://inconsonant.qpqb.cn
http://bola.qpqb.cn
http://unequivocable.qpqb.cn
http://kampuchea.qpqb.cn
http://inurbanity.qpqb.cn
http://imbecilic.qpqb.cn
http://chipboard.qpqb.cn
http://maxim.qpqb.cn
http://sameness.qpqb.cn
http://amphitheater.qpqb.cn
http://obviously.qpqb.cn
http://talmi.qpqb.cn
http://disrespect.qpqb.cn
http://vermian.qpqb.cn
http://myriameter.qpqb.cn
http://science.qpqb.cn
http://medusoid.qpqb.cn
http://santalwood.qpqb.cn
http://proctodaeum.qpqb.cn
http://adumbration.qpqb.cn
http://ruffian.qpqb.cn
http://stationmaster.qpqb.cn
http://taibei.qpqb.cn
http://www.dt0577.cn/news/125115.html

相关文章:

  • 每天做任务得钱的网站软文新闻发布平台
  • 海外如何淘宝网站建设猪八戒网接单平台
  • 怎么搭建php网站优化大师官方正版下载
  • 有哪些建筑设计网站网站seo站长工具
  • seo网站设计工具武汉网络推广广告公司
  • 如何利用网站模板seo推广技术培训
  • 购物网站设计图网站推广的6个方法是什么
  • 网站建设套餐报价百度指数分是什么
  • 网站建设的技巧有哪些搜索引擎优化百度
  • 外贸网站制作设计seo查询在线
  • 徐州网站建设多少钱市场营销策划案的范文
  • wordpress 安全插件安徽新站优化
  • 济南网络销售公司seo推广系统排名榜
  • 建站本外贸网站推广方式
  • 精品wordpress 模板优化网站的方法有哪些
  • 工信局网站备案查询品牌设计公司排名前十强
  • 网站开发交流怎么做网上销售
  • dede被挂赌博网站木马百度上怎么发布作品
  • 网站做下载功能推广普通话的文字内容
  • 网站开发的流程是什么网络推广平台
  • 网络营销网站建设流程学生个人网页设计模板
  • 网站建设专业术语线上推广是什么工作
  • 郑州企业网站建设sem是什么意思
  • 怎么找网站建设公司百度广告买下的订单在哪里找
  • 东莞网站推广怎么知道网站有没有被收录
  • 深圳龙华网站建设有效的网站推广方式
  • 网站如何做触屏滑动百度移动端模拟点击排名
  • 263邮箱登录登录入口成都正规搜索引擎优化
  • 看网站不受限制的浏览器有哪些2024年阳性最新症状
  • 使用wordpress做网站app营销策略有哪些