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

Commit cdbee3a7 authored by martinlong1978's avatar martinlong1978
Browse files

Fixed Bootloop related to profile volume control setting on boot.

Change-Id: I0fffc926ab1eba1667843d2fc64af4df63c59fd6
parent 77d0dba1
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -75,10 +75,16 @@ public class ProfileManagerService extends IProfileManager.Stub {
    // TODO: Exceptions not supported in aidl.
    @Override
    public void setActiveProfile(String profileName) throws RemoteException {
        setActiveProfile(profileName, true);
    }

    private void setActiveProfile(String profileName, boolean doinit) throws RemoteException {
        if(mProfiles.containsKey(profileName)){
            Log.d(TAG, "Set active profile to: " + profileName);
            mActiveProfile = getProfile(profileName);
            if(doinit){
                mActiveProfile.doSelect(mContext);
            }
        }else{
            Log.e(TAG, "Cannot set active profile to: " + profileName + " - does not exist.");
        }
@@ -188,7 +194,9 @@ public class ProfileManagerService extends IProfileManager.Stub {
            }
            event = xpp.next();
        }
        setActiveProfile(active);
        // Don't do initialisation on startup. The AudioManager doesn't exist yet
        // and besides, the volume settings will have survived the reboot.
        setActiveProfile(active, false);
    }

    private void initialiseStructure() throws RemoteException, XmlPullParserException, IOException {