Rename DownloadController's newInstance() to getInstance()
Also, make both the instance getters synchronized.
This commit is contained in:
@@ -51,11 +51,11 @@ public class DownloadController implements DownloadControllerInt {
|
||||
|
||||
private final File mDownloadRoot;
|
||||
|
||||
public static DownloadController getInstance() {
|
||||
public static synchronized DownloadController getInstance() {
|
||||
return sDownloadController;
|
||||
}
|
||||
|
||||
public static synchronized DownloadController newInstance(Context context) {
|
||||
public static synchronized DownloadController getInstance(Context context) {
|
||||
if (sDownloadController == null) {
|
||||
sDownloadController = new DownloadController(context);
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ public class DownloadService extends Service {
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
|
||||
mDownloadController = DownloadController.newInstance(this);
|
||||
mDownloadController = DownloadController.getInstance(this);
|
||||
|
||||
mNotificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
|
||||
mNotificationBuilder = new NotificationCompat.Builder(this);
|
||||
|
||||
Reference in New Issue
Block a user