diff --git a/vendor/mediatek/proprietary/packages/apps/MtkSettings/AndroidManifest.xml b/vendor/mediatek/proprietary/packages/apps/MtkSettings/AndroidManifest.xml
old mode 100644
new mode 100755
index 07caad96e61..bce02365ec2
--- a/vendor/mediatek/proprietary/packages/apps/MtkSettings/AndroidManifest.xml
+++ b/vendor/mediatek/proprietary/packages/apps/MtkSettings/AndroidManifest.xml
@@ -141,7 +141,37 @@
<uses-library android:name="org.apache.http.legacy" />
<!-- Settings -->
-
+ <!-- 注册一个activity,用于启动 com.android.internal.app.ResolverActivity -->
+ <!-- swl add -->
+ <activity android:name=".SetLauncherActivity"
+ android:label="桌面设置"
+ android:taskAffinity="">
+ <intent-filter android:priority="1">
+ <action android:name="com.android.settings.SETLAUNCHERACTIVITY" />
+ <action android:name="android.settings.SETLAUNCHERACTIVITY" />
+ <category android:name="android.intent.category.DEFAULT" />
+ </intent-filter>
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.DEFAULT" />
+ <category android:name="android.intent.category.VOICE_LAUNCH" />
+ <category android:name="com.android.settings.SHORTCUT" />
+ </intent-filter>
+
+ <intent-filter android:priority="100">
+ <action android:name="com.android.settings.action.SETTINGS" />
+ </intent-filter>
+ <!--此项在主setting位置(ia.homepage) -->
+ <meta-data android:name="com.android.settings.category"
+ android:value="com.android.settings.category.ia.homepage" />
+
+ <meta-data android:name="com.android.settings.ACTIVITY_ACTION"
+ android:value="com.android.settings.SETLAUNCHERACTIVITY" />
+
+ <meta-data android:name="com.android.settings.PRIMARY_PROFILE_CONTROLLED"
+ android:value="true" />
+ </activity>
+ <!-- end -->
<activity android:name=".homepage.SettingsHomepageActivity"
android:label="@string/settings_label_launcher"
android:theme="@style/Theme.Settings.Home"
diff --git a/vendor/mediatek/proprietary/packages/apps/MtkSettings/res/layout/setLauncher.xml b/vendor/mediatek/proprietary/packages/apps/MtkSettings/res/layout/setLauncher.xml
new file mode 100755
index 00000000000..345a9b9eda7
--- /dev/null
+++ b/vendor/mediatek/proprietary/packages/apps/MtkSettings/res/layout/setLauncher.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="horizontal"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+</LinearLayout>
diff --git a/vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/SetLauncherActivity.java b/vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/SetLauncherActivity.java
new file mode 100755
index 00000000000..d258ef96ed3
--- /dev/null
+++ b/vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/SetLauncherActivity.java
@@ -0,0 +1,20 @@
+package com.android.settings;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.os.Bundle;
+import android.view.View;
+
+public class SetLauncherActivity extends Activity {
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.setLauncher);
+ Intent intent = new Intent();
+ intent.setAction(Intent.ACTION_MAIN);
+ intent.addCategory(Intent.CATEGORY_HOME);
+ intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ intent.setClassName("android","com.android.internal.app.ResolverActivity");
+ startActivity(intent);
+ }
+}
设置中添加桌面设置,并且功能能够正常切换桌面APK
最新推荐文章于 2024-08-31 18:42:13 发布