• R/O
  • HTTP
  • SSH
  • HTTPS

提交

Frequently used words (click to add to your profile)

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

packages/apps/Settings


Commit MetaInfo

修订版0bc1afe225d16a6a947e1ee1a6ac9e935d3540d7 (tree)
时间2015-12-18 18:35:55
作者Chih-Wei Huang <cwhuang@linu...>
CommiterChih-Wei Huang

Log Message

Add an option to control native bridge

更改概述

差异

--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -787,6 +787,21 @@
787787 android:resource="@id/application_settings" />
788788 </activity>
789789
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+
790805 <!-- Keep compatibility with old shortcuts. -->
791806 <activity-alias android:name=".applications.ManageApplications"
792807 android:label="@string/applications_settings"
--- a/res/values-zh-rCN/strings.xml
+++ b/res/values-zh-rCN/strings.xml
@@ -1345,6 +1345,9 @@
13451345 <string name="runningservicedetails_stop_dlg_title" msgid="4253292537154337233">"要停止系统服务吗?"</string>
13461346 <string name="runningservicedetails_stop_dlg_text" product="tablet" msgid="3371302398335665793">"如果停止此服务,您平板电脑上的某些功能也将随之停止工作,并在您将平板电脑关机然后再重新打开后才能使用。"</string>
13471347 <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>
13481351 <string name="language_settings" msgid="5292716747264442359">"语言和输入法"</string>
13491352 <string name="language_keyboard_settings_title" msgid="243220021717425813">"语言和输入法"</string>
13501353 <string name="language_settings_category" msgid="2288258489940617043">"语言设置"</string>
--- a/res/values-zh-rHK/strings.xml
+++ b/res/values-zh-rHK/strings.xml
@@ -1345,6 +1345,9 @@
13451345 <string name="runningservicedetails_stop_dlg_title" msgid="4253292537154337233">"停止系統服務?"</string>
13461346 <string name="runningservicedetails_stop_dlg_text" product="tablet" msgid="3371302398335665793">"如果您停用這項服務,您平板電腦上的某些功能可能會停止正常運作,待您重新開機後才會恢復正常。"</string>
13471347 <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>
13481351 <string name="language_settings" msgid="5292716747264442359">"語言和輸入設定"</string>
13491352 <string name="language_keyboard_settings_title" msgid="243220021717425813">"語言和輸入設定"</string>
13501353 <string name="language_settings_category" msgid="2288258489940617043">"語言設定"</string>
--- a/res/values-zh-rTW/strings.xml
+++ b/res/values-zh-rTW/strings.xml
@@ -1345,6 +1345,9 @@
13451345 <string name="runningservicedetails_stop_dlg_title" msgid="4253292537154337233">"停止系統服務?"</string>
13461346 <string name="runningservicedetails_stop_dlg_text" product="tablet" msgid="3371302398335665793">"如果您停用這項服務,您的平板電腦上的某些功能可能無法正常運作,待您重新開機後才會恢復正常。"</string>
13471347 <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>
13481351 <string name="language_settings" msgid="5292716747264442359">"語言與輸入設定"</string>
13491352 <string name="language_keyboard_settings_title" msgid="243220021717425813">"語言與輸入設定"</string>
13501353 <string name="language_settings_category" msgid="2288258489940617043">"語言設定"</string>
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -3194,6 +3194,11 @@
31943194 features of your phone may stop working correctly until you power it off
31953195 and then on again.</string>
31963196
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+
31973202 <!-- Language Settings --> <skip />
31983203 <!-- Title of setting on main settings screen. This item will take the user to the screen to tweak settings realted to locale and text -->
31993204 <string name="language_settings">Language &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>
--- a/res/xml/dashboard_categories.xml
+++ b/res/xml/dashboard_categories.xml
@@ -124,6 +124,14 @@
124124 android:icon="@drawable/ic_settings_applications"
125125 />
126126
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+
127135 <!-- Manage users -->
128136 <dashboard-tile
129137 android:id="@+id/user_settings"
--- /dev/null
+++ b/src/com/android/settings/AppsCompatibility.java
@@ -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+}
--- a/src/com/android/settings/Settings.java
+++ b/src/com/android/settings/Settings.java
@@ -46,6 +46,7 @@ public class Settings extends SettingsActivity {
4646 public static class DisplaySettingsActivity extends SettingsActivity { /* empty */ }
4747 public static class DeviceInfoSettingsActivity extends SettingsActivity { /* empty */ }
4848 public static class ApplicationSettingsActivity extends SettingsActivity { /* empty */ }
49+ public static class AppsCompatibilityActivity extends SettingsActivity { /* empty */ }
4950 public static class ManageApplicationsActivity extends SettingsActivity { /* empty */ }
5051 public static class AppOpsSummaryActivity extends SettingsActivity {
5152 @Override
--- a/src/com/android/settings/SettingsActivity.java
+++ b/src/com/android/settings/SettingsActivity.java
@@ -224,6 +224,7 @@ public class SettingsActivity extends Activity
224224 R.id.display_settings,
225225 R.id.storage_settings,
226226 R.id.application_settings,
227+ R.id.apps_compatibility_settings,
227228 R.id.battery_settings,
228229 R.id.personal_section,
229230 R.id.location_settings,
@@ -262,6 +263,7 @@ public class SettingsActivity extends Activity
262263 DisplaySettings.class.getName(),
263264 DeviceInfoSettings.class.getName(),
264265 ManageApplications.class.getName(),
266+ AppsCompatibility.class.getName(),
265267 ProcessStatsUi.class.getName(),
266268 NotificationStation.class.getName(),
267269 LocationSettings.class.getName(),