Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b704dc6c authored by Nergi Rahardi's avatar Nergi Rahardi
Browse files

Remove additional ApplicationInfo creation to fetch localeConfigRes

Calling copy constructor for ApplicationInfo seems to be redundant since
we could fetch resId directly.

Also moving it out of try catch

Bug: -
Test: m and presubmit
Change-Id: I011c706f36553afc84cd168fc8a5e3da1b848585
parent 5c5d9eb1
Loading
Loading
Loading
Loading
+6 −8
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@ import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.content.res.XmlResourceParser;
@@ -133,15 +132,14 @@ public class LocaleConfig implements Parcelable {
                return;
            }
        }
        int resId = 0;
        Resources res = context.getResources();
        try {
        //Get the resource id
            resId = new ApplicationInfo(context.getApplicationInfo()).getLocaleConfigRes();
        int resId = context.getApplicationInfo().getLocaleConfigRes();
        if (resId == 0) {
            mStatus = STATUS_NOT_SPECIFIED;
            return;
        }
        try {
            //Get the parser to read XML data
            XmlResourceParser parser = res.getXml(resId);
            parseLocaleConfig(parser, res);