和通讯录 v4.2.0版本的 MD5 值为:f213fa766dccbfebde0dd8add5534518
以下内容为反编译后的 SettingDefaultAppView.java 源代码,内容仅作参考
package com.chinamobile.contacts.im.mms2.view;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.util.AttributeSet;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import com.chinamobile.contacts.im.C0019R;
import com.chinamobile.contacts.im.config.m;
import com.chinamobile.contacts.im.data.MediaPlatformDBManager;
import com.chinamobile.contacts.im.data.simcard.MultiSimCardAccessor;
import com.chinamobile.contacts.im.mms2.utils.CommonTools;
import com.chinamobile.contacts.im.mms2.view.NotificationTextView;
import com.chinamobile.contacts.im.setting.BrowserActivity;
import com.chinamobile.contacts.im.utils.ApplicationUtils;
import com.chinamobile.contacts.im.view.BaseDialog;
import com.chinamobile.contacts.im.view.HintsDialog;
import com.umeng.analytics.AspMobclickAgent;
public class SettingDefaultAppView extends RelativeLayout implements View.OnClickListener {
private Button mButton;
private Context mContext;
private ImageView mNotice;
private NotificationTextView mNotificationTextView;
public SentMmsView mSentMmsView;
public SettingDefaultAppView(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
this.mContext = context;
}
@Override
protected void onFinishInflate() {
super.onFinishInflate();
this.mButton = (Button) findViewById(C0019R.id.set_default_app);
this.mButton.setOnClickListener(this);
this.mNotificationTextView = (NotificationTextView) findViewById(C0019R.id.text);
if (MultiSimCardAccessor.MODEL_HTC_E9t.equals(Build.MODEL) || MultiSimCardAccessor.MODEL_HTC_E9pt.equals(Build.MODEL) || MultiSimCardAccessor.MODEL_HTC_D826T.equals(Build.MODEL)) {
this.mNotificationTextView.setText("请将和通讯录设为默认应用,才能正常使用短信功能(此机型暂不支持彩信功能!)");
}
this.mNotice = (ImageView) findViewById(C0019R.id.notice);
this.mNotificationTextView.setLineCallback(new NotificationTextView.LineCallback() {
@Override
public void onLineCallback() {
if (!CommonTools.getInstance().isDefaultApp(SettingDefaultAppView.this.mContext)) {
SettingDefaultAppView.this.setVisibility(0);
if (SettingDefaultAppView.this.mNotificationTextView.getLineCount() == 1) {
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) SettingDefaultAppView.this.mNotice.getLayoutParams();
layoutParams.topMargin = 0;
layoutParams.addRule(15);
SettingDefaultAppView.this.mNotice.setLayoutParams(layoutParams);
return;
}
return;
}
SettingDefaultAppView.this.setVisibility(8);
}
});
}
@Override
public void onClick(View view) {
switch (view.getId()) {
case C0019R.id.set_default_app:
AspMobclickAgent.onEvent(this.mContext, "sms_setting_default_apply");
if (ApplicationUtils.isHuaWei() || ApplicationUtils.isMeiZu() || ApplicationUtils.isSumSam()) {
if (!CommonTools.getInstance().isDefaultApp(this.mContext)) {
if (!m.D(this.mContext)) {
m.a(this.mContext, (Boolean) true);
String str = "由于系统限制,结束和通讯录进程会导致无法正常接收短信,建议将本应用加入系统受保护应用。路径:设置—受保护的后台应用,开启和通讯录开关。";
int i = C0019R.string.check_setting;
if (ApplicationUtils.isHuaWei()) {
str = "由于系统限制,结束和通讯录进程会导致无法正常接收短信,请在“受保护的后台应用”开启和通讯录开关。";
i = C0019R.string.jump_setting;
} else if (ApplicationUtils.isMeiZu()) {
str = "由于系统限制,结束和通讯录进程会导致无法正常接收短信,请在“自启动管理”开启和通讯录开关。";
} else if (ApplicationUtils.isSumSam()) {
str = "由于系统限制,结束和通讯录进程会导致无法正常接收短信,请在“自动运行应用程序”开启和通讯录开关。";
}
final HintsDialog hintsDialog = new HintsDialog(this.mContext, "温馨提示", str);
hintsDialog.setButton(new BaseDialog.ButtonListener() {
@Override
public void OnPositiveButtonClickListener(String str2) {
Intent intent = new Intent();
ComponentName componentName = null;
if (ApplicationUtils.isHuaWei()) {
AspMobclickAgent.onEvent(SettingDefaultAppView.this.mContext, "HuaweiSettingDiaglog_open");
componentName = new ComponentName("com.huawei.systemmanager", "com.huawei.systemmanager.optimize.process.ProtectActivity");
} else if (ApplicationUtils.isMeiZu()) {
AspMobclickAgent.onEvent(SettingDefaultAppView.this.mContext, "MXautostartSettingDiaglog_seeSetting");
Intent intent2 = new Intent(SettingDefaultAppView.this.mContext, (Class<?>) BrowserActivity.class);
intent2.putExtra(MediaPlatformDBManager.KEY_TITLE, "权限检测助手");
intent2.putExtra("url", "http://pim1.10086.cn/getThirdHlp.action?os=android&inSec=2&inThird=15");
SettingDefaultAppView.this.mContext.startActivity(intent2);
} else {
AspMobclickAgent.onEvent(SettingDefaultAppView.this.mContext, "SamsungautostartSettingDiaglog_seeSetting");
Intent intent3 = new Intent(SettingDefaultAppView.this.mContext, (Class<?>) BrowserActivity.class);
intent3.putExtra(MediaPlatformDBManager.KEY_TITLE, "权限检测助手");
intent3.putExtra("url", "http://pim1.10086.cn/getThirdHlp.action?os=android&inSec=2&inThird=13");
SettingDefaultAppView.this.mContext.startActivity(intent3);
}
intent.setComponent(componentName);
SettingDefaultAppView.this.mContext.startActivity(intent);
}
}, i, C0019R.string.cancel);
hintsDialog.setNegtiveButton(new BaseDialog.ButtonListener() {
@Override
public void OnPositiveButtonClickListener(String str2) {
if (ApplicationUtils.isHuaWei()) {
AspMobclickAgent.onEvent(SettingDefaultAppView.this.mContext, "HuaweiSettingDiaglog_cancel");
} else if (ApplicationUtils.isMeiZu()) {
AspMobclickAgent.onEvent(SettingDefaultAppView.this.mContext, "MXautostartSettingDiaglog_cancel");
} else {
AspMobclickAgent.onEvent(SettingDefaultAppView.this.mContext, "samsungautostartSettingDiaglog_cancel");
}
hintsDialog.dismiss();
}
});
hintsDialog.show();
return;
}
CommonTools.getInstance().setDefaultApp(this.mContext);
return;
}
return;
}
if (!CommonTools.getInstance().isDefaultApp(this.mContext)) {
CommonTools.getInstance().setDefaultApp(this.mContext);
return;
}
return;
default:
return;
}
}
}