• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

packages/apps/Settings


Commit MetaInfo

Revisiona6c73a8124adc2d4fdfe6bdbcc8de96a5ae34293 (tree)
Time2021-11-05 10:36:41
AuthorChih-Wei Huang <cwhuang@linu...>
CommiterMauro Rossi

Log Message

Add Android-x86 dashboard

Add an option to enable or disable native bridge.
More options will be added in the future.

Change Summary

Incremental Difference

--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -3010,6 +3010,26 @@
30103010 android:value="com.android.settings.applications.AppAndNotificationDashboardFragment"/>
30113011 </activity>
30123012
3013+ <activity android:name=".Settings$AndroidX86DashboardActivity"
3014+ android:label="@string/android_x86_options_title"
3015+ android:icon="@drawable/ic_settings_applications">
3016+ <intent-filter>
3017+ <action android:name="android.intent.action.MAIN" />
3018+ <category android:name="android.intent.category.DEFAULT" />
3019+ </intent-filter>
3020+ <intent-filter android:priority="6">
3021+ <action android:name="com.android.settings.action.SETTINGS" />
3022+ </intent-filter>
3023+ <meta-data android:name="com.android.settings.FRAGMENT_CLASS"
3024+ android:value="com.android.settings.system.AndroidX86DashboardFragment" />
3025+ <meta-data android:name="com.android.settings.category"
3026+ android:value="com.android.settings.category.ia.homepage" />
3027+ <meta-data android:name="com.android.settings.summary"
3028+ android:resource="@string/android_x86_dashboard_summary"/>
3029+ <meta-data android:name="com.android.settings.PRIMARY_PROFILE_CONTROLLED"
3030+ android:value="true" />
3031+ </activity>
3032+
30133033 <activity
30143034 android:name=".Settings$AccountDashboardActivity"
30153035 android:label="@string/account_dashboard_title"
--- a/res/values-zh-rCN/strings.xml
+++ b/res/values-zh-rCN/strings.xml
@@ -2011,6 +2011,10 @@
20112011 <string name="runningservicedetails_stop_dlg_title" msgid="6201041461740445113">"要停止系统服务吗?"</string>
20122012 <string name="runningservicedetails_stop_dlg_text" product="tablet" msgid="2076922609580490122">"如果停止此服务,您平板电脑上的某些功能也将随之停止工作,并在您将平板电脑关机然后再重新打开后才能使用。"</string>
20132013 <string name="runningservicedetails_stop_dlg_text" product="default" msgid="2625863973434309085">"如果停止此服务,您手机上的某些功能也将随之停止工作,并在您将手机关机然后再重新打开后才能使用。"</string>
2014+ <string name="android_x86_options_title">"安卓X86设置"</string>
2015+ <string name="android_x86_dashboard_summary">兼容模式、统计</string>
2016+ <string name="nativebridge_toggle_title">"兼容模式"</string>
2017+ <string name="nativebridge_toggle_summary">"可兼容於使用 arm 庫的应用"</string>
20142018 <string name="language_input_gesture_title" msgid="3292455685728572960">"语言、输入法和手势"</string>
20152019 <string name="language_input_gesture_summary_on_with_assist" msgid="8670153838520237089"></string>
20162020 <string name="language_input_gesture_summary_on_non_assist" msgid="2738661322747920463"></string>
--- a/res/values-zh-rHK/strings.xml
+++ b/res/values-zh-rHK/strings.xml
@@ -2011,6 +2011,10 @@
20112011 <string name="runningservicedetails_stop_dlg_title" msgid="6201041461740445113">"停止系統服務?"</string>
20122012 <string name="runningservicedetails_stop_dlg_text" product="tablet" msgid="2076922609580490122">"如果您停用這項服務,您平板電腦上的某些功能可能會停止正常運作,待您重新開機後才會恢復正常。"</string>
20132013 <string name="runningservicedetails_stop_dlg_text" product="default" msgid="2625863973434309085">"如果您停用這項服務,您手機上的某些功能可能會停止正常運作,待您重新開機後才會恢復正常。"</string>
2014+ <string name="android_x86_options_title">"Android-x86 設定"</string>
2015+ <string name="android_x86_dashboard_summary">原生相容模式、統計</string>
2016+ <string name="nativebridge_toggle_title">"原生相容模式"</string>
2017+ <string name="nativebridge_toggle_summary">"可相容於使用 arm 原生函式庫的應用程式"</string>
20142018 <string name="language_input_gesture_title" msgid="3292455685728572960">"語言、輸入和手勢"</string>
20152019 <string name="language_input_gesture_summary_on_with_assist" msgid="8670153838520237089"></string>
20162020 <string name="language_input_gesture_summary_on_non_assist" msgid="2738661322747920463"></string>
--- a/res/values-zh-rTW/strings.xml
+++ b/res/values-zh-rTW/strings.xml
@@ -2011,6 +2011,10 @@
20112011 <string name="runningservicedetails_stop_dlg_title" msgid="6201041461740445113">"停止系統服務?"</string>
20122012 <string name="runningservicedetails_stop_dlg_text" product="tablet" msgid="2076922609580490122">"如果你停用這項服務,你的平板電腦上的某些功能可能無法正常運作,待你重新開機後才會恢復正常。"</string>
20132013 <string name="runningservicedetails_stop_dlg_text" product="default" msgid="2625863973434309085">"如果你停用這項服務,你的手機上的某些功能可能無法正常運作,待你重新開機後才會恢復正常。"</string>
2014+ <string name="android_x86_options_title">"Android-x86 設定"</string>
2015+ <string name="android_x86_dashboard_summary">原生相容模式、統計</string>
2016+ <string name="nativebridge_toggle_title">"原生相容模式"</string>
2017+ <string name="nativebridge_toggle_summary">"可相容於使用 arm 原生函式庫的應用程式"</string>
20142018 <string name="language_input_gesture_title" msgid="3292455685728572960">"語言、輸入和手勢"</string>
20152019 <string name="language_input_gesture_summary_on_with_assist" msgid="8670153838520237089"></string>
20162020 <string name="language_input_gesture_summary_on_non_assist" msgid="2738661322747920463"></string>
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -4664,6 +4664,12 @@
46644664 features of your phone may stop working correctly until you power it off
46654665 and then on again.</string>
46664666
4667+ <!-- Android-x86 settings -->
4668+ <string name="android_x86_options_title">Android-x86 options</string>
4669+ <string name="android_x86_dashboard_summary">Native bridge, statistics</string>
4670+ <string name="nativebridge_toggle_title">Enable native bridge</string>
4671+ <string name="nativebridge_toggle_summary">To support apps with arm native libraries</string>
4672+
46674673 <!-- Languages Settings --> <skip />
46684674 <!-- Title of Language, input & gestures setting on main settings screen. -->
46694675 <string name="language_input_gesture_title">Languages, input &amp; gestures</string>
--- /dev/null
+++ b/res/xml/android_x86_options.xml
@@ -0,0 +1,26 @@
1+<?xml version="1.0" encoding="utf-8"?>
2+<!-- Copyright (C) 2015 The Android-x86 Open Source Project
3+
4+ Licensed under the Apache License, Version 2.0 (the "License");
5+ you may not use this file except in compliance with the License.
6+ You may obtain a copy of the License at
7+
8+ http://www.apache.org/licenses/LICENSE-2.0
9+
10+ Unless required by applicable law or agreed to in writing, software
11+ distributed under the License is distributed on an "AS IS" BASIS,
12+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ See the License for the specific language governing permissions and
14+ limitations under the License.
15+-->
16+
17+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
18+ xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
19+ android:title="@string/android_x86_options_title">
20+
21+ <SwitchPreference android:key="toggle_nb"
22+ android:title="@string/nativebridge_toggle_title"
23+ android:summary="@string/nativebridge_toggle_summary"
24+ android:persistent="false" />
25+
26+</PreferenceScreen>
--- a/src/com/android/settings/Settings.java
+++ b/src/com/android/settings/Settings.java
@@ -98,6 +98,7 @@ public class Settings extends SettingsActivity {
9898 public static class MyDeviceInfoActivity extends SettingsActivity { /* empty */ }
9999 public static class ModuleLicensesActivity extends SettingsActivity { /* empty */ }
100100 public static class ApplicationSettingsActivity extends SettingsActivity { /* empty */ }
101+ public static class AndroidX86DashboardActivity extends SettingsActivity { /* empty */ }
101102 public static class ManageApplicationsActivity extends SettingsActivity { /* empty */ }
102103 public static class ManageAssistActivity extends SettingsActivity { /* empty */ }
103104 public static class HighPowerApplicationsActivity extends SettingsActivity { /* empty */ }
--- a/src/com/android/settings/core/gateway/SettingsGateway.java
+++ b/src/com/android/settings/core/gateway/SettingsGateway.java
@@ -140,6 +140,7 @@ import com.android.settings.security.SecuritySettings;
140140 import com.android.settings.shortcut.CreateShortcut;
141141 import com.android.settings.sound.MediaControlsSettings;
142142 import com.android.settings.support.SupportDashboardActivity;
143+import com.android.settings.system.AndroidX86DashboardFragment;
143144 import com.android.settings.system.ResetDashboardFragment;
144145 import com.android.settings.system.SystemDashboardFragment;
145146 import com.android.settings.tts.TextToSpeechSettings;
@@ -290,6 +291,7 @@ public class SettingsGateway {
290291 AppAndNotificationDashboardFragment.class.getName(),
291292 WifiCallingDisclaimerFragment.class.getName(),
292293 AccountDashboardFragment.class.getName(),
294+ AndroidX86DashboardFragment.class.getName(),
293295 EnterprisePrivacySettings.class.getName(),
294296 WebViewAppPicker.class.getName(),
295297 LockscreenDashboardFragment.class.getName(),
@@ -315,6 +317,7 @@ public class SettingsGateway {
315317 Settings.NetworkDashboardActivity.class.getName(),
316318 Settings.ConnectedDeviceDashboardActivity.class.getName(),
317319 Settings.AppAndNotificationDashboardActivity.class.getName(),
320+ Settings.AndroidX86DashboardActivity.class.getName(),
318321 Settings.DisplaySettingsActivity.class.getName(),
319322 Settings.SoundSettingsActivity.class.getName(),
320323 Settings.StorageDashboardActivity.class.getName(),
--- /dev/null
+++ b/src/com/android/settings/system/AndroidX86DashboardFragment.java
@@ -0,0 +1,55 @@
1+/*
2+ * Copyright (C) 2018 The Android-x86 Open Source Project
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
16+
17+package com.android.settings.system;
18+
19+import android.os.Bundle;
20+import android.os.SystemProperties;
21+import androidx.preference.Preference;
22+import androidx.preference.SwitchPreference;
23+import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
24+import com.android.settings.R;
25+import com.android.settings.SettingsPreferenceFragment;
26+
27+public class AndroidX86DashboardFragment extends SettingsPreferenceFragment {
28+
29+ private SwitchPreference mNativeBridgePreference;
30+
31+ private static final String KEY_TOGGLE_NB = "toggle_nb";
32+ private static final String PROPERTY_NATIVEBRIDGE = "persist.sys.nativebridge";
33+
34+ @Override
35+ public void onCreate(Bundle icicle) {
36+ super.onCreate(icicle);
37+
38+ addPreferencesFromResource(R.xml.android_x86_options);
39+ mNativeBridgePreference = (SwitchPreference) findPreference(KEY_TOGGLE_NB);
40+ mNativeBridgePreference.setChecked(SystemProperties.getBoolean(PROPERTY_NATIVEBRIDGE, false));
41+ }
42+
43+ @Override
44+ public boolean onPreferenceTreeClick(Preference preference) {
45+ if (preference == mNativeBridgePreference) {
46+ SystemProperties.set(PROPERTY_NATIVEBRIDGE, mNativeBridgePreference.isChecked() ? "1" : "0");
47+ }
48+ return super.onPreferenceTreeClick(preference);
49+ }
50+
51+ @Override
52+ public int getMetricsCategory() {
53+ return MetricsEvent.APPLICATION;
54+ }
55+}