Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b375e14c authored by electimon's avatar electimon
Browse files

HintManagerService: Generate dummy mSupportInfo for non power AIDL devices



* Before it would generate dummy info when the IPower AIDL version
  was too old. Now we will generate it when IPower is just completely
  unavailable as well, avoiding a crash from accessing an
  uninitialized mSupportInfo.

test: sailfish boot :D
Change-Id: Ibf43d0bfea9fd6cdeae35248e4dde58c01d3ef3b
Signed-off-by: default avatarelectimon <electimon@gmail.com>
parent 7cf77b2d
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -297,6 +297,8 @@ public final class HintManagerService extends SystemService {
        mUsesFmq = false;
        if (mPowerHal != null) {
            mSupportInfo = getSupportInfo();
        } else {
            mSupportInfo = getDummySupportInfo();
        }
        mDefaultCpuHeadroomCalculationWindowMillis =
                new CpuHeadroomParamsInternal().calculationWindowMillis;
@@ -323,7 +325,10 @@ public final class HintManagerService extends SystemService {
        } catch (RemoteException e) {
            throw new IllegalStateException("Could not contact PowerHAL!", e);
        }
        return getDummySupportInfo();
    }

    private SupportInfo getDummySupportInfo() {
        SupportInfo supportInfo = new SupportInfo();
        supportInfo.headroom = new SupportInfo.HeadroomSupportInfo();
        supportInfo.headroom.isCpuSupported = false;