packages/apps/Settings
Revision | ca4ef66b6239f512612b3cce592d24ff0f773911 (tree) |
---|---|
Time | 2016-09-23 18:04:30 |
Author | Chih-Wei Huang <cwhuang@linu...> |
Commiter | Chih-Wei Huang |
Add an option to control native bridge
@@ -1093,6 +1093,25 @@ | ||
1093 | 1093 | android:value="true" /> |
1094 | 1094 | </activity> |
1095 | 1095 | |
1096 | + <activity android:name="Settings$AppsCompatibilityActivity" | |
1097 | + android:label="@string/apps_compatibility_title" | |
1098 | + android:icon="@drawable/ic_settings_applications" | |
1099 | + android:taskAffinity=""> | |
1100 | + <intent-filter> | |
1101 | + <action android:name="android.intent.action.MAIN" /> | |
1102 | + <category android:name="android.intent.category.DEFAULT" /> | |
1103 | + </intent-filter> | |
1104 | + <intent-filter android:priority="6"> | |
1105 | + <action android:name="com.android.settings.action.SETTINGS" /> | |
1106 | + </intent-filter> | |
1107 | + <meta-data android:name="com.android.settings.category" | |
1108 | + android:value="com.android.settings.category.device" /> | |
1109 | + <meta-data android:name="com.android.settings.FRAGMENT_CLASS" | |
1110 | + android:value="com.android.settings.AppsCompatibility" /> | |
1111 | + <meta-data android:name="com.android.settings.PRIMARY_PROFILE_CONTROLLED" | |
1112 | + android:value="true" /> | |
1113 | + </activity> | |
1114 | + | |
1096 | 1115 | <activity android:name="Settings$MemorySettingsActivity" |
1097 | 1116 | android:label="@string/memory_settings_title" |
1098 | 1117 | android:icon="@drawable/ic_settings_memory" |
@@ -1539,6 +1539,9 @@ | ||
1539 | 1539 | <string name="runningservicedetails_stop_dlg_title" msgid="4253292537154337233">"要停止系统服务吗?"</string> |
1540 | 1540 | <string name="runningservicedetails_stop_dlg_text" product="tablet" msgid="3371302398335665793">"如果停止此服务,您平板电脑上的某些功能也将随之停止工作,并在您将平板电脑关机然后再重新打开后才能使用。"</string> |
1541 | 1541 | <string name="runningservicedetails_stop_dlg_text" product="default" msgid="3920243762189484756">"如果停止此服务,您手机上的某些功能也将随之停止工作,并在您将手机关机然后再重新打开后才能使用。"</string> |
1542 | + <string name="apps_compatibility_title">"应用兼容性"</string> | |
1543 | + <string name="nativebridge_toggle_title">"兼容模式"</string> | |
1544 | + <string name="nativebridge_toggle_summary">"可兼容於使用 arm 庫的应用"</string> | |
1542 | 1545 | <string name="language_settings" msgid="8758655933029560944">"语言和输入法"</string> |
1543 | 1546 | <string name="language_keyboard_settings_title" msgid="3709159207482544398">"语言和输入法"</string> |
1544 | 1547 | <string name="keyboard_settings_category" msgid="8275523930352487827">"键盘和输入法"</string> |
@@ -1540,6 +1540,9 @@ | ||
1540 | 1540 | <string name="runningservicedetails_stop_dlg_title" msgid="4253292537154337233">"停止系統服務?"</string> |
1541 | 1541 | <string name="runningservicedetails_stop_dlg_text" product="tablet" msgid="3371302398335665793">"如果您停用這項服務,您平板電腦上的某些功能可能會停止正常運作,待您重新開機後才會恢復正常。"</string> |
1542 | 1542 | <string name="runningservicedetails_stop_dlg_text" product="default" msgid="3920243762189484756">"如果您停用這項服務,您手機上的某些功能可能會停止正常運作,待您重新開機後才會恢復正常。"</string> |
1543 | + <string name="apps_compatibility_title">"應用程式相容性"</string> | |
1544 | + <string name="nativebridge_toggle_title">"原生相容模式"</string> | |
1545 | + <string name="nativebridge_toggle_summary">"可相容於使用 arm 原生函式庫的應用程式"</string> | |
1543 | 1546 | <string name="language_settings" msgid="8758655933029560944">"語言及輸入"</string> |
1544 | 1547 | <string name="language_keyboard_settings_title" msgid="3709159207482544398">"語言及輸入"</string> |
1545 | 1548 | <string name="keyboard_settings_category" msgid="8275523930352487827">"鍵盤與輸入法"</string> |
@@ -1541,6 +1541,9 @@ | ||
1541 | 1541 | <string name="runningservicedetails_stop_dlg_title" msgid="4253292537154337233">"停止系統服務?"</string> |
1542 | 1542 | <string name="runningservicedetails_stop_dlg_text" product="tablet" msgid="3371302398335665793">"如果您停用這項服務,您的平板電腦上的某些功能可能無法正常運作,待您重新開機後才會恢復正常。"</string> |
1543 | 1543 | <string name="runningservicedetails_stop_dlg_text" product="default" msgid="3920243762189484756">"如果您停用這項服務,您的手機上的某些功能可能無法正常運作,待您重新開機後才會恢復正常。"</string> |
1544 | + <string name="apps_compatibility_title">"應用程式相容性"</string> | |
1545 | + <string name="nativebridge_toggle_title">"原生相容模式"</string> | |
1546 | + <string name="nativebridge_toggle_summary">"可相容於使用 arm 原生函式庫的應用程式"</string> | |
1544 | 1547 | <string name="language_settings" msgid="8758655933029560944">"語言與輸入設定"</string> |
1545 | 1548 | <string name="language_keyboard_settings_title" msgid="3709159207482544398">"語言與輸入設定"</string> |
1546 | 1549 | <string name="keyboard_settings_category" msgid="8275523930352487827">"鍵盤與輸入法"</string> |
@@ -3602,6 +3602,11 @@ | ||
3602 | 3602 | features of your phone may stop working correctly until you power it off |
3603 | 3603 | and then on again.</string> |
3604 | 3604 | |
3605 | + <!-- Apps compatibility settings --> | |
3606 | + <string name="apps_compatibility_title">Apps compatibility</string> | |
3607 | + <string name="nativebridge_toggle_title">Enable native bridge</string> | |
3608 | + <string name="nativebridge_toggle_summary">To support apps with arm native libraries</string> | |
3609 | + | |
3605 | 3610 | <!-- Languages Settings --> <skip /> |
3606 | 3611 | <!-- Title of setting on main settings screen. This item will take the user to the screen to tweak settings realted to locale and text --> |
3607 | 3612 | <string name="language_settings">Languages & 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> |
@@ -0,0 +1,53 @@ | ||
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.support.v7.preference.Preference; | |
22 | +import android.support.v14.preference.SwitchPreference; | |
23 | +import com.android.internal.logging.MetricsProto.MetricsEvent; | |
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(Preference preference) { | |
43 | + if (preference == mNativeBridgePreference) { | |
44 | + SystemProperties.set(PROPERTY_NATIVEBRIDGE, mNativeBridgePreference.isChecked() ? "1" : "0"); | |
45 | + } | |
46 | + return super.onPreferenceTreeClick(preference); | |
47 | + } | |
48 | + | |
49 | + @Override | |
50 | + protected int getMetricsCategory() { | |
51 | + return MetricsEvent.APPLICATION; | |
52 | + } | |
53 | +} |
@@ -52,6 +52,7 @@ public class Settings extends SettingsActivity { | ||
52 | 52 | public static class DisplaySettingsActivity extends SettingsActivity { /* empty */ } |
53 | 53 | public static class DeviceInfoSettingsActivity extends SettingsActivity { /* empty */ } |
54 | 54 | public static class ApplicationSettingsActivity extends SettingsActivity { /* empty */ } |
55 | + public static class AppsCompatibilityActivity extends SettingsActivity { /* empty */ } | |
55 | 56 | public static class ManageApplicationsActivity extends SettingsActivity { /* empty */ } |
56 | 57 | public static class ManageAssistActivity extends SettingsActivity { /* empty */ } |
57 | 58 | public static class AllApplicationsActivity extends SettingsActivity { /* empty */ } |
@@ -239,6 +239,7 @@ public class SettingsActivity extends SettingsDrawerActivity | ||
239 | 239 | Settings.DisplaySettingsActivity.class.getName(), |
240 | 240 | Settings.StorageSettingsActivity.class.getName(), |
241 | 241 | Settings.ManageApplicationsActivity.class.getName(), |
242 | + Settings.AppsCompatibilityActivity.class.getName(), | |
242 | 243 | Settings.PowerUsageSummaryActivity.class.getName(), |
243 | 244 | //personal_section |
244 | 245 | Settings.LocationSettingsActivity.class.getName(), |
@@ -275,6 +276,7 @@ public class SettingsActivity extends SettingsDrawerActivity | ||
275 | 276 | DisplaySettings.class.getName(), |
276 | 277 | DeviceInfoSettings.class.getName(), |
277 | 278 | ManageApplications.class.getName(), |
279 | + AppsCompatibility.class.getName(), | |
278 | 280 | NotificationApps.class.getName(), |
279 | 281 | ManageAssist.class.getName(), |
280 | 282 | ProcessStatsUi.class.getName(), |