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

Commit 4c7e4629 authored by yinxu's avatar yinxu
Browse files

Remove the getConfiguration and updatePersistentConfiguration

In CatService.java, it simply reads get the Config and update it without
any changes, so those operations can be removed.

Bug: 138545688
Test: Telephony Unit Tests
Change-Id: Ib6edbca54c712bf8a1bd9997a2c85f1e74cea961
parent 4015c6f1
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -21,15 +21,12 @@ import static com.android.internal.telephony.cat.CatCmdMessage.SetupEventListCon
import static com.android.internal.telephony.cat.CatCmdMessage.SetupEventListConstants.USER_ACTIVITY_EVENT;

import android.app.ActivityManager;
import android.app.ActivityManagerNative;
import android.app.IActivityManager;
import android.app.backup.BackupManager;
import android.compat.annotation.UnsupportedAppUsage;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.content.res.Configuration;
import android.content.res.Resources.NotFoundException;
import android.os.AsyncResult;
import android.os.Handler;
@@ -1174,8 +1171,6 @@ public class CatService extends Handler implements AppInterface {
    }

    private void changeLanguage(String language) throws RemoteException {
        IActivityManager am = ActivityManagerNative.getDefault();
        Configuration config = am.getConfiguration();
        // get locale list, combined with language locale and default locale list.
        LocaleList defaultLocaleList = LocaleList.getDefault();
        Locale[] locales = new Locale[defaultLocaleList.size() + 1];
@@ -1184,7 +1179,6 @@ public class CatService extends Handler implements AppInterface {
            locales[i+1] = defaultLocaleList.get(i);
        }
        mContext.getSystemService(ActivityManager.class).setDeviceLocales(new LocaleList(locales));
        am.updatePersistentConfiguration(config);
        BackupManager.dataChanged("com.android.providers.settings");
    }
}