Bug 1012462 - Part 6: Change Distribution.init() to return an instance (r=rnewman)

This commit is contained in:
Lucas Rocha 2014-07-15 20:54:27 +01:00
parent 7bb6ac291a
commit ac575fe3cf

View File

@ -181,7 +181,7 @@ public class Distribution {
}
}
private static void init(final Distribution distribution) {
private static Distribution init(final Distribution distribution) {
// Read/write preferences and files on the background thread.
ThreadUtils.postToBackgroundThread(new Runnable() {
@Override
@ -192,6 +192,8 @@ public class Distribution {
}
}
});
return distribution;
}
/**
@ -201,8 +203,8 @@ public class Distribution {
* @param packagePath where to look for the distribution directory.
*/
@RobocopTarget
public static void init(final Context context, final String packagePath, final String prefsPath) {
init(new Distribution(context, packagePath, prefsPath));
public static Distribution init(final Context context, final String packagePath, final String prefsPath) {
return init(new Distribution(context, packagePath, prefsPath));
}
/**
@ -210,8 +212,8 @@ public class Distribution {
* package path. Reuses the existing Distribution if one exists.
*/
@RobocopTarget
public static void init(final Context context) {
Distribution.init(Distribution.getInstance(context));
public static Distribution init(final Context context) {
return init(Distribution.getInstance(context));
}
/**