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

Unverified Commit 5518dd64 authored by electimon's avatar electimon Committed by Michael Bestas
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 e9bdd704
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -335,6 +335,8 @@ public final class HintManagerService extends SystemService {
            } catch (RemoteException e) {
                throw new IllegalStateException("Could not contact PowerHAL!", e);
            }
        } else {
            mSupportInfo = getDummySupportInfo();
        }
        mDefaultCpuHeadroomCalculationWindowMillis =
                new CpuHeadroomParamsInternal().calculationWindowMillis;
@@ -379,7 +381,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.usesSessions = isHintSessionSupported();
        // Global boosts & modes aren't currently relevant for HMS clients