Skip to content

Commit eb224e9

Browse files
committedNov 30, 2010
Large amount of build and configuration changes for all devices
Initial configuration of iPhone and iPod specific package targets (Removes crap from iPT builds) Switched to Gallery instead of Gallery3D for now Added iPhone 3GS target (Config is borrowed from 3G so will need work)
1 parent a77f178 commit eb224e9

21 files changed

+2276
-58
lines changed
 

‎Android.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
include $(call all-subdir-makefiles)
1+
include $(call all-subdir-makefiles)

‎common/common.mk

+37-43
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,37 @@
1-
LOCAL_PATH := $(dir $(lastword $(MAKEFILE_LIST)))
2-
3-
ifeq ($(TARGET_BUILD_TYPE),debug)
4-
$(call inherit-product, $(SRC_TARGET_DIR)/product/sdk.mk)
5-
else
6-
$(call inherit-product, $(SRC_TARGET_DIR)/product/generic.mk)
7-
endif
8-
9-
PRODUCT_MANUFACTURER := apple
10-
11-
PRODUCT_POLICY := android.policy_phone
12-
13-
LIBERTAS := $(LOCAL_PATH)libertas/
14-
15-
PRODUCT_PACKAGES += \
16-
ADWLauncher \
17-
FileManager \
18-
Superuser
19-
20-
PRODUCT_PROPERTY_OVERRIDES += \
21-
ro.firmware_dir1=/host/firmware
22-
23-
PRODUCT_COPY_FILES += \
24-
$(LIBERTAS)LICENCE.libertas:system/etc/firmware/LICENCE.libertas \
25-
$(LIBERTAS)sd8686.bin:system/etc/firmware/sd8686.bin \
26-
$(LIBERTAS)sd8686_helper.bin:system/etc/firmware/sd8686_helper.bin \
27-
$(LIBERTAS)LICENCE.libertas:root/lib/firmware/LICENCE.libertas \
28-
$(LIBERTAS)sd8686.bin:root/lib/firmware/sd8686.bin \
29-
$(LOCAL_PATH)wpa_supplicant.conf:system/etc/wifi/wpa_supplicant.conf \
30-
$(COMMON)init.rc:root/init.apple.rc \
31-
frameworks/base/data/etc/android.hardware.camera.flash-autofocus.xml:system/etc/permissions/android.hardware.camera.flash-autofocus.xml \
32-
frameworks/base/data/etc/android.hardware.sensor.light.xml:system/etc/permissions/android.hardware.sensor.light.xml \
33-
frameworks/base/data/etc/android.hardware.sensor.proximity.xml:system/etc/permissions/android.hardware.sensor.proximity.xml \
34-
frameworks/base/data/etc/android.hardware.telephony.gsm.xml:system/etc/permissions/android.hardware.telephony.gsm.xml \
35-
frameworks/base/data/etc/android.hardware.touchscreen.multitouch.xml:system/etc/permissions/android.hardware.touchscreen.multitouch.xml
36-
37-
PRODUCT_BRAND := apple
38-
PRODUCT_NAME := apple
39-
PRODUCT_BOARD := apple
40-
41-
PRODUCT_PACKAGE_OVERLAYS += vendor/apple/overlay/common
42-
43-
include frameworks/base/data/sounds/AudioPackage4.mk
1+
LOCAL_PATH := $(dir $(lastword $(MAKEFILE_LIST)))
2+
3+
PRODUCT_MANUFACTURER := apple
4+
5+
PRODUCT_POLICY := android.policy_phone
6+
7+
LIBERTAS := $(LOCAL_PATH)libertas/
8+
9+
PRODUCT_PACKAGES += \
10+
ADWLauncher \
11+
FileManager \
12+
Superuser
13+
14+
PRODUCT_PROPERTY_OVERRIDES += \
15+
ro.firmware_dir1=/host/firmware
16+
17+
PRODUCT_COPY_FILES += \
18+
$(LIBERTAS)LICENCE.libertas:system/etc/firmware/LICENCE.libertas \
19+
$(LIBERTAS)sd8686.bin:system/etc/firmware/sd8686.bin \
20+
$(LIBERTAS)sd8686_helper.bin:system/etc/firmware/sd8686_helper.bin \
21+
$(LIBERTAS)LICENCE.libertas:root/lib/firmware/LICENCE.libertas \
22+
$(LIBERTAS)sd8686.bin:root/lib/firmware/sd8686.bin \
23+
$(LOCAL_PATH)wpa_supplicant.conf:system/etc/wifi/wpa_supplicant.conf \
24+
$(COMMON)init.rc:root/init.apple.rc \
25+
frameworks/base/data/etc/android.hardware.camera.flash-autofocus.xml:system/etc/permissions/android.hardware.camera.flash-autofocus.xml \
26+
frameworks/base/data/etc/android.hardware.sensor.light.xml:system/etc/permissions/android.hardware.sensor.light.xml \
27+
frameworks/base/data/etc/android.hardware.sensor.proximity.xml:system/etc/permissions/android.hardware.sensor.proximity.xml \
28+
frameworks/base/data/etc/android.hardware.telephony.gsm.xml:system/etc/permissions/android.hardware.telephony.gsm.xml \
29+
frameworks/base/data/etc/android.hardware.touchscreen.multitouch.xml:system/etc/permissions/android.hardware.touchscreen.multitouch.xml
30+
31+
PRODUCT_BRAND := apple
32+
PRODUCT_NAME := apple
33+
PRODUCT_BOARD := apple
34+
35+
PRODUCT_PACKAGE_OVERLAYS += vendor/apple/overlay/common
36+
37+
include frameworks/base/data/sounds/AudioPackage4.mk

