android:value="com.android.settings.applications.ManageDomainUrls" />
</activity>
+ <activity android:name="Settings$AppsCompatibilityActivity"
+ android:label="@string/apps_compatibility_title"
+ android:icon="@drawable/ic_settings_applications"
+ android:taskAffinity="">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.DEFAULT" />
+ </intent-filter>
+ <intent-filter android:priority="6">
+ <action android:name="com.android.settings.action.SETTINGS" />
+ </intent-filter>
+ <meta-data android:name="com.android.settings.category"
+ android:value="com.android.settings.category.device" />
+ <meta-data android:name="com.android.settings.FRAGMENT_CLASS"
+ android:value="com.android.settings.AppsCompatibility" />
+ <meta-data android:name="com.android.settings.PRIMARY_PROFILE_CONTROLLED"
+ android:value="true" />
+ </activity>
+
<activity android:name="Settings$MemorySettingsActivity"
android:label="@string/memory_settings_title"
android:icon="@drawable/ic_settings_memory"
<string name="runningservicedetails_stop_dlg_title" msgid="4253292537154337233">"要停止系统服务吗?"</string>
<string name="runningservicedetails_stop_dlg_text" product="tablet" msgid="3371302398335665793">"如果停止此服务,您平板电脑上的某些功能也将随之停止工作,并在您将平板电脑关机然后再重新打开后才能使用。"</string>
<string name="runningservicedetails_stop_dlg_text" product="default" msgid="3920243762189484756">"如果停止此服务,您手机上的某些功能也将随之停止工作,并在您将手机关机然后再重新打开后才能使用。"</string>
+ <string name="apps_compatibility_title">"应用兼容性"</string>
+ <string name="nativebridge_toggle_title">"兼容模式"</string>
+ <string name="nativebridge_toggle_summary">"可兼容於使用 arm 庫的应用"</string>
<string name="language_settings" msgid="8758655933029560944">"语言和输入法"</string>
<string name="language_keyboard_settings_title" msgid="3709159207482544398">"语言和输入法"</string>
<string name="keyboard_settings_category" msgid="8275523930352487827">"键盘和输入法"</string>
<string name="runningservicedetails_stop_dlg_title" msgid="4253292537154337233">"停止系統服務?"</string>
<string name="runningservicedetails_stop_dlg_text" product="tablet" msgid="3371302398335665793">"如果您停用這項服務,您平板電腦上的某些功能可能會停止正常運作,待您重新開機後才會恢復正常。"</string>
<string name="runningservicedetails_stop_dlg_text" product="default" msgid="3920243762189484756">"如果您停用這項服務,您手機上的某些功能可能會停止正常運作,待您重新開機後才會恢復正常。"</string>
+ <string name="apps_compatibility_title">"應用程式相容性"</string>
+ <string name="nativebridge_toggle_title">"原生相容模式"</string>
+ <string name="nativebridge_toggle_summary">"可相容於使用 arm 原生函式庫的應用程式"</string>
<string name="language_settings" msgid="8758655933029560944">"語言及輸入"</string>
<string name="language_keyboard_settings_title" msgid="3709159207482544398">"語言及輸入"</string>
<string name="keyboard_settings_category" msgid="8275523930352487827">"鍵盤與輸入法"</string>
<string name="system_update_settings_list_item_summary" msgid="3853057315907710747"></string>
<string name="firmware_version" msgid="4801135784886859972">"Android 版本"</string>
<string name="security_patch" msgid="8438384045870296634">"Android 安全性修補程式等級"</string>
+ <string name="device_manufacturer">"製造商"</string>
<string name="model_info" msgid="1952009518045740889">"型號"</string>
<string name="fcc_equipment_id" msgid="149114368246356737">"設備 ID"</string>
<string name="baseband_version" msgid="1848990160763524801">"基頻版本"</string>
<string name="kernel_version" msgid="9192574954196167602">"核心版本"</string>
+ <string name="opengl_version">"Open GL 驅動版本"</string>
<string name="build_number" msgid="3075795840572241758">"版本號碼"</string>
<string name="selinux_status" msgid="6212165375172061672">"SELinux 狀態"</string>
<string name="device_info_not_available" msgid="8062521887156825182">"無法取得"</string>
<string name="runningservicedetails_stop_dlg_title" msgid="4253292537154337233">"停止系統服務?"</string>
<string name="runningservicedetails_stop_dlg_text" product="tablet" msgid="3371302398335665793">"如果您停用這項服務,您的平板電腦上的某些功能可能無法正常運作,待您重新開機後才會恢復正常。"</string>
<string name="runningservicedetails_stop_dlg_text" product="default" msgid="3920243762189484756">"如果您停用這項服務,您的手機上的某些功能可能無法正常運作,待您重新開機後才會恢復正常。"</string>
+ <string name="apps_compatibility_title">"應用程式相容性"</string>
+ <string name="nativebridge_toggle_title">"原生相容模式"</string>
+ <string name="nativebridge_toggle_summary">"可相容於使用 arm 原生函式庫的應用程式"</string>
<string name="language_settings" msgid="8758655933029560944">"語言與輸入設定"</string>
<string name="language_keyboard_settings_title" msgid="3709159207482544398">"語言與輸入設定"</string>
<string name="keyboard_settings_category" msgid="8275523930352487827">"鍵盤與輸入法"</string>
<!-- About phone screen, status item label [CHAR LIMIT=60] -->
<string name="security_patch">Android security patch level</string>
<!-- About phone screen, status item label [CHAR LIMIT=40] -->
+ <string name="device_manufacturer">Manufacturer</string>
+ <!-- About phone screen, status item label [CHAR LIMIT=40] -->
<string name="model_info">Model</string>
<!-- About phone screen, fcc equipment id label [CHAR LIMIT=40] -->
<string name="fcc_equipment_id">Equipment ID</string>
<!-- About phone screen, setting option name [CHAR LIMIT=40] -->
<string name="kernel_version">Kernel version</string>
<!-- About phone screen, setting option name [CHAR LIMIT=40] -->
+ <string name="opengl_version">OpenGL driver version</string>
+ <!-- About phone screen, setting option name [CHAR LIMIT=40] -->
<string name="build_number">Build number</string>
<!-- About phone screen, setting option name [CHAR LIMIT=40] -->
<string name="qgp_version">QGP Version</string>
features of your phone may stop working correctly until you power it off
and then on again.</string>
+ <!-- Apps compatibility settings -->
+ <string name="apps_compatibility_title">Apps compatibility</string>
+ <string name="nativebridge_toggle_title">Enable native bridge</string>
+ <string name="nativebridge_toggle_summary">To support apps with arm native libraries</string>
+
<!-- Languages Settings --> <skip />
<!-- Title of setting on main settings screen. This item will take the user to the screen to tweak settings realted to locale and text -->
<string name="language_settings">Languages & input</string>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2015 The Android-x86 Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
+ android:title="@string/apps_compatibility_title">
+
+ <SwitchPreference android:key="toggle_nb"
+ android:title="@string/nativebridge_toggle_title"
+ android:summary="@string/nativebridge_toggle_summary"
+ android:persistent="false" />
+
+</PreferenceScreen>
android:title="@string/device_name"
android:summary="@string/device_info_default"/>
+ <!-- Device manufacturer -->
+ <Preference android:key="device_manufacturer"
+ style="?android:preferenceInformationStyle"
+ android:title="@string/device_manufacturer"
+ android:summary="@string/device_info_default"/>
+
<!-- Device hardware model -->
<com.android.settings.DividerPreference
android:key="device_model"
settings:allowDividerAbove="true"
settings:allowDividerBelow="true" />
+ <!-- OpenGL Version -->
+ <Preference android:key="opengl_version"
+ style="?android:preferenceInformationStyle"
+ android:title="@string/opengl_version"
+ android:summary="@string/device_info_default"/>
+
<!-- Detailed build version -->
<Preference android:key="build_number"
android:enabled="false"
--- /dev/null
+/*
+ * Copyright (C) 2015 The Android-x86 Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settings;
+
+import android.os.Bundle;
+import android.os.SystemProperties;
+import android.support.v7.preference.Preference;
+import android.support.v14.preference.SwitchPreference;
+import com.android.internal.logging.MetricsProto.MetricsEvent;
+
+public class AppsCompatibility extends SettingsPreferenceFragment {
+
+ private SwitchPreference mNativeBridgePreference;
+
+ private static final String KEY_TOGGLE_NB = "toggle_nb";
+ private static final String PROPERTY_NATIVEBRIDGE = "persist.sys.nativebridge";
+
+ @Override
+ public void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+
+ addPreferencesFromResource(R.xml.apps_compatibility_prefs);
+ mNativeBridgePreference = (SwitchPreference) findPreference(KEY_TOGGLE_NB);
+ mNativeBridgePreference.setChecked(SystemProperties.getBoolean(PROPERTY_NATIVEBRIDGE, false));
+ }
+
+ @Override
+ public boolean onPreferenceTreeClick(Preference preference) {
+ if (preference == mNativeBridgePreference) {
+ SystemProperties.set(PROPERTY_NATIVEBRIDGE, mNativeBridgePreference.isChecked() ? "1" : "0");
+ }
+ return super.onPreferenceTreeClick(preference);
+ }
+
+ @Override
+ protected int getMetricsCategory() {
+ return MetricsEvent.APPLICATION;
+ }
+}
mDark = true;
}
super.onCreate(savedState);
+ getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
mIsKeyguardLocked = savedState == null
? getSystemService(KeyguardManager.class).isKeyguardLocked()
: savedState.getBoolean(STATE_IS_KEYGUARD_LOCKED, false);
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
+
+// Requirements for context creation
+import android.graphics.SurfaceTexture;
+import android.opengl.EGL14;
+import android.opengl.GLES20;
+import android.opengl.GLSurfaceView.EGLConfigChooser;
+import javax.microedition.khronos.egl.EGL10;
+import javax.microedition.khronos.egl.EGLConfig;
+import javax.microedition.khronos.egl.EGLContext;
+import javax.microedition.khronos.egl.EGLDisplay;
+import javax.microedition.khronos.egl.EGLSurface;
+
import android.os.Build;
import android.os.Bundle;
import android.os.PersistableBundle;
private static final String PROPERTY_URL_SAFETYLEGAL = "ro.url.safetylegal";
private static final String PROPERTY_SELINUX_STATUS = "ro.build.selinux";
private static final String KEY_KERNEL_VERSION = "kernel_version";
+ private static final String KEY_OPENGL_VERSION = "opengl_version";
private static final String KEY_BUILD_NUMBER = "build_number";
private static final String KEY_DEVICE_MODEL = "device_model";
private static final String KEY_DEVICE_NAME = "device_name";
private static final String KEY_MOD_VERSION = "mod_version";
private static final String KEY_MOD_BUILD_DATE = "build_date";
private static final String KEY_MOD_API_LEVEL = "mod_api_level";
+ private static final String KEY_DEVICE_MANUFACTURER = "device_manufacturer";
static final int TAPS_TO_BE_A_DEVELOPER = 7;
addPreferencesFromResource(R.xml.device_info_settings);
+ // Create an EGL Context
+ // References:
+ // [1] http://wlog.flatlib.jp/archive/1/2013-12-22
+ // [2] packages/apps/Camera2/src/com/android/camera/SurfaceTextureRenderer.java
+
+ EGL10 egl = (EGL10) EGLContext.getEGL();
+ EGLSurface eglSurface = null;
+ EGLContext eglContext = null;
+
+ // initialize display
+ EGLDisplay eglDisplay = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);
+ if (eglDisplay == EGL10.EGL_NO_DISPLAY) {
+ Log.w(LOG_TAG, "eglGetDisplay failed");
+ }
+ int[] iparam = new int[2];
+ if (!egl.eglInitialize(eglDisplay, iparam)) {
+ Log.w(LOG_TAG, "eglInitialize failed");
+ }
+
+ // choose config
+ EGLConfig[] eglConfigs = new EGLConfig[1];
+ final int[] configSpec = { EGL10.EGL_RENDERABLE_TYPE, EGL14.EGL_OPENGL_ES2_BIT, EGL10.EGL_NONE };
+ if (egl.eglChooseConfig(eglDisplay, configSpec, eglConfigs, 1, iparam) && iparam[0] > 0) {
+ // create surface
+ SurfaceTexture surfaceTexture = new SurfaceTexture(0);
+ eglSurface = egl.eglCreateWindowSurface(
+ eglDisplay, eglConfigs[0], surfaceTexture, null);
+ if (eglSurface == null || eglSurface == EGL10.EGL_NO_SURFACE) {
+ Log.w(LOG_TAG, "eglCreateWindowSurface failed");
+ } else {
+ // create context
+ final int[] attribList = { EGL14.EGL_CONTEXT_CLIENT_VERSION, 2, EGL10.EGL_NONE };
+ eglContext = egl.eglCreateContext(
+ eglDisplay, eglConfigs[0], EGL10.EGL_NO_CONTEXT, attribList);
+ if (eglContext == null || eglContext == EGL10.EGL_NO_CONTEXT) {
+ Log.w(LOG_TAG, "eglCreateContext failed");
+ }
+
+ // bind context
+ if (!egl.eglMakeCurrent(eglDisplay, eglSurface, eglSurface, eglContext)) {
+ Log.w(LOG_TAG, "eglMakeCurrent failed");
+ }
+ }
+ } else {
+ Log.w(LOG_TAG, "eglChooseConfig failed");
+ }
+
+ String opengl_version = "GL Vendor: " + GLES20.glGetString(GLES20.GL_VENDOR) + "\n" +
+ "GL Renderer: " + GLES20.glGetString(GLES20.GL_RENDERER) + "\n" +
+ "GL Version: " + GLES20.glGetString(GLES20.GL_VERSION);
+
+ if (eglContext != null) {
+ // release
+ egl.eglMakeCurrent(eglDisplay, EGL10.EGL_NO_SURFACE, EGL10.EGL_NO_SURFACE, EGL10.EGL_NO_CONTEXT);
+ egl.eglDestroyContext(eglDisplay, eglContext);
+ egl.eglDestroySurface(eglDisplay, eglSurface);
+ }
+
setStringSummary(KEY_FIRMWARE_VERSION, Build.VERSION.RELEASE);
findPreference(KEY_FIRMWARE_VERSION).setEnabled(true);
setValueSummary(KEY_MOD_BUILD_DATE, "ro.build.date");
setExplicitValueSummary(KEY_MOD_API_LEVEL, constructApiLevelString());
findPreference(KEY_MOD_API_LEVEL).setEnabled(true);
+ findPreference(KEY_OPENGL_VERSION).setSummary(opengl_version);
+ setStringSummary(KEY_DEVICE_MANUFACTURER, Build.MANUFACTURER);
if (!SELinux.isSELinuxEnabled()) {
String status = getResources().getString(R.string.selinux_status_disabled);
public static class NightDisplaySettingsActivity extends SettingsActivity { /* empty */ }
public static class DeviceInfoSettingsActivity extends SettingsActivity { /* empty */ }
public static class ApplicationSettingsActivity extends SettingsActivity { /* empty */ }
+ public static class AppsCompatibilityActivity extends SettingsActivity { /* empty */ }
public static class ManageApplicationsActivity extends SettingsActivity { /* empty */ }
public static class ManageAssistActivity extends SettingsActivity { /* empty */ }
public static class AllApplicationsActivity extends SettingsActivity { /* empty */ }
Settings.DisplaySettingsActivity.class.getName(),
Settings.StorageSettingsActivity.class.getName(),
Settings.ManageApplicationsActivity.class.getName(),
+ Settings.AppsCompatibilityActivity.class.getName(),
Settings.PowerUsageSummaryActivity.class.getName(),
Settings.GestureSettingsActivity.class.getName(),
//personal_section
DisplaySettings.class.getName(),
DeviceInfoSettings.class.getName(),
ManageApplications.class.getName(),
+ AppsCompatibility.class.getName(),
NotificationApps.class.getName(),
ManageAssist.class.getName(),
ProcessStatsUi.class.getName(),
}
public void setDisplaySearchMenu(boolean displaySearch) {
- if (displaySearch != mDisplaySearch) {
+ if (Utils.isDeviceProvisioned(this) && displaySearch != mDisplaySearch) {
mDisplaySearch = displaySearch;
invalidateOptionsMenu();
}
}
private boolean buildDialog(String packageName) {
- TelephonyManager tm = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);
+ TelephonyManager tm = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
if (!tm.isSmsCapable()) {
// No phone, no SMS
return false;
} else {
view.findViewById(R.id.default_label).setVisibility(View.GONE);
}
- ImageView imageView = (ImageView)view.findViewById(android.R.id.icon);
+ ImageView imageView = (ImageView) view.findViewById(android.R.id.icon);
imageView.setImageDrawable(item.icon);
return view;
}
} else {
if ((mDevice.getBluetoothClass() != null) && (mDevice.getBluetoothClass().getDeviceClass()
== BluetoothClass.Device.AUDIO_VIDEO_HANDSFREE)) {
- contactSharing.setChecked(true);
- mDevice.setPhonebookAccessPermission(BluetoothDevice.ACCESS_ALLOWED);
+ contactSharing.setChecked(false);
+ mDevice.setPhonebookAccessPermission(BluetoothDevice.ACCESS_REJECTED);
+ EventLog.writeEvent(0x534e4554, "73173182", -1, "");
} else {
contactSharing.setChecked(false);
mDevice.setPhonebookAccessPermission(BluetoothDevice.ACCESS_REJECTED);
} else {
if (mDevice.getBluetoothClass().getDeviceClass()
== BluetoothClass.Device.AUDIO_VIDEO_HANDSFREE) {
- contactSharing.setChecked(false);
- mDevice.setPhonebookAccessPermission(BluetoothDevice.ACCESS_REJECTED);
- EventLog.writeEvent(0x534e4554, "73173182", -1, "");
+ contactSharing.setChecked(true);
+ mDevice.setPhonebookAccessPermission(BluetoothDevice.ACCESS_ALLOWED);
} else {
contactSharing.setChecked(false);
mDevice.setPhonebookAccessPermission(BluetoothDevice.ACCESS_REJECTED);