如何去掉mtk自行开发的快速向导和设置向导功能(即OOBE)?

如何拿掉OOBE功能呢?

方法一: 通过编译选项开关拿掉OOBE(这种方法会同时拿掉快速向导和设置向导两部分):
在对应工程的ProjectConfig.mk中,找到MTK_OOBE_APP这个开关,把它从yes修改成no。
方法二:修改代码(可以做到保留前半段的设置向导,只单独拿掉后半段的快速向导功能):
alps/mediatek/packages/apps/OOBE/scr/com/mediatek/oobe/basic/MainActivity.java
private void finishOOBE() {
......
if (oobeHasRun == 0 || wizardDisabledState != PackageManager.COMPONENT_ENABLED_STATE_DISABLED) {
Xlog.i(TAG, "Here we go, MainActivity.finishOOBE(), set oobe_has_run flag to 1 , start launcher now");
Settings.System.putInt(getContentResolver(), OOBEConstants.OOBE_HAS_RUN_KEY, 1);

/* this start quick start guide, if it's the first run of OOBE */
//mtk added
/*
if (!sIsTablet) {
Intent intent = new Intent(OOBEConstants.ACTION_QUICK_START_GUIDE);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
intent.putExtra("mIsFirstRun", true);
startActivity(intent);
} else if(mIsFirstRun) {
*/
//mtk added
Settings.System.putInt(getContentResolver(),
Settings.System.OOBE_DISPLAY, Settings.System.OOBE_DISPLAY_DEFAULT);
Settings.Global.putInt(getContentResolver(), Settings.Global.DEVICE_PROVISIONED, 1);
// } //mtk added

......
}


public void onCreate(Bundle savedInstanceState) {
......
// disable QSG on tablet
PackageManager pm = getPackageManager();
ComponentName name = new ComponentName(this, QuickStartGuideMain.class);
int qsgDisabledState = pm.getComponentEnabledSetting(name);
Xlog.d(TAG, "disable QSG on tablet qsgDisabledState" + qsgDisabledState);

if (qsgDisabledState != PackageManager.COMPONENT_ENABLED_STATE_DISABLED) {
Xlog.d(TAG, "tablet disable qsg");
pm.setComponentEnabledSetting(name, PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
PackageManager.DONT_KILL_APP);
}

mSIMIntentFilter = new IntentFilter(TelephonyIntents.ACTION_SIM_STATE_CHANGED);
mSIMIntentFilter.addAction(TelephonyIntents.ACTION_PHB_STATE_CHANGED);
......
}

你可能感兴趣的:(mtk)