packages/apps/Settings
修订版 | 0bc1afe225d16a6a947e1ee1a6ac9e935d3540d7 (tree) |
---|---|
时间 | 2015-12-18 18:35:55 |
作者 | Chih-Wei Huang <cwhuang@linu...> |
Commiter | Chih-Wei Huang |
Add an option to control native bridge
@@ -787,6 +787,21 @@ | ||
787 | 787 | android:resource="@id/application_settings" /> |
788 | 788 | </activity> |
789 | 789 | |
790 | + <activity android:name="Settings$AppsCompatibilityActivity" | |
791 | + android:label="@string/apps_compatibility_title" | |
792 | + android:taskAffinity=""> | |
793 | + <intent-filter> | |
794 | + <action android:name="android.intent.action.MAIN" /> | |
795 | + <category android:name="android.intent.category.DEFAULT" /> | |
796 | + </intent-filter> | |
797 | + <meta-data android:name="com.android.settings.FRAGMENT_CLASS" | |
798 | + android:value="com.android.settings.AppsCompatibility" /> | |
799 | + <meta-data android:name="com.android.settings.TOP_LEVEL_HEADER_ID" | |
800 | + android:resource="@id/apps_compatibility_settings" /> | |
801 | + <meta-data android:name="com.android.settings.PRIMARY_PROFILE_CONTROLLED" | |
802 | + android:value="true" /> | |
803 | + </activity> | |
804 | + | |
790 | 805 | <!-- Keep compatibility with old shortcuts. --> |
791 | 806 | <activity-alias android:name=".applications.ManageApplications" |
792 | 807 | android:label="@string/applications_settings" |
@@ -1345,6 +1345,9 @@ | ||
1345 | 1345 | <string name="runningservicedetails_stop_dlg_title" msgid="4253292537154337233">"要停止系统服务吗?"</string> |
1346 | 1346 | <string name="runningservicedetails_stop_dlg_text" product="tablet" msgid="3371302398335665793">"如果停止此服务,您平板电脑上的某些功能也将随之停止工作,并在您将平板电脑关机然后再重新打开后才能使用。"</string> |
1347 | 1347 | <string name="runningservicedetails_stop_dlg_text" product="default" msgid="3920243762189484756">"如果停止此服务,您手机上的某些功能也将随之停止工作,并在您将手机关机然后再重新打开后才能使用。"</string> |
1348 | + <string name="apps_compatibility_title">"应用兼容性"</string> | |
1349 | + <string name="nativebridge_toggle_title">"兼容模式"</string> | |
1350 | + <string name="nativebridge_toggle_summary">"可兼容於使用 arm 庫的应用"</string> | |
1348 | 1351 | <string name="language_settings" msgid="5292716747264442359">"语言和输入法"</string> |
1349 | 1352 | <string name="language_keyboard_settings_title" msgid="243220021717425813">"语言和输入法"</string> |
1350 | 1353 | <string name="language_settings_category" msgid="2288258489940617043">"语言设置"</string> |
@@ -1345,6 +1345,9 @@ | ||
1345 | 1345 | <string name="runningservicedetails_stop_dlg_title" msgid="4253292537154337233">"停止系統服務?"</string> |
1346 | 1346 | <string name="runningservicedetails_stop_dlg_text" product="tablet" msgid="3371302398335665793">"如果您停用這項服務,您平板電腦上的某些功能可能會停止正常運作,待您重新開機後才會恢復正常。"</string> |
1347 | 1347 | <string name="runningservicedetails_stop_dlg_text" product="default" msgid="3920243762189484756">"如果您停用這項服務,您手機上的某些功能可能會停止正常運作,待您重新開機後才會恢復正常。"</string> |
1348 | + <string name="apps_compatibility_title">"應用程式相容性"</string> | |
1349 | + <string name="nativebridge_toggle_title">"原生相容模式"</string> | |
1350 | + <string name="nativebridge_toggle_summary">"可相容於使用 arm 原生函式庫的應用程式"</string> | |
1348 | 1351 | <string name="language_settings" msgid="5292716747264442359">"語言和輸入設定"</string> |
1349 | 1352 | <string name="language_keyboard_settings_title" msgid="243220021717425813">"語言和輸入設定"</string> |
1350 | 1353 | <string name="language_settings_category" msgid="2288258489940617043">"語言設定"</string> |
@@ -1345,6 +1345,9 @@ | ||
1345 | 1345 | <string name="runningservicedetails_stop_dlg_title" msgid="4253292537154337233">"停止系統服務?"</string> |
1346 | 1346 | <string name="runningservicedetails_stop_dlg_text" product="tablet" msgid="3371302398335665793">"如果您停用這項服務,您的平板電腦上的某些功能可能無法正常運作,待您重新開機後才會恢復正常。"</string> |
1347 | 1347 | <string name="runningservicedetails_stop_dlg_text" product="default" msgid="3920243762189484756">"如果您停用這項服務,您的手機上的某些功能可能無法正常運作,待您重新開機後才會恢復正常。"</string> |
1348 | + <string name="apps_compatibility_title">"應用程式相容性"</string> | |
1349 | + <string name="nativebridge_toggle_title">"原生相容模式"</string> | |
1350 | + <string name="nativebridge_toggle_summary">"可相容於使用 arm 原生函式庫的應用程式"</string> | |
1348 | 1351 | <string name="language_settings" msgid="5292716747264442359">"語言與輸入設定"</string> |
1349 | 1352 | <string name="language_keyboard_settings_title" msgid="243220021717425813">"語言與輸入設定"</string> |
1350 | 1353 | <string name="language_settings_category" msgid="2288258489940617043">"語言設定"</string> |
@@ -3194,6 +3194,11 @@ | ||
3194 | 3194 | features of your phone may stop working correctly until you power it off |
3195 | 3195 | and then on again.</string> |
3196 | 3196 | |
3197 | + <!-- Apps compatibility settings --> | |
3198 | + <string name="apps_compatibility_title">Apps compatibility</string> | |
3199 | + <string name="nativebridge_toggle_title">Enable native bridge</string> | |
3200 | + <string name="nativebridge_toggle_summary">To support apps with arm native libraries</string> | |
3201 | + | |
3197 | 3202 | <!-- Language Settings --> <skip /> |
3198 | 3203 | <!-- Title of setting on main settings screen. This item will take the user to the screen to tweak settings realted to locale and text --> |
3199 | 3204 | <string name="language_settings">Language & input</string> |
@@ -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/apps_compatibility_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> |
@@ -124,6 +124,14 @@ | ||
124 | 124 | android:icon="@drawable/ic_settings_applications" |
125 | 125 | /> |
126 | 126 | |
127 | + <!-- Apps Compatibility --> | |
128 | + <dashboard-tile | |
129 | + android:id="@+id/apps_compatibility_settings" | |
130 | + android:title="@string/apps_compatibility_title" | |
131 | + android:fragment="com.android.settings.AppsCompatibility" | |
132 | + android:icon="@drawable/ic_settings_applications" | |
133 | + /> | |
134 | + | |
127 | 135 | <!-- Manage users --> |
128 | 136 | <dashboard-tile |
129 | 137 | android:id="@+id/user_settings" |
@@ -0,0 +1,48 @@ | ||
1 | +/* | |
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 | +package com.android.settings; | |
18 | + | |
19 | +import android.os.Bundle; | |
20 | +import android.os.SystemProperties; | |
21 | +import android.preference.Preference; | |
22 | +import android.preference.PreferenceScreen; | |
23 | +import android.preference.SwitchPreference; | |
24 | + | |
25 | +public class AppsCompatibility extends SettingsPreferenceFragment { | |
26 | + | |
27 | + private SwitchPreference mNativeBridgePreference; | |
28 | + | |
29 | + private static final String KEY_TOGGLE_NB = "toggle_nb"; | |
30 | + private static final String PROPERTY_NATIVEBRIDGE = "persist.sys.nativebridge"; | |
31 | + | |
32 | + @Override | |
33 | + public void onCreate(Bundle icicle) { | |
34 | + super.onCreate(icicle); | |
35 | + | |
36 | + addPreferencesFromResource(R.xml.apps_compatibility_prefs); | |
37 | + mNativeBridgePreference = (SwitchPreference) findPreference(KEY_TOGGLE_NB); | |
38 | + mNativeBridgePreference.setChecked(SystemProperties.getBoolean(PROPERTY_NATIVEBRIDGE, false)); | |
39 | + } | |
40 | + | |
41 | + @Override | |
42 | + public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) { | |
43 | + if (preference == mNativeBridgePreference) { | |
44 | + SystemProperties.set(PROPERTY_NATIVEBRIDGE, mNativeBridgePreference.isChecked() ? "1" : "0"); | |
45 | + } | |
46 | + return super.onPreferenceTreeClick(preferenceScreen, preference); | |
47 | + } | |
48 | +} |
@@ -46,6 +46,7 @@ public class Settings extends SettingsActivity { | ||
46 | 46 | public static class DisplaySettingsActivity extends SettingsActivity { /* empty */ } |
47 | 47 | public static class DeviceInfoSettingsActivity extends SettingsActivity { /* empty */ } |
48 | 48 | public static class ApplicationSettingsActivity extends SettingsActivity { /* empty */ } |
49 | + public static class AppsCompatibilityActivity extends SettingsActivity { /* empty */ } | |
49 | 50 | public static class ManageApplicationsActivity extends SettingsActivity { /* empty */ } |
50 | 51 | public static class AppOpsSummaryActivity extends SettingsActivity { |
51 | 52 | @Override |
@@ -224,6 +224,7 @@ public class SettingsActivity extends Activity | ||
224 | 224 | R.id.display_settings, |
225 | 225 | R.id.storage_settings, |
226 | 226 | R.id.application_settings, |
227 | + R.id.apps_compatibility_settings, | |
227 | 228 | R.id.battery_settings, |
228 | 229 | R.id.personal_section, |
229 | 230 | R.id.location_settings, |
@@ -262,6 +263,7 @@ public class SettingsActivity extends Activity | ||
262 | 263 | DisplaySettings.class.getName(), |
263 | 264 | DeviceInfoSettings.class.getName(), |
264 | 265 | ManageApplications.class.getName(), |
266 | + AppsCompatibility.class.getName(), | |
265 | 267 | ProcessStatsUi.class.getName(), |
266 | 268 | NotificationStation.class.getName(), |
267 | 269 | LocationSettings.class.getName(), |