目录

 

android 11 HOME键不能返回

Android 9处理

Android 11处理


 

android 11 HOME键不能返回


这里说的是能完整接收到按键问题,后面返回的一些逻辑处理导致的问题!

Android 9处理

settings put secure user_setup_complete 1 


    boolean isUserSetupComplete() {
        boolean isSetupComplete = Settings.Secure.getIntForUser(mContext.getContentResolver(),
                Settings.Secure.USER_SETUP_COMPLETE, 0, UserHandle.USER_CURRENT) != 0;
        if (mHasFeatureLeanback) {
            isSetupComplete &= isTvUserSetupComplete();
        }
        return isSetupComplete;
    }

 

 

Android 11处理

settings put secure user_setup_complete 1 

//Android 11新增处理(相对android 9) 
settings put secure tv_user_setup_complete 1


    @Override
    public boolean isUserSetupComplete() {
        boolean isSetupComplete = Settings.Secure.getIntForUser(mContext.getContentResolver(),
                Settings.Secure.USER_SETUP_COMPLETE, 0, UserHandle.USER_CURRENT) != 0;
        Log.d(TAG,"isSetupComplete 1 = " + isSetupComplete);
        if (mHasFeatureLeanback) {
            isSetupComplete &= isTvUserSetupComplete();
        }
        Log.d(TAG,"isSetupComplete 2 = " + isSetupComplete);
        return isSetupComplete;
    }

 

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