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

Commit 3b2b3230 authored by Andy Mast's avatar Andy Mast Committed by Abhisek Devkota
Browse files

Theme special volumeup+down volume panel

When you press vol up + vol down button it brings up a
different volume panel which was not getting themed because
it lacked the ui context.

Change-Id: I416b8920160c0ab263fd426a6e6491d1f877a905
parent ec84f112
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ import android.content.ServiceConnection;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.content.pm.ThemeUtils;
import android.content.res.CompatibilityInfo;
import android.content.res.Configuration;
import android.content.res.Resources;
@@ -243,6 +244,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
    private final Object mQuickBootLock = new Object();

    Context mContext;
    Context mUiContext;
    IWindowManager mWindowManager;
    WindowManagerFuncs mWindowManagerFuncs;
    PowerManager mPowerManager;
@@ -1028,7 +1030,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
            // Do the switch
            final AudioManager am = (AudioManager)mContext.getSystemService(Context.AUDIO_SERVICE);
            final int ringerMode = am.getRingerMode();
            final VolumePanel volumePanel = new VolumePanel(mContext,
            final VolumePanel volumePanel = new VolumePanel(mUiContext,
                                                              (AudioService) getAudioService());
            if (ringerMode == AudioManager.RINGER_MODE_NORMAL) {
                boolean vibrateSetting = Settings.System.getIntForUser(mContext.getContentResolver(),
@@ -1180,6 +1182,15 @@ public class PhoneWindowManager implements WindowManagerPolicy {
    public void init(Context context, IWindowManager windowManager,
            WindowManagerFuncs windowManagerFuncs) {
        mContext = context;
        mUiContext = ThemeUtils.createUiContext(context);
        ThemeUtils.registerThemeChangeReceiver(context, new BroadcastReceiver() {
            @Override
            public void onReceive(Context context, Intent intent) {
                mUiContext = ThemeUtils.createUiContext(mContext);
            }
        });


        mWindowManager = windowManager;
        mWindowManagerFuncs = windowManagerFuncs;
        mHeadless = "1".equals(SystemProperties.get("ro.config.headless", "0"));