SensitivePhoneNumbers: Convert to singleton class
* Now that there are more users than just call log, it is better to parse the XML-file just once * Keep an instance around for the various users of this class Change-Id: Iff1510dc40d68a211a6a1c5f19e4ca9ac64c3fcd
This commit is contained in:
@@ -50,12 +50,21 @@ public class SensitivePhoneNumbers {
|
||||
public static final String SENSIBLE_PHONENUMBERS_FILE_PATH = "etc/sensitive_pn.xml";
|
||||
private static final String ns = null;
|
||||
|
||||
private static SensitivePhoneNumbers sInstance = null;
|
||||
|
||||
private HashMap<String, ArrayList<String>> mSensitiveNumbersMap = new HashMap<>();
|
||||
|
||||
public SensitivePhoneNumbers() {
|
||||
private SensitivePhoneNumbers() {
|
||||
loadSensiblePhoneNumbers();
|
||||
}
|
||||
|
||||
public static SensitivePhoneNumbers getInstance() {
|
||||
if (sInstance == null) {
|
||||
sInstance = new SensitivePhoneNumbers();
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
private void loadSensiblePhoneNumbers() {
|
||||
FileReader sensiblePNReader;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user