Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

进程意外死亡重启后,StubActivity坑位问题 #520

Closed
1 task done
xifan-xf opened this issue Aug 22, 2017 · 0 comments
Closed
1 task done

进程意外死亡重启后,StubActivity坑位问题 #520

xifan-xf opened this issue Aug 22, 2017 · 0 comments

Comments

@xifan-xf
Copy link

  • 我已阅读并理解 贡献指南,严格遵循其约定。

错误报告

你做了什么?

保证此时Activity Stack内容为A20->A->A(即singleTask->standard->standard),在栈顶A页面Activity中人为制造一个ANR导致进程死亡重启,此时Activity Stack变成A20->A。
然后退回到A20页面继续系统一个singleTask的Activity,此时调试发现在分配坑位时继续把A20分配给了需要启动的Activity导致无法正确启动该Activity。

由于重启Activity必然不会执行Instrumentation.execStartActivity从而不会执行wrapIntent方法中的dequeueStubActivity方法(记录和分配坑位),而记录坑位信息的变量mStubQueue被清空没有记录重启的Activity所占有的坑位。

你期望的结果是什么?

ANR引起的重启后,能够正确的找对坑位启动Activity,如上面应该分配A21给新的singleTaskActivity。

实际结果是什么?

坑位数组被置空,重启的Activity持有坑位但是没有重新赋值到数组中,导致后续启动Activity坑位分配错误。

Small环境

Compile-time

  gradle-small plugin : 1.2.0-alpha5 (project)
            small aar : 1.2.0-alpha5 (project)
          gradle core : 3.3
       android plugin : 2.3.0
                   OS : Mac OS X 10.12 (x86_64)

Runtime

  Device : redmi3
     SDK : Android 7.1.2
     ABI : arm64-v8a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant