Consolidate ShareManager into the unified init process.
This commit is contained in:
parent
bf0350776c
commit
6b1a97b626
1 changed files with 3 additions and 7 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue