红米4X Settings SIM卡 两处点击出现CRASH

红米4X Settings SIM卡 两处点击出现CRASH
0

#1

之一:

问题描述: 设置-SIM卡有两处点击出现CRASH
当前版本: MK71.2-santoni-201711041706-NIGHTLY
复现步骤: 设置 - SIM卡 - SIM卡1设置-运营商设置
只插了一张SIM卡,电信4G卡。


11-07 15:11:35.322 1173 1450 E ActivityManager: Activity Manager Crash
11-07 15:11:35.322 1173 1450 E ActivityManager: java.lang.IllegalArgumentException: Unknown component: /
11-07 15:11:35.322 1173 1450 E ActivityManager: at com.android.server.pm.PackageManagerService.isComponentProtected(PackageManagerService.java:20944)
11-07 15:11:35.322 1173 1450 E ActivityManager: at com.android.server.am.ActivityStarter.startActivityMayWait(ActivityStarter.java:800)
11-07 15:11:35.322 1173 1450 E ActivityManager: at com.android.server.am.ActivityManagerService.startActivityAsUser(ActivityManagerService.java:4572)
11-07 15:11:35.322 1173 1450 E ActivityManager: at com.android.server.am.ActivityManagerService.startActivity(ActivityManagerService.java:4540)
11-07 15:11:35.322 1173 1450 E ActivityManager: at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:166)
11-07 15:11:35.322 1173 1450 E ActivityManager: at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2987)
11-07 15:11:35.322 1173 1450 E ActivityManager: at android.os.Binder.execTransact(Binder.java:565)
11-07 15:11:35.342 1909 1909 E AndroidRuntime: FATAL EXCEPTION: main
11-07 15:11:35.342 1909 1909 E AndroidRuntime: Process: com.android.phone, PID: 1909
11-07 15:11:35.342 1909 1909 E AndroidRuntime: java.lang.IllegalArgumentException: Unknown component: /
11-07 15:11:35.342 1909 1909 E AndroidRuntime: at android.os.Parcel.readException(Parcel.java:1688)
11-07 15:11:35.342 1909 1909 E AndroidRuntime: at android.os.Parcel.readException(Parcel.java:1637)
11-07 15:11:35.342 1909 1909 E AndroidRuntime: at android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:3115)
11-07 15:11:35.342 1909 1909 E AndroidRuntime: at android.app.Instrumentation.execStartActivity(Instrumentation.java:1520)
11-07 15:11:35.342 1909 1909 E AndroidRuntime: at android.app.Activity.startActivityForResult(Activity.java:4229)
11-07 15:11:35.342 1909 1909 E AndroidRuntime: at android.app.Activity.startActivityForResult(Activity.java:4187)
11-07 15:11:35.342 1909 1909 E AndroidRuntime: at android.app.Activity.startActivity(Activity.java:4526)
11-07 15:11:35.342 1909 1909 E AndroidRuntime: at android.app.Activity.startActivity(Activity.java:4494)
11-07 15:11:35.342 1909 1909 E AndroidRuntime: at android.preference.Preference.performClick(Preference.java:1015)
11-07 15:11:35.342 1909 1909 E AndroidRuntime: at android.preference.PreferenceScreen.onItemClick(PreferenceScreen.java:249)
11-07 15:11:35.342 1909 1909 E AndroidRuntime: at android.widget.AdapterView.performItemClick(AdapterView.java:310)
11-07 15:11:35.342 1909 1909 E AndroidRuntime: at android.widget.AbsListView.performItemClick(AbsListView.java:1164)
11-07 15:11:35.342 1909 1909 E AndroidRuntime: at android.widget.AbsListView$PerformClick.run(AbsListView.java:3139)
11-07 15:11:35.342 1909 1909 E AndroidRuntime: at android.widget.AbsListView$3.run(AbsListView.java:4054)
11-07 15:11:35.342 1909 1909 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:751)
11-07 15:11:35.342 1909 1909 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:95)
11-07 15:11:35.342 1909 1909 E AndroidRuntime: at android.os.Looper.loop(Looper.java:154)
11-07 15:11:35.342 1909 1909 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6236)
11-07 15:11:35.342 1909 1909 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
11-07 15:11:35.342 1909 1909 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:891)
11-07 15:11:35.342 1909 1909 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:781)
11-07 15:11:35.887 1173 3194 E UserRestrictionsUtils: Unknown restriction: no_config_sim
11-07 15:11:36.106 1173 1906 E UserRestrictionsUtils: Unknown restriction: no_config_sim

