Update context on resume calls for BluetoothAdvertisingEnabler and BluetoothEnabler
The saved context could be invalid if not updated bug 12991455 Change-Id: I93abb8420d0fa53add1f0e843a5069d59743891c
This commit is contained in:
@@ -26,7 +26,7 @@ import com.android.settings.R;
|
||||
*/
|
||||
final class BluetoothAdvertisingEnabler {
|
||||
|
||||
private final Context mContext;
|
||||
private Context mContext;
|
||||
private final PreferenceScreen mBluetoothAdvertisingPreference;
|
||||
|
||||
public BluetoothAdvertisingEnabler(Context context, PreferenceScreen bluetoothBroadcast) {
|
||||
@@ -34,7 +34,10 @@ final class BluetoothAdvertisingEnabler {
|
||||
mBluetoothAdvertisingPreference = bluetoothBroadcast;
|
||||
}
|
||||
|
||||
public void resume() {
|
||||
public void resume(Context context) {
|
||||
if (mContext != context) {
|
||||
mContext = context;
|
||||
}
|
||||
boolean isBroadcastingEnable = LocalBluetoothPreferences.isAdvertisingEnabled(mContext);
|
||||
handleAdvertisingStateChange(isBroadcastingEnable);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user