Consolidate ShareManager into the unified init process.

This commit is contained in:
Garfield Tan 2017-07-13 13:45:16 -07:00
parent bf0350776c
commit 6b1a97b626

View file

@ -65,6 +65,8 @@ public class SambaProviderApplication extends Application {
mCredentialCache = looper.getCredentialCache();
mSambaClient = looper.getClient();
mShareManager = new ShareManager(context, mCredentialCache);
registerNetworkCallback(context);
}
@ -104,13 +106,7 @@ public class SambaProviderApplication extends Application {
}
public static ShareManager getServerManager(Context context) {
final SambaProviderApplication application = getApplication(context);
synchronized (application) {
if (application.mShareManager == null) {
application.mShareManager = new ShareManager(context, application.mCredentialCache);
}
return application.mShareManager;
}
return getApplication(context).mShareManager;
}
public static SmbFacade getSambaClient(Context context) {