Skip to content

Commit 5ef7848

Browse files
committed
Split build scripts to support standard and slow-gpu variants
Usually we do not change the framework, but recent Android-12 UI changes made some of the devices unusable. Let's patch AOSP for such devices and ship releases patched to give our users better use experience. Signed-off-by: Roman Stratiienko <[email protected]> Change-Id: I907a825e38122779279b7b6a6be4457c63badf9d
1 parent c538a6e commit 5ef7848

File tree

3 files changed

+29
-9
lines changed

3 files changed

+29
-9
lines changed

.ci/Makefile

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@ SHELL = bash
22

33
VARIANT := userdebug
44

5-
TARGETS := \
6-
pinephonepro\
5+
TARGETS_STANDARD += \
6+
pinephonepro \
7+
opi4 \
8+
rpi4 \
9+
10+
TARGETS_SLOWGPU := \
11+
opi3 \
712
pinephone \
813
pinetab \
9-
opi3 \
10-
opi4 \
11-
rpi4 \
1214
opi_win \
1315
opi_pc2 \
1416
opi_prime \
1517
opi_pc \
16-
17-
TARGETS += \
1818
opi_plus2 \
1919
opi_plus2e \
2020

@@ -52,6 +52,21 @@ $(AOSP_PATH)/out_images/gd-$$(VER)-$1-$2.tar.gz: $(AOSP_PATH)/out_images/gd-$$(V
5252

5353
endef
5454

55+
TARGETS := $(TARGETS_STANDARD) $(TARGETS_SLOWGPU)
5556
$(foreach target,$(TARGETS),$(eval $(call process-target,$(target),$(VARIANT))))
5657

57-
build_all: $(foreach target,$(TARGETS),$(AOSP_PATH)/out_images/gd-$(VER)-$(target)-$(VARIANT).tar.gz ) ## Build all GloDroid targets, put images into <AOSP tree>/out_images/...
58+
build_standard: $(foreach target,$(TARGETS_STANDARD),$(AOSP_PATH)/out_images/gd-$(VER)-$(target)-$(VARIANT).tar.gz ) ## Build all standard GloDroid targets, put images into <AOSP tree>/out_images/...
59+
60+
build_slowgpu: $(foreach target,$(TARGETS_SLOWGPU),$(AOSP_PATH)/out_images/gd-$(VER)-$(target)-$(VARIANT).tar.gz ) ## Build all slow-gpu GloDroid targets, put images into <AOSP tree>/out_images/...
61+
62+
patch_slowgpu: ## Patch the framework to reduce load on slow GPU
63+
cd $(AOSP_PATH)/frameworks/base
64+
git fetch https://android.googlesource.com/platform/frameworks/base refs/changes/33/2121633/1 && git cherry-pick FETCH_HEAD --allow-empty --keep-redundant-commits
65+
git fetch https://android.googlesource.com/platform/frameworks/base refs/changes/52/2123752/1 && git cherry-pick FETCH_HEAD --allow-empty --keep-redundant-commits
66+
cd $(AOSP_PATH)/frameworks/native
67+
git fetch https://android.googlesource.com/platform/frameworks/native refs/changes/73/2123073/1 && git cherry-pick FETCH_HEAD --allow-empty --keep-redundant-commits
68+
69+
unpatch_slowgpu: ## Restore the framework code after the patching
70+
cd $(AOSP_PATH)
71+
repo sync -l frameworks/base
72+
repo sync -l frameworks/native

.docker/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,6 @@ USER ${RUN_USER}
5959
# Install repo
6060
RUN wget -P ${USER_HOME}/bin http://commondatastorage.googleapis.com/git-repo-downloads/repo && chmod a+x ${USER_HOME}/bin/repo
6161

62+
RUN git config --global user.name "FIRST_NAME LAST_NAME" && git config --global user.email "[email protected]"
63+
6264
CMD [ "/bin/bash" ]

.docker/Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,7 @@ build_all: ## Build all targets within a container (for CI purposes)
3737
make clean
3838
make build
3939
make run `cd ../../.. && pwd`
40-
$(docker_bin) exec -it $(image_name) bash -c "cd .repo/manifests/.ci && make build_all"
40+
$(docker_bin) exec -it $(image_name) bash -c "cd .repo/manifests/.ci && make unpatch_slowgpu"
41+
$(docker_bin) exec -it $(image_name) bash -c "cd .repo/manifests/.ci && make build_standard"
42+
$(docker_bin) exec -it $(image_name) bash -c "cd .repo/manifests/.ci && make patch_slowgpu"
43+
$(docker_bin) exec -it $(image_name) bash -c "cd .repo/manifests/.ci && make build_slowgpu"

0 commit comments

Comments
 (0)