之二:

问题描述: 设置-SIM卡有两处点击出现CRASH
当前版本: MK71.2-santoni-201711041706-NIGHTLY
复现步骤: 设置 - SIM卡 - SIM卡插槽2 点击开启(SIM卡2未插卡,这个竟然可以点击得动),然后就CRASH。这个并不重要,因为SIM卡2无卡,但能改掉最好,给个提示,或者无反映也可以,只要不CRASH就好。

11-07 15:10:27.619 1933 1933 E AndroidRuntime: FATAL EXCEPTION: main
11-07 15:10:27.619 1933 1933 E AndroidRuntime: Process: com.android.settings, PID: 1933
11-07 15:10:27.619 1933 1933 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method ‘java.lang.CharSequence android.telephony.SubscriptionInfo.getDisplayName()’ on a null object reference
11-07 15:10:27.619 1933 1933 E AndroidRuntime: at com.android.settings.sim.SimSettings$SimEnablerPreference.showAlertDialog(SimSettings.java:685)
11-07 15:10:27.619 1933 1933 E AndroidRuntime: at com.android.settings.sim.SimSettings$SimEnablerPreference.-wrap5(SimSettings.java)
11-07 15:10:27.619 1933 1933 E AndroidRuntime: at com.android.settings.sim.SimSettings$SimEnablerPreference$3.handleMessage(SimSettings.java:823)
11-07 15:10:27.619 1933 1933 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
11-07 15:10:27.619 1933 1933 E AndroidRuntime: at android.os.Looper.loop(Looper.java:154)
11-07 15:10:27.619 1933 1933 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6236)
11-07 15:10:27.619 1933 1933 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
11-07 15:10:27.619 1933 1933 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:891)
11-07 15:10:27.619 1933 1933 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:781)
11-07 15:10:35.720 1173 1906 E ActivityManager: Found activity ActivityRecord{b4148d4 u0 com.android.settings/.Settings t11 f} in proc activity list using null instead of expected ProcessRecord{4378dd0 1933:com.android.settings/1000}


“运营商设置“点击后“com.androidphone停止运行”
#2

