private void initDelegate ( ) { boolean powerSaveMode = Utils . isPowerSaveModeEnabled ( mPowerManager ) ; if ( powerSaveMode ) { if ( mPBDelegate == null || ! ( mPBDelegate instanceof PowerSaveModeDelegate ) ) { if ( mPBDelegate != null ) mPBDelegate . stop ( ) ; mPBDelegate = new PowerSaveModeDelegate ( this ) ; } } else { if ( mPBDelegate == null || ( mPBDelegate instanceof PowerSaveModeDelegate ) ) { if ( mPBDelegate != null ) mPBDelegate . stop ( ) ; mPBDelegate = new DefaultDelegate ( this , mOptions ) ; } } }
Inits the delegate . Create one if the delegate is null or not the right mode