From 97fccaea855d4bb41495eb2707905a02744dca2c Mon Sep 17 00:00:00 2001 From: Yoshiaki Naka Date: Fri, 24 Jan 2020 15:27:48 +0900 Subject: Consider that inactive Modem can be activated in run time The number of the active Modems can be changed in run time. In order to avoid ArrayIndexOutOfBoundsException thrown, the length of the array for caching the last selected configuration entries must be determined based on the number of the Modems supported on the device. Bug: 148240558 Test: Manual Change-Id: I810db3194a8762f0157395624ccde21ff3e71e76 --- src/com/android/stk/StkMenuConfig.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/com/android/stk/StkMenuConfig.java b/src/com/android/stk/StkMenuConfig.java index 5414a6a..b65b3c8 100644 --- a/src/com/android/stk/StkMenuConfig.java +++ b/src/com/android/stk/StkMenuConfig.java @@ -153,7 +153,7 @@ public class StkMenuConfig { private void initialize(Context context) { mContext = context; mArray = new ArrayList(); - mConfigs = new Config[TelephonyManager.from(mContext).getSimCount()]; + mConfigs = new Config[TelephonyManager.from(mContext).getSupportedModemCount()]; XmlResourceParser parser = mContext.getResources().getXml(R.xml.menu_conf); -- cgit v1.2.3