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

Commit f350fa87 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Apply the correct theme to DockPreference"

parents de290a50 71ae12a1
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -76,9 +76,11 @@ public class ConnectedDeviceGroupController extends BasePreferenceController
            mPreferenceGroup = (PreferenceGroup) screen.findPreference(KEY);
            mPreferenceGroup.setVisible(false);

            mBluetoothDeviceUpdater.setPrefContext(screen.getContext());
            final Context context = screen.getContext();
            mBluetoothDeviceUpdater.setPrefContext(context);
            mBluetoothDeviceUpdater.forceUpdate();
            mConnectedUsbDeviceUpdater.initUsbPreference(screen.getContext());
            mConnectedUsbDeviceUpdater.initUsbPreference(context);
            mConnectedDockUpdater.setPreferenceContext(context);
            mConnectedDockUpdater.forceUpdate();
        }
    }
+4 −1
Original line number Diff line number Diff line
@@ -75,8 +75,11 @@ public class SavedDeviceGroupController extends BasePreferenceController
        if (isAvailable()) {
            mPreferenceGroup = (PreferenceGroup) screen.findPreference(KEY);
            mPreferenceGroup.setVisible(false);
            mBluetoothDeviceUpdater.setPrefContext(screen.getContext());

            final Context context = screen.getContext();
            mBluetoothDeviceUpdater.setPrefContext(context);
            mBluetoothDeviceUpdater.forceUpdate();
            mSavedDockUpdater.setPreferenceContext(context);
            mSavedDockUpdater.forceUpdate();
        }
    }
+7 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
 */
package com.android.settings.connecteddevice.dock;

import android.annotation.NonNull;
import android.content.Context;

/**
@@ -40,4 +41,10 @@ public interface DockUpdater {
     */
    default void forceUpdate() {
    }

    /**
     * Set the context to generate the {@link Preference}, so it could get the correct theme.
     */
    default void setPreferenceContext(@NonNull Context preferenceContext) {
    }
}