[RK3288][Android7.1]无电池概率性无法重启

[RK3288][Android7.1]无电池概率性无法重启

Platform: Rockchip
OS: Android 7.1.2
Kernel: 4.4

解决方案:在重启流程中去掉电池管理服务

frameworks\base\services\core\java\com\android\server\am\ActivityManagerService.java

public boolean shutdown(int timeout) {
        if (checkCallingPermission(android.Manifest.permission.SHUTDOWN)
                != PackageManager.PERMISSION_GRANTED) {
            throw new SecurityException("Requires permission "
                    + android.Manifest.permission.SHUTDOWN);
        }

        boolean timedout = false;

        synchronized(this) {
            mShuttingDown = true;
            updateEventDispatchingLocked();
            timedout = mStackSupervisor.shutdownLocked(timeout);
        }

        mAppOpsService.shutdown();
        if (mUsageStatsService != null) {
            mUsageStatsService.prepareShutdown();
        }
        //mBatteryStatsService.shutdown();
        synchronized (this) {
            mProcessStats.shutdownLocked();
            notifyTaskPersisterLocked(null, true);
        }

        return timedout;
    }

你可能感兴趣的:(Rockchip)