Android 5.0原生bug及修複方法

來源:互聯網
上載者:User

標籤:

Android 5.0已經來了,這個版本改動非常大,也意味著會有更多的bug隱藏在其中,我會在這篇文章中一直更新自己遇到的原生bug及修複方法。

1、bug1

現象:5.0中ActivityManagerService.keyguardWaitingForActivityDrawn ()介面替換了4.4中ActivityManagerService.dismissKeyguardOnNextActivity()介面,但是帶來了一個顯示bug,現象是keyguard隱藏後activity視窗還沒顯示出來,先看到的是launcher介面,接著才會顯示目標activity視窗。

原因分析:5.0上觸發調用ActivityStackSupervisor.notifyActivityDrawnForKeyguard()時機提前置致。

解決方案:注釋掉ActivityStack.completeResumeLocked()函數中對notifyActivityDrawnForKeyguard()函數的調用。

    private void completeResumeLocked(ActivityRecord next) {        next.idle = false;        next.results = null;        next.newIntents = null;        if (next.isHomeActivity() && next.isNotResolverActivity()) {            ProcessRecord app = next.task.mActivities.get(0).app;            if (app != null && app != mService.mHomeProcess) {                mService.mHomeProcess = app;            }        }        if (next.nowVisible) {            // We won't get a call to reportActivityVisibleLocked() so dismiss lockscreen now.            //mStackSupervisor.notifyActivityDrawnForKeyguard();      //注釋掉        }

2、bug2

現象:一個父視窗擁有兩個子視窗,且子視窗的type類型一致,兩個子視窗有前後添加順序,當兩個子視窗同時顯示時然後按下home鍵進入後台,再從案頭啟動這個應用,會發現兩個子視窗相對上下位置發生對調。

原因分析:有兩個原因,一是子視窗type類型不該一致,二是WindowManagerService針對兩個子視窗type類型一致時邏輯不健全。

解決辦法:



Android 5.0原生bug及修複方法

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.