am 3bc5b23f: Merge "Fix layoutlib [DO NOT MERGE]" into jb-mr2-dev
* commit '3bc5b23f8dbb6ecc4eeac4334f94682056d0cb3b': Fix layoutlib [DO NOT MERGE]
This commit is contained in:
@@ -248,11 +248,16 @@ public abstract class RenderAction<T extends RenderParams> extends FrameworkReso
|
|||||||
* The counterpart is {@link #setUp()}.
|
* The counterpart is {@link #setUp()}.
|
||||||
*/
|
*/
|
||||||
private void tearDown() {
|
private void tearDown() {
|
||||||
|
// The context may be null, if there was an error during init().
|
||||||
|
if (mContext != null) {
|
||||||
// Make sure to remove static references, otherwise we could not unload the lib
|
// Make sure to remove static references, otherwise we could not unload the lib
|
||||||
mContext.disposeResources();
|
mContext.disposeResources();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sCurrentContext != null) {
|
||||||
// quit HandlerThread created during this session.
|
// quit HandlerThread created during this session.
|
||||||
HandlerThread_Delegate.cleanUp(sCurrentContext);
|
HandlerThread_Delegate.cleanUp(sCurrentContext);
|
||||||
|
}
|
||||||
|
|
||||||
// clear the stored ViewConfiguration since the map is per density and not per context.
|
// clear the stored ViewConfiguration since the map is per density and not per context.
|
||||||
ViewConfiguration_Accessor.clearConfigurations();
|
ViewConfiguration_Accessor.clearConfigurations();
|
||||||
@@ -263,10 +268,14 @@ public abstract class RenderAction<T extends RenderParams> extends FrameworkReso
|
|||||||
sCurrentContext = null;
|
sCurrentContext = null;
|
||||||
|
|
||||||
Bridge.setLog(null);
|
Bridge.setLog(null);
|
||||||
|
if (mContext != null) {
|
||||||
mContext.getRenderResources().setFrameworkResourceIdProvider(null);
|
mContext.getRenderResources().setFrameworkResourceIdProvider(null);
|
||||||
mContext.getRenderResources().setLogger(null);
|
mContext.getRenderResources().setLogger(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mContext = null;
|
||||||
|
}
|
||||||
|
|
||||||
public static BridgeContext getCurrentContext() {
|
public static BridgeContext getCurrentContext() {
|
||||||
return sCurrentContext;
|
return sCurrentContext;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,8 @@
|
|||||||
package libcore.icu;
|
package libcore.icu;
|
||||||
|
|
||||||
import com.android.tools.layoutlib.annotations.LayoutlibDelegate;
|
import com.android.tools.layoutlib.annotations.LayoutlibDelegate;
|
||||||
|
import com.ibm.icu.text.DateTimePatternGenerator;
|
||||||
|
import com.ibm.icu.util.ULocale;
|
||||||
|
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
@@ -45,7 +47,8 @@ public class ICU_Delegate {
|
|||||||
|
|
||||||
@LayoutlibDelegate
|
@LayoutlibDelegate
|
||||||
/*package*/ static String getBestDateTimePattern(String skeleton, String localeName) {
|
/*package*/ static String getBestDateTimePattern(String skeleton, String localeName) {
|
||||||
return ""; // TODO: check what the right value should be.
|
return DateTimePatternGenerator.getInstance(new ULocale(localeName))
|
||||||
|
.getBestPattern(skeleton);
|
||||||
}
|
}
|
||||||
|
|
||||||
@LayoutlibDelegate
|
@LayoutlibDelegate
|
||||||
|
|||||||
Reference in New Issue
Block a user