• 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

Revisiónca4ef66b6239f512612b3cce592d24ff0f773911 (tree)
Tiempo2016-09-23 18:04:30
AutorChih-Wei Huang <cwhuang@linu...>
CommiterChih-Wei Huang

Log Message

Add an option to control native bridge

Cambiar Resumen

Diferencia incremental

--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -1093,6 +1093,25 @@
10931093 android:value="true" />
10941094 </activity>
10951095
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+
10961115 <activity android:name="Settings$MemorySettingsActivity"
10971116 android:label="@string/memory_settings_title"
10981117 android:icon="@drawable/ic_settings_memory"
--- a/res/values-zh-rCN/strings.xml
+++ b/res/values-zh-rCN/strings.xml
@@ -1539,6 +1539,9 @@
15391539 <string name="runningservicedetails_stop_dlg_title" msgid="4253292537154337233">"要停止系统服务吗?"</string>
15401540 <string name="runningservicedetails_stop_dlg_text" product="tablet" msgid="3371302398335665793">"如果停止此服务,您平板电脑上的某些功能也将随之停止工作,并在您将平板电脑关机然后再重新打开后才能使用。"</string>
15411541 <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>
15421545 <string name="language_settings" msgid="8758655933029560944">"语言和输入法"</string>
15431546 <string name="language_keyboard_settings_title" msgid="3709159207482544398">"语言和输入法"</string>
15441547 <string name="keyboard_settings_category" msgid="8275523930352487827">"键盘和输入法"</string>
--- a/res/values-zh-rHK/strings.xml
+++ b/res/values-zh-rHK/strings.xml
@@ -1540,6 +1540,9 @@
15401540 <string name="runningservicedetails_stop_dlg_title" msgid="4253292537154337233">"停止系統服務?"</string>
15411541 <string name="runningservicedetails_stop_dlg_text" product="tablet" msgid="3371302398335665793">"如果您停用這項服務,您平板電腦上的某些功能可能會停止正常運作,待您重新開機後才會恢復正常。"</string>
15421542 <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>
15431546 <string name="language_settings" msgid="8758655933029560944">"語言及輸入"</string>
15441547 <string name="language_keyboard_settings_title" msgid="3709159207482544398">"語言及輸入"</string>
15451548 <string name="keyboard_settings_category" msgid="8275523930352487827">"鍵盤與輸入法"</string>
--- a/res/values-zh-rTW/strings.xml
+++ b/res/values-zh-rTW/strings.xml
@@ -1541,6 +1541,9 @@
15411541 <string name="runningservicedetails_stop_dlg_title" msgid="4253292537154337233">"停止系統服務?"</string>
15421542 <string name="runningservicedetails_stop_dlg_text" product="tablet" msgid="3371302398335665793">"如果您停用這項服務,您的平板電腦上的某些功能可能無法正常運作,待您重新開機後才會恢復正常。"</string>
15431543 <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>
15441547 <string name="language_settings" msgid="8758655933029560944">"語言與輸入設定"</string>
15451548 <string name="language_keyboard_settings_title" msgid="3709159207482544398">"語言與輸入設定"</string>
15461549 <string name="keyboard_settings_category" msgid="8275523930352487827">"鍵盤與輸入法"</string>
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -3602,6 +3602,11 @@
36023602 features of your phone may stop working correctly until you power it off
36033603 and then on again.</string>
36043604
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+
36053610 <!-- Languages Settings --> <skip />
36063611 <!-- Title of setting on main settings screen. This item will take the user to the screen to tweak settings realted to locale and text -->
36073612 <string name="language_settings">Languages&#160;&amp; input</string>
--- /dev/null
+++ b/res/xml/apps_compatibility_prefs.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/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>
--- /dev/null
+++ b/src/com/android/settings/AppsCompatibility.java
@@ -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+}
--- a/src/com/android/settings/Settings.java
+++ b/src/com/android/settings/Settings.java
@@ -52,6 +52,7 @@ public class Settings extends SettingsActivity {
5252 public static class DisplaySettingsActivity extends SettingsActivity { /* empty */ }
5353 public static class DeviceInfoSettingsActivity extends SettingsActivity { /* empty */ }
5454 public static class ApplicationSettingsActivity extends SettingsActivity { /* empty */ }
55+ public static class AppsCompatibilityActivity extends SettingsActivity { /* empty */ }
5556 public static class ManageApplicationsActivity extends SettingsActivity { /* empty */ }
5657 public static class ManageAssistActivity extends SettingsActivity { /* empty */ }
5758 public static class AllApplicationsActivity extends SettingsActivity { /* empty */ }
--- a/src/com/android/settings/SettingsActivity.java
+++ b/src/com/android/settings/SettingsActivity.java
@@ -239,6 +239,7 @@ public class SettingsActivity extends SettingsDrawerActivity
239239 Settings.DisplaySettingsActivity.class.getName(),
240240 Settings.StorageSettingsActivity.class.getName(),
241241 Settings.ManageApplicationsActivity.class.getName(),
242+ Settings.AppsCompatibilityActivity.class.getName(),
242243 Settings.PowerUsageSummaryActivity.class.getName(),
243244 //personal_section
244245 Settings.LocationSettingsActivity.class.getName(),
@@ -275,6 +276,7 @@ public class SettingsActivity extends SettingsDrawerActivity
275276 DisplaySettings.class.getName(),
276277 DeviceInfoSettings.class.getName(),
277278 ManageApplications.class.getName(),
279+ AppsCompatibility.class.getName(),
278280 NotificationApps.class.getName(),
279281 ManageAssist.class.getName(),
280282 ProcessStatsUi.class.getName(),