Simply PushServiceSocket constructor.

This commit is contained in:
Moxie Marlinspike
2013-10-19 11:15:45 -07:00
parent 5b2caa0074
commit ca3c82f581
8 changed files with 52 additions and 30 deletions

View File

@@ -61,6 +61,10 @@ public class PushServiceSocket {
this.trustManagerFactory = initializeTrustManagerFactory(context);
}
public PushServiceSocket(Context context, PushCredentials credentials) {
this(context, credentials.getLocalNumber(context), credentials.getPassword(context));
}
public void createAccount(boolean voice) throws IOException {
String path = voice ? CREATE_ACCOUNT_VOICE_PATH : CREATE_ACCOUNT_SMS_PATH;
makeRequest(String.format(path, localNumber), "GET", null);
@@ -400,4 +404,8 @@ public class PushServiceSocket {
}
}
public interface PushCredentials {
public String getLocalNumber(Context context);
public String getPassword(Context context);
}
}