Added HDMI settings for android4.0.4 and android4.0.4hdmi
Recently, the most basic settings of 4412 have been adjusted, and I feel that nothing has been done. Therefore, you cannot add an HDMI configuration.
The following is how to modify the source code of the icool210 Development Board of Guangzhou SDO.
In the beginning, I first added these settings in the settings and then implemented the functions. Here we will talk about the HDMI settings in android2.3. So here we will refer to the Add. First, modify Setting.
View the libhdmi library. First, check the source code path of the hdmi format.
Device/samsung/common/s5p/libhdmi/SecHdmi. cpp
You will find the following code
mHdmiResolutionValueList[0] = 1080960; mHdmiResolutionValueList[1] = 1080950; mHdmiResolutionValueList[2] = 1080930; mHdmiResolutionValueList[3] = 1080160; mHdmiResolutionValueList[4] = 1080150; mHdmiResolutionValueList[5] = 720960; mHdmiResolutionValueList[6] = 720950; mHdmiResolutionValueList[7] = 5769501; mHdmiResolutionValueList[8] = 5769502; mHdmiResolutionValueList[9] = 4809601; mHdmiResolutionValueList[10] = 4809602;
ResolutionValue based on this we generally know that the supported format is below to modify Setting
Source code path packages/apps/Settings/res/values/arrays. xml
Add the following code:
<!-- TV Out settings. --> <string-array name="tv_resolution_entries"><item>1080P_60</item><item>1080P_50</item><item>1080P_30</item><item>1080I_60</item><item>1080I_50</item><item>720P_60</item><item>720P_50</item><item>576P_50_16_9</item><item>576P_50_4_3</item><item>480P_60_16_9</item><item>480P_60_4_3</item> </string-array> <!-- Do not translate. --> <string-array name="tv_resolution_values" translatable="false"><!-- Do not translate. --><item>1080960</item><!-- Do not translate. --><item>1080950</item><!-- Do not translate. --><item>1080930</item><!-- Do not translate. --><item>1080160</item><!-- Do not translate. --><item>1080150</item><!-- Do not translate. --><item>720960</item><!-- Do not translate. --><item>720950</item><!-- Do not translate. --><item>5769501</item><!-- Do not translate. --><item>5769502</item><!-- Do not translate. --><item>4809601</item><!-- Do not translate. --><item>4809602</item> </string-array> <!-- TV Out settings. --> <string-array name="tv_hdcp_entries"><item>Disable</item><item>Enable</item> </string-array> <!-- Do not translate. --><string-array name="tv_hdcp_values" translatable="false"><!-- Do not translate. --><item>0</item><!-- Do not translate. --><item>1</item> </string-array> <!-- TV Out settings. --> <string-array name="tv_mode_entries"><item>HDMI(YCbCr)</item><item>HDMI(RGB)</item><item>DVI</item> </string-array> <!-- Do not translate. --> <string-array name="tv_mode_values" translatable="false"><!-- Do not translate. --><item>0</item><!-- Do not translate. --><item>1</item><!-- Do not translate. --><item>2</item> </string-array>
Source code path packages/apps/Settings/res/values/strings. xml
Add the following content:
<!-- Sound & display settings screen, setting option name to change TV Mode --> <string name="tv_mode">TV Mode</string> <!-- Sound & display settings screen, setting option summary to change TV Mode --> <string name="tv_mode_summary">Choose TV out mode</string> <!-- Sound & display settings screen, setting option name to change TV Resolution --> <string name="tv_resolution">TV Resolution</string> <!-- Sound & display settings screen, setting option summary to change TV Resolution --> <string name="tv_resolution_summary">Choose TV resolution</string> <!-- Sound & display settings screen, setting option name to change TV HDCP --> <string name="tv_hdcp">TV HDCP</string> <!-- Sound & display settings screen, setting option summary to change TV HDCP --> <string name="tv_hdcp_summary">Enable HDMI HDCP</string>
Source code path: packages/apps/Settings/res/xml/display_settings.xml
Add the following content:
<ListPreferenceandroid:key="tv_mode"android:title="@string/tv_mode"android:summary="@string/tv_mode_summary"android:persistent="false"android:entries="@array/tv_mode_entries"android:entryValues="@array/tv_mode_values" /><ListPreferenceandroid:key="tv_resolution"android:title="@string/tv_resolution"android:summary="@string/tv_resolution_summary"android:persistent="false"android:entries="@array/tv_resolution_entries"android:entryValues="@array/tv_resolution_values" /><ListPreferenceandroid:key="tv_hdcp"android:title="@string/tv_hdcp"android:summary="@string/tv_hdcp_summary"android:persistent="false"android:entries="@array/tv_hdcp_entries"android:entryValues="@array/tv_hdcp_values" />
Modify the framework
Source code path: frameworks/base/core/java/android/provider/Settings. java
Add the following content:
/** * The tv out mode. */ public static final String TV_MODE = "tv_mode"; /** * The tv out resolution. */ public static final String TV_RESOLUTION = "tv_resolution"; /** * The tv out mode. */ public static final String TV_HDCP = "tv_hdcp";
Search the SCREEN_OFF_TIMEOUT file.
Find one in the array public static final String [] SETTINGS_TO_BACKUP and add the following
TV_MODE, TV_RESOLUTION, TV_HDCP,
According to my understanding, this should be used to save the data to the database. Then, after the system is started again, the settings can be saved.
Then we added the interface for calling the hdmi functions. Here I copied the 2.3 directly and then modified it.
Add the following file to the directory: frameworks/base/slsi/java/com/slsi/sec/android/HdmiService. java.
The content is as follows:
package com.slsi.sec.android;public class HdmiService{ static { System.loadLibrary("hdmiservice_jni"); } public native void setHdmiCableStatus(int status); public native void setHdmiMode(int mode); public native void setHdmiResolution(int resolution); public native void setHdmiHdcp(int enHdcp); public native void initHdmiService();}Add the following file frameworks/base/slsi/jni/Android. mk
The content is as follows:
LOCAL_PATH:= $(call my-dir)include $(CLEAR_VARS)LOCAL_SRC_FILES:= \ com_slsi_sec_android_HdmiService.cpp \ onload.cppLOCAL_C_INCLUDES += \$(JNI_H_INCLUDE)LOCAL_SHARED_LIBRARIES := \ libcutils \ libandroid_runtime \ libnativehelperifeq ($(S5P_BOARD_USES_HDMI),true)LOCAL_C_INCLUDES += \ device/samsung/common/s5p/libhdmiLOCAL_SHARED_LIBRARIES += libhdmiclientLOCAL_CFLAGS += -DBOARD_USES_HDMIendifLOCAL_PRELINK_MODULE := falseifeq ($(TARGET_SIMULATOR),true)ifeq ($(TARGET_OS),linux)ifeq ($(TARGET_ARCH),x86)LOCAL_LDLIBS += -lpthread -ldl -lrtendifendifendififeq ($(WITH_MALLOC_LEAK_CHECK),true)LOCAL_CFLAGS += -DMALLOC_LEAK_CHECKendifLOCAL_MODULE_TAGS := optional engLOCAL_MODULE:= libhdmiservice_jniinclude $(BUILD_SHARED_LIBRARY)
Add the following file frameworks/base/slsi/jni/com_slsi_sec_android_HdmiService.cpp.
The content is as follows:
#define LOG_TAG "HDMIStatusService"#include "jni.h"#include "JNIHelp.h"#include <cutils/log.h>#if defined(BOARD_USES_HDMI)#include "SecHdmiClient.h"#endifnamespace android {/* * Class: com_slsi_sec_android_HdmiService * Method: setHdmiCableStatus * Signature: (I)V */static void com_slsi_sec_android_HdmiService_setHdmiCableStatus (JNIEnv *env, jobject obj, jint i){ int result = 0;#if defined(BOARD_USES_HDMI) //LOGD("%s HDMI status: %d", __func__, i); (SecHdmiClient::getInstance())->setHdmiCableStatus(i);#else return;#endif //return result;}/* * Class: com_slsi_sec_android_setHdmiMode * Method: setHdmiMode * Signature: (I)V */static void com_slsi_sec_android_HdmiService_setHdmiMode (JNIEnv *env, jobject obj, jint i){ int result = 0;#if defined(BOARD_USES_HDMI) (SecHdmiClient::getInstance())->setHdmiMode(i);#else return;#endif}/* * Class: com_slsi_sec_android_setHdmiResolution * Method: setHdmiResolution * Signature: (I)V */static void com_slsi_sec_android_HdmiService_setHdmiResolution(JNIEnv *env, jobject obj, jint i){ int result = 0;#if defined(BOARD_USES_HDMI) (SecHdmiClient::getInstance())->setHdmiResolution(i);#else return;#endif}/* * Class: com_slsi_sec_android_setHdmiHdcp * Method: setHdmiHdcp * Signature: (I)V */static void com_slsi_sec_android_HdmiService_setHdmiHdcp(JNIEnv *env, jobject obj, jint i){ int result = 0;#if defined(BOARD_USES_HDMI) (SecHdmiClient::getInstance())->setHdmiHdcp(i);#else return;#endif}/* * Class: com_slsi_sec_android_HdmiService * Method: initHdmiService * Signature: ()V */static void com_slsi_sec_android_HdmiService_initHdmiService (JNIEnv *env, jobject obj){#if defined(BOARD_USES_HDMI) LOGI("%s ", __func__); //(SecHdmiClient::getInstance())->init();#else return;#endif //return result;}static JNINativeMethod gMethods[] = { {"setHdmiCableStatus", "(I)V", (void*)com_slsi_sec_android_HdmiService_setHdmiCableStatus}, {"setHdmiMode", "(I)V", (void*)com_slsi_sec_android_HdmiService_setHdmiMode}, {"setHdmiResolution", "(I)V", (void*)com_slsi_sec_android_HdmiService_setHdmiResolution}, {"setHdmiHdcp", "(I)V", (void*)com_slsi_sec_android_HdmiService_setHdmiHdcp}, {"initHdmiService", "()V", (void*)com_slsi_sec_android_HdmiService_initHdmiService},};int register_com_samsung_sec_android_HdmiService(JNIEnv* env){ jclass clazz = env->FindClass("com/slsi/sec/android/HdmiService"); if (clazz == NULL) { LOGE("Can't find com/slsi/sec/android/HdmiService"); return -1; } return jniRegisterNativeMethods(env, "com/slsi/sec/android/HdmiService", gMethods, NELEM(gMethods));}} /* namespace android */Add the following file: frameworks/base/slsi/jni/onload. cpp
The content is as follows:
#include "JNIHelp.h"#include "jni.h"#include "utils/Log.h"#include "utils/misc.h"namespace android {int register_com_samsung_sec_android_HdmiService(JNIEnv* env);};using namespace android;extern "C" jint JNI_OnLoad(JavaVM* vm, void* reserved){ JNIEnv* env = NULL; jint result = -1; if (vm->GetEnv((void**) &env, JNI_VERSION_1_4) != JNI_OK) { LOGE("GetEnv failed!"); return result; } LOG_ASSERT(env, "Could not retrieve the env!"); if(register_com_samsung_sec_android_HdmiService(env) == -1) LOGE("%s register_com_samsung_sec_android_HdmiStatus is failed", __func__); return JNI_VERSION_1_4;}Then modify build/core/pathmap. mk
Add slsi \ In FRAMEWORKS_BASE_SUBDIRS \
We want him to be able to automatically set the parameter when starting.
Modify frameworks/base/services/java/com/android/server/SystemServer. java
Add the following content:
import com.slsi.sec.android.HdmiService;import static android.provider.Settings.System.TV_MODE;import static android.provider.Settings.System.TV_RESOLUTION;import static android.provider.Settings.System.TV_HDCP;
private HdmiService mHdmiService;
Then
mContentResolver = context.getContentResolver();
Add the following code
Slog.i(TAG, "HDMI Setting");mHdmiService = new HdmiService();mHdmiService.setHdmiMode(Settings.System.getInt(mContentResolver, TV_MODE, 0));mHdmiService.setHdmiResolution(Settings.System.getInt(mContentResolver, TV_RESOLUTION, 4809601));mHdmiService.setHdmiHdcp(Settings.System.getInt(mContentResolver, TV_HDCP, 0));
Modify DisplaySetting in Setting.
Source code path: packages/apps/Settings/src/com/android/settings/DisplaySettings. java
Add the following content:
import com.slsi.sec.android.HdmiService;import static android.provider.Settings.System.TV_MODE;import static android.provider.Settings.System.TV_RESOLUTION;import static android.provider.Settings.System.TV_HDCP;
private static final String KEY_TV_MODE = "tv_mode"; private static final String KEY_TV_RESOLUTION = "tv_resolution"; private static final String KEY_TV_HDCP = "tv_hdcp"; private static final int FALLBACK_TV_MODE_VALUE = 0; private static final int FALLBACK_TV_RESOLUTION_VALUE = 4809601; private static final int FALLBACK_TV_HDCP_VALUE = 0; private HdmiService mHdmiService;
Then add the following code in onCreate
ListPreference tvModePreference = (ListPreference) findPreference(KEY_TV_MODE); tvModePreference.setValue(String.valueOf(Settings.System.getInt( resolver, TV_MODE, FALLBACK_TV_MODE_VALUE))); tvModePreference.setOnPreferenceChangeListener(this); ListPreference tvResolutionPreference = (ListPreference) findPreference(KEY_TV_RESOLUTION); tvResolutionPreference.setValue(String.valueOf(Settings.System.getInt( resolver, TV_RESOLUTION, FALLBACK_TV_RESOLUTION_VALUE))); tvResolutionPreference.setOnPreferenceChangeListener(this); ListPreference tvHdcpPreference = (ListPreference) findPreference(KEY_TV_HDCP); tvHdcpPreference.setValue(String.valueOf(Settings.System.getInt( resolver, TV_HDCP, FALLBACK_TV_HDCP_VALUE))); tvHdcpPreference.setOnPreferenceChangeListener(this);mHdmiService = new HdmiService();
Add the following content to the onPreferenceChange function:
if (KEY_TV_MODE.equals(key)) { int value = Integer.parseInt((String) objValue); try { Settings.System.putInt(getContentResolver(), TV_MODE, value); } catch (NumberFormatException e) { Log.e(TAG, "could not persist tv mode setting", e); } mHdmiService.setHdmiMode(value); } if (KEY_TV_RESOLUTION.equals(key)) { int value = Integer.parseInt((String) objValue); try { Settings.System.putInt(getContentResolver(), TV_RESOLUTION, value); } catch (NumberFormatException e) { Log.e(TAG, "could not persist tv resolution setting", e); } mHdmiService.setHdmiResolution(value); }if (KEY_TV_HDCP.equals(key)) { int value = Integer.parseInt((String) objValue); try { Settings.System.putInt(getContentResolver(), TV_HDCP, value); } catch (NumberFormatException e) { Log.e(TAG, "could not persist tv resolution setting", e); } mHdmiService.setHdmiHdcp(value); }Basically, the last step is done.
I uploaded the related patches to my resources. I don't know why I didn't show them. I can download them if needed.
How does Android configure HDMI output?
Thank you very much.
How to configure HDMI
Yes. V1S supports HDMI video and audio output.
See the following settings:
1. Connect your laptop and external display with an HDMI cable
2. Click the sound icon (speaker) in the system notification area, right-click it, and select "playback device"
3. Select the HDMI device you want to connect to and right-click "set as default device". For details, see:
4. After the configuration is successful, you can see the slice:
Check whether the external monitor and laptop are set to mute.
========================================================== ======================================
Some children's shoes say that the laptop temperature of Asus is relatively high. There are two main methods to solve the temperature problem of the notebook, which are used to solve non-quality problems:
As the usage of the notebook increases, the accumulation of internal dust is an inevitable phenomenon. If dust is cleared, the key is:
Click Open Link
The heat sink of the notebook cannot meet the actual needs. In some cases, the heat sink of the notebook cannot meet the heat dissipation of the notebook under high load for a long time, such as playing games for a long time in summer, A large amount of heat in the notebook causes the notebook's own radiator to be insufficient to meet this demand:
Click Open Link
More questions about Asus laptops:
Click Open Link
I hope the above information will help you.