强迫症患者表示,此问题解决,才会舒服些:
SimSettings.java:

    private void showProgressDialog() {

        String title =mSubInfoRecord==null?"*":mSubInfoRecord.getDisplayName().toString();

        String msg = mContext.getString(mIsChecked ? R.string.sim_enabler_enabling
                : R.string.sim_enabler_disabling);
        dismissDialog(mProgressDialog);
        mProgressDialog = new ProgressDialog(mContext);
        mProgressDialog.setIndeterminate(true);
        mProgressDialog.setTitle(title);
        mProgressDialog.setMessage(msg);
        mProgressDialog.setCancelable(false);
        mProgressDialog.setCanceledOnTouchOutside(false);
        mProgressDialog.show();

        sendMessage(EVT_PROGRESS_DLG_TIME_OUT, mHandler, PROGRESS_DLG_TIME_OUT);
    }

    private void showAlertDialog(int dialogId, int msgId) {

     String title;
      if(mSubInfoRecord==null){
           title="null";
            msgid=R.string.sub_activate_failed;  //先用这个吧
      }else
        title = mSubInfoRecord.getDisplayName().toString();
        // Confirm only one AlertDialog instance to show.
        dismissDialog(mAlertDialog);
        dismissDialog(mProgressDialog);

其实,问题不在这儿,应该是这个东西不可点击才对。当然,我是在smali下改的,编译太麻烦。


#3

你这俩问题我都没有 = =
moto z


#4

你能力这么强不如直接来改源码?


咦?你log里面贴的错误在showAlertDialog()里面,你修改的showProgressDialog(),居然也可以啊?


#5

那个是之前的错误,改掉了以后,后面还有个错误,原因在于没卡时那东西是NULL。
改源码,当然可以,不过编译太麻烦,这点小问题,既然找到了,那就改smali了。改源码的活交给龙猪吧。我也没权限上源码仓库上去改,也觉得太麻烦。


#6

之一的解决。经过查找,竟然发现这问题不是在Settings.apk里,而是在Teleservices.apk里。这个找了好久,才找到,只是后来一下子想到了,电话的东西当然与电话有关了,于是找与电话有关的APK来查。
问题出在这儿:
xml\gsm_umts_options.xml 和cdma_options.xml 里面有关包名和类名竟然是空!我也不知道它原来是什么,干脆去掉它。

cdma_options.xml :

<PreferenceScreen android:title="@string/cdma_activate_device" android:key=“cdma_activate_device_key”>
<intent android:action=“com.android.phone.PERFORM_VOICELESS_CDMA_PROVISIONING”>
<extra android:name=“autoStart” android:value=“true” />
</intent>
</PreferenceScreen>

<!-- <PreferenceScreen android:title="@string/carrier_settings_title" android:key="carrier_settings_key"> <intent android:targetPackage="@string/carrier_settings" android:action="android.intent.action.MAIN" android:targetClass="@string/carrier_settings_menu" /> </PreferenceScreen> -->
</PreferenceScreen>

xml\gsm_umts_options.xml :

<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:settings="http://schemas.android.com/apk/res/com.android.phone">

    <PreferenceScreen
        android:key="button_apn_key"
        android:title="@string/apn_settings"
        android:persistent="false">

        <!-- The launching Intent will be defined thru code as we need to pass some Extra -->

    </PreferenceScreen>

    <PreferenceScreen
        android:key="button_carrier_sel_key"
        android:title="@string/networks"
        android:summary="@string/sum_carrier_select"
        android:persistent="false">
    </PreferenceScreen>

    <PreferenceScreen
        android:key="carrier_settings_key"
        android:title="@string/carrier_settings_title">
        <intent android:action="android.intent.action.MAIN"
                android:targetPackage="@string/carrier_settings"
                android:targetClass="@string/carrier_settings_menu" />
    </PreferenceScreen>

</PreferenceScreen>

(PS:帮你改一下部分格式 by hcz017)


#7

对,我也找到这里了,这两个文件是布局。
但是是否启用显示需要根据运营商来配置

    /** Display carrier settings menu if true */
    public static final String KEY_CARRIER_SETTINGS_ENABLE_BOOL = "carrier_settings_enable_bool";

    /** Control whether users can reach the carrier portions of Cellular Network Settings. */
    public static final String
            KEY_HIDE_CARRIER_NETWORK_SETTINGS_BOOL = "hide_carrier_network_settings_bool";

我查便主代码也只发现carrier_config_310120.xml(mccmnc为310120)有进行来配置

<boolean name="carrier_settings_enable_bool" value="true" />

所以我的理解除非在device/机型/overlay下对这两个值做配置的话,默认值都为false那手机上应该不会显示这个选项,我的就没显示,然而我在MoKee/android_device_xiaomi_santoni下并没有搜到这两个值,我也不知道你的手机是怎么显示出来的。。


#8

我查了一下,你说的确实没错,此机 KEY_CARRIER_SETTINGS_ENABLE_BOOL 确实没有设置.
CdmaOption里取得值也是对的:false.
问题出在这儿:

    if (!isCarrierSettingsEnabled) {
        Preference pref = mPrefScreen.findPreference(BUTTON_CARRIER_SETTINGS_KEY);
        if (pref != null) { //这里的pref为空,但为啥,不知道,接说不应该。我都怀疑
//mPrefScreen的值不对。我这机是单插一张电信卡,在1号槽中。甚至可能其它的都有问题。
            mPrefScreen.removePreference(pref);
        }
    }

不再研究了,反正就我这机是这样情况,直接去掉先用着吧。


#9

刷机3大禁忌之一 电信卡


#10

问题解决了,刷了1112版后,此问题自然解决。真的不知道是因为啥乱套了。


#11

该主题在最后一个回复创建后30天后自动关闭。不再允许新的回复。