免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2044 | 回复: 0
打印 上一主题 下一主题

android模拟器上如何使调整亮度有效 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-06-05 21:54 |只看该作者 |倒序浏览
android1.1及以前在模拟器上调整亮度和关闭屏幕没有问题,但自从更新到了1.5版本,这个功能就有问题了,原因是模拟器的模拟机制作了相应的调整。解决方案如下:
首先,利用adb将lights.goldfish.so从sdk中拉出,因为sdk中这个功能可以正常运行,但自己从源代码编译出来的image因为缺乏这个文件就有问题了;
接着,将lights.goldfish.so拷贝至源代码某一目录下;
然后,在这个目录下编写如下makefile:
# Copyright (C) 2009 The Android 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.
LOCAL_PATH := $(call my-dir)
ifneq ($(TARGET_PRODUCT),sim)
# HAL module implemenation, not prelinked and stored in
# hw/..so
include $(CLEAR_VARS)
LOCAL_PRELINK_MODULE := false
LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
LOCAL_MODULE := lights.goldfish.so
LOCAL_MODULE_TAGS := debug
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
LOCAL_SRC_FILES := $(LOCAL_MODULE)
include $(BUILD_PREBUILT)
endif
最后,编译源代码。

运行模拟器,是不是发现调整亮度和关闭屏幕功能是不是又恢复正常了。



本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/23800/showart_1956814.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP