blob: 50cc37d4f4b53d4b0de2caf946aef60b66caf5dd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
package se.leap.bitmaskclient;
import java.util.Observable;
/**
* Created by cyberta on 05.12.18.
*/
public class ProviderObservable extends Observable {
private static ProviderObservable instance;
private Provider currentProvider;
private Provider providerForDns;
public static ProviderObservable getInstance() {
if (instance == null) {
instance = new ProviderObservable();
}
return instance;
}
public synchronized void updateProvider(Provider provider) {
instance.currentProvider = provider;
instance.providerForDns = null;
instance.setChanged();
instance.notifyObservers();
}
public Provider getCurrentProvider() {
return instance.currentProvider;
}
public void setProviderForDns(Provider provider) {
this.providerForDns = provider;
}
public Provider getProviderForDns() {
return instance.providerForDns;
}
}
|