‎common/iPhone.mk

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#
2+
# Copyright (C) 2007 The Android 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+
PRODUCT_PACKAGES := \
18+
AccountAndSyncSettings \
19+
CarHome \
20+
DeskClock \
21+
AlarmProvider \
22+
Bluetooth \
23+
Calculator \
24+
Calendar \
25+
Camera \
26+
CertInstaller \
27+
DrmProvider \
28+
Email \
29+
Gallery \
30+
LatinIME \
31+
Launcher2 \
32+
Mms \
33+
Music \
34+
Provision \
35+
Protips \
36+
QuickSearchBox \
37+
Settings \
38+
Sync \
39+
Updater \
40+
CalendarProvider \
41+
SyncProvider
42+
43+
$(call inherit-product, $(SRC_TARGET_DIR)/product/core.mk)

‎common/iPod.mk

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#
2+
# Copyright (C) 2007 The Android 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+
PRODUCT_PACKAGES := \
18+
AccountAndSyncSettings \
19+
ApplicationsProvider \
20+
AlarmProvider \
21+
Browser \
22+
Bluetooth \
23+
Bugreport \
24+
Calculator \
25+
Calendar \
26+
CalendarProvider \
27+
Camera \
28+
CertInstaller \
29+
Contacts \
30+
ContactsProvider \
31+
DefaultContainerService \
32+
DeskClock \
33+
DownloadProvider \
34+
DrmProvider \
35+
Email \
36+
framework-res \
37+
Gallery \
38+
Home \
39+
HTMLViewer \
40+
LatinIME \
41+
Launcher2 \
42+
MediaProvider \
43+
Music \
44+
PicoTts \
45+
Provision \
46+
Protips \
47+
QuickSearchBox \
48+
Settings \
49+
SettingsProvider \
50+
Sync \
51+
SyncProvider \
52+
TtsService \
53+
VpnServices \
54+
UserDictionaryProvider \
55+
PackageInstaller \
56+
Updater
57+
58+
PRODUCT_PROPERTY_OVERRIDES += \
59+
media.stagefright.enable-player=true \
60+
media.stagefright.enable-meta=true \
61+
media.stagefright.enable-scan=true \
62+
media.stagefright.enable-http=true

‎iPhone2G/iPhone2G.mk

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
LOCAL_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
22
COMMON := $(subst iPhone2G,common,$(LOCAL_DIR))
33

4+
ifeq ($(TARGET_BUILD_TYPE),debug)
5+
$(call inherit-product, $(SRC_TARGET_DIR)/product/sdk.mk)
6+
else
7+
$(call inherit-product, $(COMMON)/iPhone.mk)
8+
endif
9+
410
$(call inherit-product, $(COMMON)/common.mk)
511

612
PRODUCT_NAME := iPhone2G

‎iPhone3G/iPhone3G.mk

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
LOCAL_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
22
COMMON := $(subst iPhone3G,common,$(LOCAL_DIR))
33

4+
ifeq ($(TARGET_BUILD_TYPE),debug)
5+
$(call inherit-product, $(SRC_TARGET_DIR)/product/sdk.mk)
6+
else
7+
$(call inherit-product, $(COMMON)/iPhone.mk)
8+
endif
9+
410
$(call inherit-product, $(COMMON)/common.mk)
511

612
PRODUCT_NAME := iPhone3G

‎iPhone3GS/AndroidBoard.mk

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
LOCAL_PATH := $(call my-dir)
2+
COMMON := $(dir $(LOCAL_PATH))common
3+
4+
include $(CLEAR_VARS)
5+
LOCAL_SRC_FILES := gpio-keys.kcm
6+
include $(BUILD_KEY_CHAR_MAP)
7+
8+
SUBDIRS := \
9+
$(COMMON)/libril/Android.mk \
10+
$(LOCAL_PATH)/libsensors/Android.mk \
11+
$(COMMON)/AndroidBoardCommon.mk
12+
13+
include $(SUBDIRS)

‎iPhone3GS/BoardConfig.mk

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
LOCAL_PATH := $(dir $(lastword $(MAKEFILE_LIST)))
2+
3+
USE_CAMERA_STUB := true
4+
5+
BOARD_WPA_SUPPLICANT_DRIVER := WEXT
6+
BOARD_WPA_SUPPLICANT_PRIVATE_LIB :=
7+
#WPA_SUPPLICANT_VERSION := VER_0_6_X
8+
#BOARD_WLAN_DEVICE := libertas_sdio
9+
#WIFI_DRIVER_MODULE_PATH := "/system/lib/modules/libertas_sdio.ko"
10+
#WIFI_DRIVER_MODULE_ARG := ""
11+
#WIFI_DRIVER_MODULE_NAME := "libertas_sdio"
12+
13+
COMMON := $(LOCAL_PATH)/../common
14+
include $(COMMON)/BoardConfigCommon.mk

‎iPhone3GS/asound.conf

+364
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,364 @@
1+
ctl.AndroidOut {
2+
type hw
3+
}
4+
5+
ctl.AndroidIn {
6+
type hw
7+
}
8+
9+
pcm.AndroidPlayback_Speaker {
10+
type hooks
11+
slave.pcm default
12+
hooks.0 {
13+
type ctl_elems
14+
hook_args [
15+
{
16+
name 'RONMIX RONMIX Inverted ROP Switch'
17+
value false
18+
lock true
19+
}
20+
{
21+
name 'ROPMIX ROPMIX Left Mic Bypass Switch'
22+
value false
23+
lock true
24+
}
25+
{
26+
name 'OUT4MIX OUT4MIX Right Out PGA Switch'
27+
value false
28+
lock true
29+
}
30+
{
31+
name 'OUT4MIX OUT4MIX RIN4/RXP Bypass Switch'
32+
value false
33+
lock true
34+
}
35+
{
36+
name 'OUT3MIX OUT3MIX LIN4/RXN Bypass Switch'
37+
value false
38+
lock true
39+
}
40+
{
41+
name 'OUT3MIX OUT3MIX Left Out PGA Switch'
42+
value false
43+
lock true
44+
}
45+
{
46+
name 'LIN12 PGA LIN1 Switch'
47+
value false
48+
lock true
49+
}
50+
{
51+
name 'LIN12 PGA LIN2 Switch'
52+
value false
53+
lock true
54+
}
55+
{
56+
name 'LOMIX LOMIX Left DAC Switch'
57+
value 'off'
58+
lock true
59+
}
60+
{
61+
name 'ROMIX ROMIX Right DAC Switch'
62+
value 'off'
63+
lock true
64+
}
65+
{
66+
name 'SPKMIX SPKMIX Left DAC Switch'
67+
value 'on'
68+
lock true
69+
}
70+
{
71+
name 'SPKMIX SPKMIX Right DAC Switch'
72+
value 'on'
73+
lock true
74+
}
75+
{
76+
name 'Speaker Output Attenuation Volume'
77+
value 0
78+
lock true
79+
}
80+
{
81+
name 'RON Mute Switch'
82+
value true
83+
lock true
84+
}
85+
{
86+
name 'ROP Mute Switch'
87+
value true
88+
lock true
89+
}
90+
{
91+
name 'OUT3 Mute Switch'
92+
value true
93+
lock true
94+
}
95+
{
96+
name 'OUT4 Mute Switch'
97+
value true
98+
lock true
99+
}
100+
{
101+
name 'LIN12 Mute Switch'
102+
value true
103+
lock true
104+
}
105+
{
106+
name 'Mic Enable Switch'
107+
value off
108+
lock true
109+
}
110+
{
111+
name 'Mic Short Circuit Current Detect Threshold'
112+
value 0
113+
preserve true
114+
}
115+
{
116+
name 'Headphone Volume'
117+
value [0 0]
118+
preserve true
119+
}
120+
]
121+
}
122+
}
123+
124+
pcm.AndroidPlayback_Headset {
125+
type hooks
126+
slave.pcm default
127+
hooks.0 {
128+
type ctl_elems
129+
hook_args [
130+
{
131+
name 'RONMIX RONMIX Inverted ROP Switch'
132+
value false
133+
lock true
134+
}
135+
{
136+
name 'ROPMIX ROPMIX Left Mic Bypass Switch'
137+
value false
138+
lock true
139+
}
140+
{
141+
name 'OUT4MIX OUT4MIX Right Out PGA Switch'
142+
value false
143+
lock true
144+
}
145+
{
146+
name 'OUT4MIX OUT4MIX RIN4/RXP Bypass Switch'
147+
value false
148+
lock true
149+
}
150+
{
151+
name 'OUT3MIX OUT3MIX LIN4/RXN Bypass Switch'
152+
value false
153+
lock true
154+
}
155+
{
156+
name 'OUT3MIX OUT3MIX Left Out PGA Switch'
157+
value false
158+
lock true
159+
}
160+
{
161+
name 'LIN12 PGA LIN1 Switch'
162+
value false
163+
lock true
164+
}
165+
{
166+
name 'LIN12 PGA LIN2 Switch'
167+
value false
168+
lock true
169+
}
170+
{
171+
name 'SPKMIX SPKMIX Left DAC Switch'
172+
value 'off'
173+
lock true
174+
}
175+
{
176+
name 'SPKMIX SPKMIX Right DAC Switch'
177+
value 'off'
178+
lock true
179+
}
180+
{
181+
name 'LOMIX LOMIX Left DAC Switch'
182+
value 'on'
183+
lock true
184+
}
185+
{
186+
name 'ROMIX ROMIX Right DAC Switch'
187+
value 'on'
188+
lock true
189+
}
190+
{
191+
name 'Speaker Output Attenuation Volume'
192+
value 3
193+
lock true
194+
}
195+
{
196+
name 'RON Mute Switch'
197+
value true
198+
lock true
199+
}
200+
{
201+
name 'ROP Mute Switch'
202+
value true
203+
lock true
204+
}
205+
{
206+
name 'OUT3 Mute Switch'
207+
value true
208+
lock true
209+
}
210+
{
211+
name 'OUT4 Mute Switch'
212+
value true
213+
lock true
214+
}
215+
{
216+
name 'LIN12 Mute Switch'
217+
value true
218+
lock true
219+
}
220+
{
221+
name 'Mic Enable Switch'
222+
value off
223+
lock true
224+
}
225+
{
226+
name 'Mic Short Circuit Current Detect Threshold'
227+
value 0
228+
preserve true
229+
}
230+
{
231+
name 'Headphone Volume'
232+
value [127 127]
233+
preserve true
234+
}
235+
]
236+
}
237+
}
238+
239+
pcm.AndroidPlayback_Earpiece {
240+
type hooks
241+
slave.pcm default
242+
hooks.0 {
243+
type ctl_elems
244+
hook_args [
245+
{
246+
name 'SPKMIX SPKMIX Left DAC Switch'
247+
value 'off'
248+
lock true
249+
}
250+
{
251+
name 'SPKMIX SPKMIX Right DAC Switch'
252+
value 'off'
253+
lock true
254+
}
255+
{
256+
name 'LOMIX LOMIX Left DAC Switch'
257+
value 'off'
258+
lock true
259+
}
260+
{
261+
name 'ROMIX ROMIX Right DAC Switch'
262+
value 'off'
263+
lock true
264+
}
265+
{
266+
name 'Speaker Output Attenuation Volume'
267+
value 3
268+
lock true
269+
}
270+
{
271+
name 'RON Mute Switch'
272+
value false
273+
lock true
274+
}
275+
{
276+
name 'ROP Mute Switch'
277+
value false
278+
lock true
279+
}
280+
{
281+
name 'OUT3 Mute Switch'
282+
value false
283+
lock true
284+
}
285+
{
286+
name 'OUT4 Mute Switch'
287+
value false
288+
lock true
289+
}
290+
{
291+
name 'LIN12 Mute Switch'
292+
value false
293+
lock true
294+
}
295+
{
296+
name 'RONMIX RONMIX Inverted ROP Switch'
297+
value true
298+
lock true
299+
}
300+
{
301+
name 'ROPMIX ROPMIX Left Mic Bypass Switch'
302+
value true
303+
lock true
304+
}
305+
{
306+
name 'OUT4MIX OUT4MIX Right Out PGA Switch'
307+
value true
308+
lock true
309+
}
310+
{
311+
name 'OUT4MIX OUT4MIX RIN4/RXP Bypass Switch'
312+
value true
313+
lock true
314+
}
315+
{
316+
name 'OUT3MIX OUT3MIX LIN4/RXN Bypass Switch'
317+
value true
318+
lock true
319+
}
320+
{
321+
name 'OUT3MIX OUT3MIX Left Out PGA Switch'
322+
value true
323+
lock true
324+
}
325+
{
326+
name 'LIN12 PGA LIN1 Switch'
327+
value true
328+
lock true
329+
}
330+
{
331+
name 'LIN12 PGA LIN2 Switch'
332+
value true
333+
lock true
334+
}
335+
{
336+
name 'Mic Enable Switch'
337+
value on
338+
lock true
339+
}
340+
{
341+
name 'LIN12 Volume'
342+
value 20
343+
preserve true
344+
}
345+
{
346+
name 'Mic Short Circuit Current Detect Threshold'
347+
value 1
348+
preserve true
349+
}
350+
{
351+
name 'Headphone Volume'
352+
value [0 0]
353+
preserve true
354+
}
355+
]
356+
}
357+
}
358+
359+
pcm.AndroidRecord {
360+
type hw
361+
card 0
362+
device 0
363+
}
364+

‎iPhone3GS/asound.state

+1,084
Large diffs are not rendered by default.

‎iPhone3GS/gpio-keys.kcm

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
[type=QWERTY]
2+
3+
# keycode display number base caps fn caps_fn
4+
5+
A 'A' '2' 'a' 'A' '#' 0x00
6+
B 'B' '2' 'b' 'B' '<' 0x00
7+
C 'C' '2' 'c' 'C' '9' 0x00E7
8+
D 'D' '3' 'd' 'D' '5' 0x00
9+
E 'E' '3' 'e' 'E' '2' 0x0301
10+
F 'F' '3' 'f' 'F' '6' 0x00A5
11+
G 'G' '4' 'g' 'G' '-' '_'
12+
H 'H' '4' 'h' 'H' '[' '{'
13+
I 'I' '4' 'i' 'I' '$' 0x0302
14+
J 'J' '5' 'j' 'J' ']' '}'
15+
K 'K' '5' 'k' 'K' '"' '~'
16+
L 'L' '5' 'l' 'L' ''' '`'
17+
M 'M' '6' 'm' 'M' '!' 0x00
18+
N 'N' '6' 'n' 'N' '>' 0x0303
19+
O 'O' '6' 'o' 'O' '(' 0x00
20+
P 'P' '7' 'p' 'P' ')' 0x00
21+
Q 'Q' '7' 'q' 'Q' '*' 0x0300
22+
R 'R' '7' 'r' 'R' '3' 0x20AC
23+
S 'S' '7' 's' 'S' '4' 0x00DF
24+
T 'T' '8' 't' 'T' '+' 0x00A3
25+
U 'U' '8' 'u' 'U' '&' 0x0308
26+
V 'V' '8' 'v' 'V' '=' '^'
27+
W 'W' '9' 'w' 'W' '1' 0x00
28+
X 'X' '9' 'x' 'X' '8' 0xEF00
29+
Y 'Y' '9' 'y' 'Y' '%' 0x00A1
30+
Z 'Z' '9' 'z' 'Z' '7' 0x00
31+
32+
# on pc keyboards
33+
COMMA ',' ',' ',' ';' ';' '|'
34+
PERIOD '.' '.' '.' ':' ':' 0x2026
35+
AT '@' '0' '@' '0' '0' 0x2022
36+
SLASH '/' '/' '/' '?' '?' '\'
37+
38+
SPACE 0x20 0x20 0x20 0x20 0xEF01 0xEF01
39+
ENTER 0xa 0xa 0xa 0xa 0xa 0xa
40+
41+
TAB 0x9 0x9 0x9 0x9 0x9 0x9
42+
0 '0' '0' '0' ')' ')' ')'
43+
1 '1' '1' '1' '!' '!' '!'
44+
2 '2' '2' '2' '@' '@' '@'
45+
3 '3' '3' '3' '#' '#' '#'
46+
4 '4' '4' '4' '$' '$' '$'
47+
5 '5' '5' '5' '%' '%' '%'
48+
6 '6' '6' '6' '^' '^' '^'
49+
7 '7' '7' '7' '&' '&' '&'
50+
8 '8' '8' '8' '*' '*' '*'
51+
9 '9' '9' '9' '(' '(' '('
52+
53+
GRAVE '`' '`' '`' '~' '`' '~'
54+
MINUS '-' '-' '-' '_' '-' '_'
55+
EQUALS '=' '=' '=' '+' '=' '+'
56+
LEFT_BRACKET '[' '[' '[' '{' '[' '{'
57+
RIGHT_BRACKET ']' ']' ']' '}' ']' '}'
58+
BACKSLASH '\' '\' '\' '|' '\' '|'
59+
SEMICOLON ';' ';' ';' ':' ';' ':'
60+
APOSTROPHE ''' ''' ''' '"' ''' '"'
61+
STAR '*' '*' '*' '*' '*' '*'
62+
POUND '#' '#' '#' '#' '#' '#'
63+
PLUS '+' '+' '+' '+' '+' '+'
64+

‎iPhone3GS/gpio-keys.kl

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
key 399 GRAVE
2+
key 2 1
3+
key 3 2
4+
key 4 3
5+
key 5 4
6+
key 6 5
7+
key 7 6
8+
key 8 7
9+
key 9 8
10+
key 10 9
11+
key 11 0
12+
13+
key 158 BACK WAKE
14+
key 230 SOFT_RIGHT WAKE
15+
key 60 SOFT_RIGHT WAKE
16+
key 107 ENDCALL WAKE_DROPPED
17+
key 62 ENDCALL WAKE_DROPPED
18+
key 229 MENU WAKE_DROPPED
19+
key 139 MENU WAKE_DROPPED
20+
key 59 MENU WAKE_DROPPED
21+
key 127 SEARCH WAKE_DROPPED
22+
key 217 SEARCH WAKE_DROPPED
23+
key 228 POUND
24+
key 227 STAR
25+
key 231 CALL WAKE_DROPPED
26+
key 61 CALL WAKE_DROPPED
27+
key 232 DPAD_CENTER WAKE_DROPPED
28+
key 108 DPAD_DOWN WAKE_DROPPED
29+
key 103 DPAD_UP WAKE_DROPPED
30+
key 102 HOME WAKE
31+
key 105 DPAD_LEFT WAKE_DROPPED
32+
key 106 DPAD_RIGHT WAKE_DROPPED
33+
#key 115 VOLUME_UP
34+
#key 114 VOLUME_DOWN
35+
# USE THESE KEYS FOR JUSTICE TEMPORARILY
36+
key 115 BACK
37+
key 114 ENDCALL
38+
key 116 POWER WAKE
39+
key 212 CAMERA
40+
41+
key 16 Q
42+
key 17 W
43+
key 18 E
44+
key 19 R
45+
key 20 T
46+
key 21 Y
47+
key 22 U
48+
key 23 I
49+
key 24 O
50+
key 25 P
51+
key 26 LEFT_BRACKET
52+
key 27 RIGHT_BRACKET
53+
key 43 BACKSLASH
54+
55+
key 30 A
56+
key 31 S
57+
key 32 D
58+
key 33 F
59+
key 34 G
60+
key 35 H
61+
key 36 J
62+
key 37 K
63+
key 38 L
64+
key 39 SEMICOLON
65+
key 40 APOSTROPHE
66+
key 14 DEL
67+
68+
key 44 Z
69+
key 45 X
70+
key 46 C
71+
key 47 V
72+
key 48 B
73+
key 49 N
74+
key 50 M
75+
key 51 COMMA
76+
key 52 PERIOD
77+
key 53 SLASH
78+
key 28 ENTER
79+
80+
key 56 ALT_LEFT
81+
key 100 ALT_RIGHT
82+
key 42 SHIFT_LEFT
83+
key 54 SHIFT_RIGHT
84+
key 15 TAB
85+
key 57 SPACE
86+
key 150 EXPLORER
87+
key 155 ENVELOPE
88+
89+
key 12 MINUS
90+
key 13 EQUALS
91+
key 215 AT
92+
93+

‎iPhone3GS/iPhone3GS.mk

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
LOCAL_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
2+
COMMON := $(subst iPhone3GS,common,$(LOCAL_DIR))
3+
4+
ifeq ($(TARGET_BUILD_TYPE),debug)
5+
$(call inherit-product, $(SRC_TARGET_DIR)/product/sdk.mk)
6+
else
7+
$(call inherit-product, $(COMMON)/iPhone.mk)
8+
endif
9+
10+
$(call inherit-product, $(COMMON)/common.mk)
11+
12+
PRODUCT_NAME := iPhone3GS
13+
PRODUCT_DEVICE := iPhone3GS
14+
15+
16+
PRODUCT_COPY_FILES += \
17+
$(LOCAL_DIR)gpio-keys.kl:system/usr/keylayout/gpio-keys.kl \
18+
$(LOCAL_DIR)asound.conf:system/etc/asound.conf \
19+
$(LOCAL_DIR)asound.state:system/etc/asound.state
20+

‎iPhone3GS/libsensors/Android.mk

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Copyright (C) 2008 The Android Open Source Project
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
16+
LOCAL_PATH := $(call my-dir)
17+
18+
# HAL module implemenation, not prelinked and stored in
19+
# hw/<OVERLAY_HARDWARE_MODULE_ID>.<ro.product.board>.so
20+
include $(CLEAR_VARS)
21+
LOCAL_PRELINK_MODULE := false
22+
LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
23+
LOCAL_SHARED_LIBRARIES := liblog \
24+
libcutils
25+
LOCAL_SRC_FILES := sensors.c
26+
LOCAL_MODULE := sensors.apple
27+
include $(BUILD_SHARED_LIBRARY)

‎iPhone3GS/libsensors/sensors.c

+397
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,397 @@
1+
/*
2+
* Copyright (C) 2008 The Android 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+
18+
#define LOG_TAG "sensors"
19+
#define SENSORS_SERVICE_NAME "sensors"
20+
21+
#include <cutils/log.h>
22+
23+
#include <stdint.h>
24+
#include <string.h>
25+
#include <unistd.h>
26+
#include <errno.h>
27+
#include <fcntl.h>
28+
#include <stdlib.h>
29+
#include <pthread.h>
30+
#include <dirent.h>
31+
#include <sys/poll.h>
32+
#include <sys/ioctl.h>
33+
#include <sys/types.h>
34+
#include <linux/input.h>
35+
#include <sys/select.h>
36+
37+
#include <hardware/sensors.h>
38+
#include <cutils/native_handle.h>
39+
#include <cutils/sockets.h>
40+
#include <cutils/properties.h>
41+
42+
/******************************************************************************/
43+
#define ID_BASE SENSORS_HANDLE_BASE
44+
#define ID_ACCELERATION (ID_BASE+0)
45+
46+
#define CONVERT (GRAVITY_EARTH/64.0f)
47+
#define SENSORS_ACCELERATION (1 << ID_ACCELERATION)
48+
#define INPUT_DIR "/dev/input"
49+
#define ACCEL_SYS_DIR "/sys/devices/i2c-0/0-003a/input"
50+
#define SUPPORTED_SENSORS (SENSORS_ACCELERATION)
51+
#define EVENT_MASK_ACCEL_ALL ( (1 << ABS_X) | (1 << ABS_Y) | (1 << ABS_Z))
52+
#define DEFAULT_THRESHOLD 100
53+
54+
#define ACCELERATION_X (1 << ABS_X)
55+
#define ACCELERATION_Y (1 << ABS_Y)
56+
#define ACCELERATION_Z (1 << ABS_Z)
57+
#define SENSORS_ACCELERATION_ALL (ACCELERATION_X | ACCELERATION_Y | \
58+
ACCELERATION_Z)
59+
#define SEC_TO_NSEC 1000000000LL
60+
#define USEC_TO_NSEC 1000
61+
#define CONTROL_READ 0
62+
#define CONTROL_WRITE 1
63+
#define WAKE_SOURCE 0x1a
64+
65+
uint32_t active_sensors;
66+
int sensor_fd = -1;
67+
int event_fd = -1;
68+
int control_fd[2] = { -1, -1 };
69+
70+
71+
/*
72+
* the following is the list of all supported sensors
73+
*/
74+
static const struct sensor_t apple_sensor_list[] =
75+
{
76+
{
77+
.name = "LIS331DL 3-axis Accelerometer",
78+
.vendor = "STMicroelectronics",
79+
.version = 1,
80+
.handle =SENSOR_TYPE_ACCELEROMETER,
81+
.type = SENSOR_TYPE_ACCELEROMETER,
82+
.maxRange = (GRAVITY_EARTH * 2.3f),
83+
.resolution = (GRAVITY_EARTH * 2.3f) / 128.0f,
84+
.power = 0.4f, //power consumption max is rated max 0.3mA...
85+
.reserved = {},
86+
},
87+
};
88+
89+
static uint32_t sensors_get_list(struct sensors_module_t *module,
90+
struct sensor_t const** list)
91+
{
92+
*list = apple_sensor_list;
93+
return 1;
94+
}
95+
96+
/** Close the sensors device */
97+
static int
98+
close_sensors(struct hw_device_t *dev)
99+
{
100+
struct sensors_data_device_t *device_data =
101+
(struct sensors_data_device_t *)dev;
102+
if (device_data) {
103+
if (event_fd > 0)
104+
close(event_fd);
105+
free(device_data);
106+
}
107+
return 0;
108+
}
109+
110+
int open_sensors_phy(struct sensors_control_device_t *dev)
111+
{
112+
char devname[PATH_MAX];
113+
char *filename;
114+
int fd;
115+
int res;
116+
uint8_t bits[4];
117+
DIR *dir;
118+
struct dirent *de;
119+
120+
dir = opendir(ACCEL_SYS_DIR);
121+
if (dir == NULL)
122+
return -1;
123+
124+
125+
strcpy(devname, INPUT_DIR);
126+
filename = devname + strlen(devname);
127+
strcpy(filename, "/event");
128+
129+
while ((de = readdir(dir)))
130+
{
131+
if (de->d_name[0] == '.' &&
132+
(de->d_name[1] == '\0' ||
133+
(de->d_name[1] == '.' && de->d_name[2] == '\0')))
134+
continue;
135+
filename = devname + strlen(devname);
136+
*filename++ = de->d_name[5];
137+
*filename++ = '\0';
138+
fd = open(devname, O_RDONLY);
139+
if (fd < 0)
140+
{
141+
LOGE("Accelerometer: Couldn't open %s, error = %d", devname, fd);
142+
continue;
143+
}
144+
res = ioctl(fd, EVIOCGBIT(EV_ABS, 4), bits);
145+
if (res <= 0 || bits[0] != EVENT_MASK_ACCEL_ALL)
146+
{
147+
close(fd);
148+
continue;
149+
}
150+
151+
closedir(dir);
152+
return fd;
153+
}
154+
closedir(dir);
155+
156+
return -1;
157+
}
158+
159+
static native_handle_t *control_open_data_source(struct sensors_control_device_t *dev)
160+
{
161+
native_handle_t *hd;
162+
if (control_fd[0] == -1 && control_fd[1] == -1) {
163+
if (socketpair(AF_LOCAL, SOCK_STREAM, 0, control_fd) < 0 )
164+
{
165+
LOGE("Accelerometer: could not create thread control socket pair: %s",
166+
strerror(errno));
167+
return NULL;
168+
}
169+
}
170+
171+
sensor_fd = open_sensors_phy(dev);
172+
173+
hd = native_handle_create(1, 0);
174+
hd->data[0] = sensor_fd;
175+
176+
return hd;
177+
}
178+
179+
static int control_activate(struct sensors_control_device_t *dev,
180+
int handle, int enabled)
181+
{
182+
uint32_t mask = (1 << handle);
183+
uint32_t sensors;
184+
uint32_t new_sensors, active, changed;
185+
186+
sensors = enabled ? mask : 0;
187+
active = active_sensors;
188+
new_sensors = (active & ~mask) | (sensors & mask);
189+
changed = active ^ new_sensors;
190+
if (!changed)
191+
return 0;
192+
193+
active_sensors = new_sensors;
194+
195+
if (!enabled)
196+
{
197+
LOGD("Accelerometer: Deactivating Accelerometer sensor\n");
198+
}
199+
else
200+
{
201+
LOGD("Accelerometer: Activating Accelerometer sensor\n");
202+
}
203+
204+
return 0;
205+
}
206+
207+
static int control_set_delay(struct sensors_control_device_t *dev, int32_t ms)
208+
{
209+
return 0;
210+
}
211+
212+
static int control_wake(struct sensors_control_device_t *dev)
213+
{
214+
int err = 0;
215+
if (control_fd[CONTROL_WRITE] > 0)
216+
{
217+
struct input_event event[1];
218+
219+
event[0].type = EV_SYN;
220+
event[0].code = SYN_CONFIG;
221+
event[0].value = 0;
222+
err = write(control_fd[CONTROL_WRITE], event, sizeof(event));
223+
LOGD_IF(err<0, "control__wake, err=%d (%s)", errno, strerror(errno));
224+
}
225+
226+
return err;
227+
}
228+
229+
230+
231+
int sensors_open(struct sensors_data_device_t *dev, native_handle_t* hd)
232+
{
233+
event_fd = dup(hd->data[0]);
234+
235+
native_handle_close(hd);
236+
native_handle_delete(hd);
237+
238+
return 0;
239+
}
240+
static int control_close(struct hw_device_t *dev)
241+
{
242+
struct sensors_control_device_t *device_control = (void *) dev;
243+
close(control_fd[CONTROL_WRITE]);
244+
close(control_fd[CONTROL_READ]);
245+
close(sensor_fd);
246+
sensor_fd = -1;
247+
control_fd[0] = -1;
248+
control_fd[1] = -1;
249+
return 0;
250+
}
251+
int sensors_close(struct sensors_data_device_t *dev)
252+
{
253+
if (event_fd > 0) {
254+
close(event_fd);
255+
event_fd = -1;
256+
}
257+
return 0;
258+
}
259+
260+
int sensors_poll(struct sensors_data_device_t *dev, sensors_data_t* sensors)
261+
{
262+
int fd = event_fd;
263+
fd_set rfds;
264+
struct input_event ev;
265+
int ret;
266+
uint32_t new_sensors = 0;
267+
int select_dim;
268+
269+
sensors->vector.status = SENSOR_STATUS_ACCURACY_HIGH;
270+
select_dim = (fd > control_fd[CONTROL_READ]) ?
271+
fd + 1 : control_fd[CONTROL_READ] + 1;
272+
while (1)
273+
{
274+
FD_ZERO(&rfds);
275+
FD_SET(fd, &rfds);
276+
FD_SET(control_fd[CONTROL_READ], &rfds);
277+
278+
do {
279+
ret = select(select_dim, &rfds, NULL, NULL, 0);
280+
} while (ret < 0 && errno == EINTR);
281+
282+
if (FD_ISSET(control_fd[CONTROL_READ], &rfds))
283+
{
284+
char ch;
285+
read(control_fd[CONTROL_READ], &ch, sizeof(ch));
286+
if (ch==WAKE_SOURCE)
287+
{
288+
FD_ZERO(&rfds);
289+
return -EWOULDBLOCK;
290+
}
291+
}
292+
293+
ret = read(fd, &ev, sizeof(ev));
294+
if (ret < (int)sizeof(ev))
295+
break;
296+
297+
FD_CLR(control_fd[CONTROL_READ], &rfds);
298+
299+
if (ev.type == EV_ABS)
300+
{
301+
/* Orientation or acceleration event */
302+
switch (ev.code)
303+
{
304+
case ABS_X:
305+
new_sensors |= ACCELERATION_X;
306+
sensors->acceleration.x = (ev.value * CONVERT );
307+
break;
308+
case ABS_Y:
309+
new_sensors |= ACCELERATION_Y;
310+
sensors->acceleration.y = (ev.value * CONVERT);
311+
break;
312+
case ABS_Z:
313+
new_sensors |= ACCELERATION_Z;
314+
sensors->acceleration.z = (ev.value * CONVERT);
315+
break;
316+
}
317+
}
318+
else
319+
return 0;
320+
if (new_sensors == (ACCELERATION_X | ACCELERATION_Y | ACCELERATION_Z))
321+
{
322+
sensors->sensor = SENSOR_TYPE_ACCELEROMETER;
323+
return SENSOR_TYPE_ACCELEROMETER;
324+
}
325+
}
326+
return 0;
327+
}
328+
329+
/******************************************************************************/
330+
331+
/**
332+
* module methods
333+
*/
334+
335+
/** Open a new instance of a sensors device using name */
336+
static int open_sensors(const struct hw_module_t* module, char const* name,
337+
struct hw_device_t** device)
338+
{
339+
int status = -EINVAL;
340+
341+
if (!strcmp(name, SENSORS_HARDWARE_CONTROL))
342+
{
343+
struct sensors_control_device_t *device_control =
344+
malloc(sizeof(struct sensors_control_device_t));
345+
memset(device_control, 0, sizeof(*device_control));
346+
347+
device_control->common.tag = HARDWARE_DEVICE_TAG;
348+
device_control->common.version = 0;
349+
device_control->common.module = (struct hw_module_t*)module;
350+
device_control->common.close = control_close;
351+
device_control->open_data_source = control_open_data_source;
352+
device_control->activate = control_activate;
353+
device_control->set_delay = control_set_delay;
354+
device_control->wake = control_wake;
355+
sensor_fd = -1;
356+
*device = &device_control->common;
357+
status = 0;
358+
} else if (!strcmp(name, SENSORS_HARDWARE_DATA)) {
359+
struct sensors_data_device_t *device_data =
360+
malloc(sizeof(struct sensors_data_device_t));
361+
memset(device_data, 0, sizeof(*device_data));
362+
363+
device_data->common.tag = HARDWARE_DEVICE_TAG;
364+
device_data->common.version = 0;
365+
device_data->common.module = (struct hw_module_t*)module;
366+
device_data->common.close = close_sensors;
367+
device_data->data_open = sensors_open;
368+
device_data->data_close = sensors_close;
369+
device_data->poll = sensors_poll;
370+
event_fd = -1;
371+
*device = &device_data->common;
372+
status = 0;
373+
}
374+
return status;
375+
}
376+
377+
static struct hw_module_methods_t sensors_module_methods =
378+
{
379+
.open = open_sensors,
380+
};
381+
382+
/*
383+
* The Sensors Hardware Module
384+
*/
385+
const struct sensors_module_t HAL_MODULE_INFO_SYM =
386+
{
387+
.common = {
388+
.tag = HARDWARE_MODULE_TAG,
389+
.version_major = 1,
390+
.version_minor = 0,
391+
.id = SENSORS_HARDWARE_MODULE_ID,
392+
.name = "LIS331DL accelerometer sensors Module",
393+
.author = "Dario Russo (turbominchiameister@gmail.com)",
394+
.methods = &sensors_module_methods,
395+
},
396+
.get_sensors_list = sensors_get_list
397+
};

‎iPhone3GS/system.prop

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
rild.libpath=/system/lib/hw/libril.apple.so
2+
rild.libargs=
3+
android.keylayout.gpio-keys=/system/usr/keylayout/gpio-keys.kl
4+
android.keychar.gpio-keys=/system/usr/keychars/gpio-keys.kcm
5+
wifi.interface=wlan0
6+
ro.ril.enable.3g.prefix=1
7+
ro.ril.oem.nosim.ecclist=911,112,113,115,117,999,000,08,118,120,122,110,119,995
8+
ro.ril.emc.mode=2
9+
ro.ril.hsxpa=2
10+
ro.ril.gprsclass=12
11+
ro.sf.lcd_density=140

‎iPhone4/iPhone4.mk

+20-14
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
1-
LOCAL_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
2-
COMMON := $(subst iPhone4,common,$(LOCAL_DIR))
3-
4-
$(call inherit-product, $(COMMON)/common.mk)
5-
6-
PRODUCT_NAME := iPhone4
7-
PRODUCT_DEVICE := iPhone4
8-
9-
10-
PRODUCT_COPY_FILES += \
11-
$(LOCAL_DIR)gpio-keys.kl:system/usr/keylayout/gpio-keys.kl \
12-
$(LOCAL_DIR)asound.conf:system/etc/asound.conf \
13-
$(LOCAL_DIR)asound.state:system/etc/asound.state
14-
1+
LOCAL_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
2+
COMMON := $(subst iPhone4,common,$(LOCAL_DIR))
3+
4+
ifeq ($(TARGET_BUILD_TYPE),debug)
5+
$(call inherit-product, $(SRC_TARGET_DIR)/product/sdk.mk)
6+
else
7+
$(call inherit-product, $(COMMON)/iPhone.mk)
8+
endif
9+
10+
$(call inherit-product, $(COMMON)/common.mk)
11+
12+
PRODUCT_NAME := iPhone4
13+
PRODUCT_DEVICE := iPhone4
14+
15+
16+
PRODUCT_COPY_FILES += \
17+
$(LOCAL_DIR)gpio-keys.kl:system/usr/keylayout/gpio-keys.kl \
18+
$(LOCAL_DIR)asound.conf:system/etc/asound.conf \
19+
$(LOCAL_DIR)asound.state:system/etc/asound.state
20+

‎iPodTouch1G/iPodTouch1G.mk

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
LOCAL_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
22
COMMON := $(subst iPodTouch1G,common,$(LOCAL_DIR))
33

4+
ifeq ($(TARGET_BUILD_TYPE),debug)
5+
$(call inherit-product, $(SRC_TARGET_DIR)/product/sdk.mk)
6+
else
7+
$(call inherit-product, $(COMMON)/iPod.mk)
8+
endif
9+
410
$(call inherit-product, $(COMMON)/common.mk)
511

612
PRODUCT_NAME := iPodTouch1G

‎iPodTouch2G/iPodTouch2G.mk

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
LOCAL_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
22
COMMON := $(subst iPodTouch2G,common,$(LOCAL_DIR))
33

4+
ifeq ($(TARGET_BUILD_TYPE),debug)
5+
$(call inherit-product, $(SRC_TARGET_DIR)/product/sdk.mk)
6+
else
7+
$(call inherit-product, $(COMMON)/iPod.mk)
8+
endif
9+
410
$(call inherit-product, $(COMMON)/common.mk)
511

612
PRODUCT_NAME := iPodTouch2G

‎products/AndroidProducts.mk

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ COMMON := $(ROOT)common
55
PRODUCT_MAKEFILES := \
66
$(ROOT)iPhone2G/iPhone2G.mk \
77
$(ROOT)iPhone3G/iPhone3G.mk \
8+
$(ROOT)iPhone3G/iPhone3GS.mk \
89
$(ROOT)iPhone4/iPhone4.mk \
910
$(ROOT)iPodTouch1G/iPodTouch1G.mk \
1011
$(ROOT)iPodTouch2G/iPodTouch2G.mk

‎vendorsetup.sh

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
add_lunch_combo iPhone2G-eng
22
add_lunch_combo iPhone3G-eng
3+
add_lunch_combo iPhone3GS-eng
34
add_lunch_combo iPhone4-eng
45
add_lunch_combo iPodTouch1G-eng
56
add_lunch_combo iPodTouch2G-eng

0 commit comments

Comments
 (0)
Please sign in to comment.