Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1107625
  • 博文数量: 276
  • 博客积分: 8317
  • 博客等级: 少将
  • 技术积分: 2329
  • 用 户 组: 普通用户
  • 注册时间: 2006-09-12 08:17
个人简介

http://ads.buzzcity.net/adpage.php?partnerid=40096

文章分类

全部博文(276)

文章存档

2013年(1)

2012年(38)

2011年(102)

2010年(85)

2009年(45)

2008年(5)

分类: LINUX

2009-06-05 21:54:03

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
#
#     
#
# 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
最后,编译源代码。
 
运行模拟器,是不是发现调整亮度和关闭屏幕功能是不是又恢复正常了。
 
阅读(2253) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2009-06-19 13:51:19

Do you know how to rebuild lights.goldfish.so?