FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Deal with activity property ExcludeFromRecents, to avoid Mobile Legnends has two recent task problem by WindySha · Pull Request #366 · android-hacker/VirtualXposed · GitHub

Deal with activity property ExcludeFromRecents, to avoid Mobile Legnends has two recent task problem - #366

Merged
tiann merged 1 commit into
android-hacker:exposedfrom
WindySha:exposed
Sep 7, 2018
Merged

Deal with activity property ExcludeFromRecents, to avoid Mobile Legnends has two recent task problem#366
tiann merged 1 commit into
android-hacker:exposedfrom
WindySha:exposed

Conversation

WindySha commented Sep 6, 2018

Copy link
Copy Markdown

Deal with activity property excludeFromRecents.
The app Mobile Legnends has two tasks in the recent task list, when launching from VituralXposed.

tiann commented Sep 6, 2018

Copy link
Copy Markdown
Member

Good job.

顺便问下,这个可以通过 Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS 解决么?

tiann commented Sep 6, 2018

Copy link
Copy Markdown
Member

比如说,在 ActivityStack里这么做:

    private Intent startActivityProcess(int userId, ActivityRecord sourceRecord, Intent intent, ActivityInfo info) {
        intent = new Intent(intent);
        ProcessRecord targetApp = mService.startProcessIfNeedLocked(info.processName, userId, info.packageName);
        if (targetApp == null) {
            return null;
        }
        Intent targetIntent = new Intent();
        targetIntent.setClassName(VirtualCore.get().getHostPkg(), fetchStubActivity(targetApp.vpid, info));
        ComponentName component = intent.getComponent();
        if (component == null) {
            component = ComponentUtils.toComponentName(info);
        }
        targetIntent.setType(component.flattenToString());
        StubActivityRecord saveInstance = new StubActivityRecord(intent, info,
                sourceRecord != null ? sourceRecord.component : null, userId);
        saveInstance.saveToIntent(targetIntent);

        if (((info.flags & ActivityInfo.FLAG_EXCLUDE_FROM_RECENTS) != 0)) {
            intent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
        }
        return targetIntent;
    }

WindySha commented Sep 6, 2018

Copy link
Copy Markdown
Author

之前就尝试过intent设置flag这种方法,并不可行,初次跳转到Mobile Legends的时候,最近任务只有一个任务,回到桌面再看任务栏,一个任务都没有了。
因此,需要使system_server进程中的PM去读取manifest中配置的EXCLUDE_FROM_RECENTS标签才能解决此问题。这种方法确实不是很优雅,但暂时没有找到其他解决方式。
通过这个问题,应该容易得知,VA框架对于manifest中配置的组件属性支持不是很好,此处应该会有不少坑。

tiann merged commit 895d3a3 into android-hacker:exposed Sep 7, 2018
tiann added a commit that referenced this pull request Nov 15, 2018
Deal with activity property ExcludeFromRecents, to avoid Mobile Legnends has two recent task problem
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL