├── assets ├── gdrive └── gsi.sh ├── .github └── workflows │ └── script_check.yml ├── patches ├── Specified-the-heap-size-with-the-flag-to-fix-out-of-memory-error.patch ├── Revert-libsepol:Make-an-unknown-permission-an-error-in-CIL.patch ├── WifiManager:Add-StaState-API.patch ├── Partially-Revert-Remove-references-to-deprecated-device.patch └── wifi:Add-StaState-API.patch ├── gsi.py ├── env.sh ├── obb.sh ├── sefix.sh ├── volte.sh ├── error.sh ├── device-specific └── CPH1859 │ └── setup.sh ├── README.md ├── sync.sh ├── upload.sh ├── git.sh ├── init.sh └── LICENSE /assets/gdrive: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CyberJalagam/aosp_rom_automation/HEAD/assets/gdrive -------------------------------------------------------------------------------- /assets/gsi.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # SPDX-License-Identifier: GPL-3.0-or-later 3 | # (c) TechyMinati ( Aryan Sinha ) 4 | 5 | ROM_URL="" 6 | ROM_NAME="" 7 | 8 | echo "Type ROM URL (Direct Link)" 9 | read ROM_URL 10 | 11 | echo "Type ROM_NAME (eg, Generic, OxygenOS, MIUI, Flyme, ColorOS,Pixel etc)" 12 | read ROM_NAME 13 | 14 | echo "Building GSI" 15 | 16 | sudo bash gsi-working-dir/ErfanGSIs/url2GSI.sh $ROM_URL $ROM_NAME 17 | -------------------------------------------------------------------------------- /.github/workflows/script_check.yml: -------------------------------------------------------------------------------- 1 | 2 | name: Android rom 3 | 4 | on: [push] 5 | 6 | env: 7 | username: CyberJalagam 8 | jobs: 9 | build: 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - name: Checkout 14 | uses: actions/checkout@main 15 | 16 | - name: initialization 17 | continue-on-error: true 18 | run: | 19 | sudo apt -y install python3 20 | sudo apt -y install shellcheck 21 | 22 | - name: Validate syntax 23 | run: bash -n *.sh && python3 -m py_compile gsi.py 24 | 25 | -------------------------------------------------------------------------------- /patches/Specified-the-heap-size-with-the-flag-to-fix-out-of-memory-error.patch: -------------------------------------------------------------------------------- 1 | From c8ba7af59acda55a16835727d1d351b8d58a5ca4 Mon Sep 17 00:00:00 2001 2 | From: nparashar150 3 | Date: Thu, 1 Oct 2020 13:42:47 +0530 4 | Subject: [PATCH] Specified the heap size with the flag to fix out of memory 5 | error 6 | 7 | --- 8 | java/droiddoc.go | 1 + 9 | 1 file changed, 1 insertion(+) 10 | 11 | diff --git a/java/droiddoc.go b/java/droiddoc.go 12 | index 230b1f0..d829283 100644 13 | --- a/java/droiddoc.go 14 | +++ b/java/droiddoc.go 15 | @@ -1468,6 +1468,7 @@ func metalavaCmd(ctx android.ModuleContext, rule *android.RuleBuilder, javaVersi 16 | 17 | cmd.BuiltTool(ctx, "metalava"). 18 | Flag(config.JavacVmFlags). 19 | + Flag("-J-Xmx3112m"). 20 | FlagWithArg("-encoding ", "UTF-8"). 21 | FlagWithArg("-source ", javaVersion.String()). 22 | FlagWithRspFileInputList("@", srcs). 23 | -------------------------------------------------------------------------------- /gsi.py: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # SPDX-License-Identifier: GPL-3.0-or-later 3 | # (c) TechyMinati ( Aryan Sinha ) 4 | 5 | import os 6 | import sys 7 | print ("==========================================") 8 | print (" Welcome to sGSI Building Script ") 9 | print ("==========================================") 10 | n=input("Press Y to Continue, N to Exit: ") 11 | if (n=="Y") or (n=="y") : 12 | print("Cloning ErfanGSIs Sourcecode") 13 | print (" Warning: this is a Fork of ErfanGSIs, Adapted for our Usage") 14 | os.system('mkdir gsi-working-dir') 15 | os.system('cd gsi-working-dir') 16 | os.system('git clone --recurse-submodules https://github.com/CyberJalagam/ErfanGSIs') 17 | os.system('sudo chmod -R 777 ErfanGSIs') 18 | print ("Initialising enviroment for GSI Building") 19 | os.system('cd ErfanGSIs && sudo bash setup.sh') 20 | print("==========================================") 21 | print(" Ready to Build GSI") 22 | print("==========================================") 23 | os.system('sudo bash assets/gsi.sh') 24 | print("==========================================") 25 | print(" GSI Build Successfully, find it On gsi-working-dir/ErfanGSIs/output ") 26 | print("==========================================") 27 | 28 | else: 29 | print(" Thanks , If you want to restart GSI Building, re-run this script") 30 | 31 | -------------------------------------------------------------------------------- /patches/Revert-libsepol:Make-an-unknown-permission-an-error-in-CIL.patch: -------------------------------------------------------------------------------- 1 | From 240d1d8dc4c9f69a50f6bc9fd47d809e29b5f56d Mon Sep 17 00:00:00 2001 2 | From: William Bellavance 3 | Date: Tue, 30 Aug 2016 09:28:06 -0400 4 | Subject: [PATCH] Revert "libsepol: Make an unknown permission an error in CIL" 5 | 6 | This reverts commit dc4e54126bf25dea4d51820922ccd1959be68fbc. 7 | --- 8 | libsepol/cil/src/cil_resolve_ast.c | 12 ++++++++---- 9 | 1 file changed, 8 insertions(+), 4 deletions(-) 10 | 11 | diff --git a/libsepol/cil/src/cil_resolve_ast.c b/libsepol/cil/src/cil_resolve_ast.c 12 | index 87575860..e72abdeb 100644 13 | --- a/libsepol/cil/src/cil_resolve_ast.c 14 | +++ b/libsepol/cil/src/cil_resolve_ast.c 15 | @@ -131,14 +131,18 @@ static int __cil_resolve_perms(symtab_t *class_symtab, symtab_t *common_symtab, 16 | } 17 | } 18 | if (rc != SEPOL_OK) { 19 | + struct cil_list *empty_list; 20 | if (class_flavor == CIL_MAP_CLASS) { 21 | cil_log(CIL_ERR, "Failed to resolve permission %s for map class\n", (char*)curr->data); 22 | - } else { 23 | - cil_log(CIL_ERR, "Failed to resolve permission %s\n", (char*)curr->data); 24 | + goto exit; 25 | } 26 | - goto exit; 27 | + cil_log(CIL_WARN, "Failed to resolve permission %s\n", (char*)curr->data); 28 | + /* Use an empty list to represent unknown perm */ 29 | + cil_list_init(&empty_list, perm_strs->flavor); 30 | + cil_list_append(*perm_datums, CIL_LIST, empty_list); 31 | + } else { 32 | + cil_list_append(*perm_datums, CIL_DATUM, perm_datum); 33 | } 34 | - cil_list_append(*perm_datums, CIL_DATUM, perm_datum); 35 | } else { 36 | cil_list_append(*perm_datums, curr->flavor, curr->data); 37 | } 38 | -------------------------------------------------------------------------------- /env.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (C) 2020 RB INTERNATIONAL NETWORK 5 | # 6 | # An Open Source Project 7 | # 8 | # Licensed under the Apache License, Version 2.0 (the "License"); 9 | # you may not use this file except in compliance with the License. 10 | # You may obtain a copy of the License at 11 | # 12 | # http://www.apache.org/licenses/LICENSE-2.0 13 | # 14 | # Unless required by applicable law or agreed to in writing, software 15 | # distributed under the License is distributed on an "AS IS" BASIS, 16 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | # See the License for the specific language governing permissions and 18 | # limitations under the License. 19 | # 20 | 21 | RESET='\033[0m' # Text Reset 22 | BLACK='\033[0;30m' # Black 23 | RED='\033[0;31m' # Red 24 | GREEN='\033[0;32m' # Green 25 | YELLOW='\033[0;33m' # Yellow 26 | BLUE='\033[0;34m' # Blue 27 | PURPLE='\033[0;35m' # Purple 28 | CYAN='\033[0;36m' # Cyan 29 | WHITE='\033[0;37m' # White 30 | 31 | echo -e "${CYAN}" 32 | echo "<<<<< © RB INTERNATIONAL NETWORK™ >>>>>" 33 | 34 | echo -e "${RED}" 35 | echo " ~// Build environment Script //~" 36 | echo -e "${RESET}" 37 | 38 | wget https://raw.githubusercontent.com/akhilnarang/scripts/master/setup/android_build_env.sh 39 | bash android_build_env.sh 40 | sudo add-apt-repository -y ppa:deadsnakes/ppa 41 | sudo apt-get -y update 42 | sudo apt-get install -y python3.6 43 | export USE_CCACHE=1 44 | export CCACHE_EXEC=/usr/bin/ccache 45 | ccache -M 100G 46 | export ANDROID_JACK_VM_ARGS="-Xmx15g -Dfile.encoding=UTF-8 -XX:+TieredCompilation" 47 | export CCACHE_COMPRESS=1 48 | 49 | echo -e "${CYAN}" 50 | echo "<<<<< © RB INTERNATIONAL NETWORK™ >>>>>" 51 | echo -e "${RESET}" 52 | -------------------------------------------------------------------------------- /obb.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (C) 2020 RB INTERNATIONAL NETWORK 4 | # 5 | # An Open Source Project 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # 19 | 20 | RESET='\033[0m' # Text Reset 21 | BLACK='\033[0;30m' # Black 22 | RED='\033[0;31m' # Red 23 | GREEN='\033[0;32m' # Green 24 | YELLOW='\033[0;33m' # Yellow 25 | BLUE='\033[0;34m' # Blue 26 | PURPLE='\033[0;35m' # Purple 27 | CYAN='\033[0;36m' # Cyan 28 | WHITE='\033[0;37m' # White 29 | 30 | echo -e "${CYAN}" 31 | echo "<<<<< © RB INTERNATIONAL NETWORK™ >>>>>" 32 | 33 | echo -e "${RED}" 34 | echo " ~// Rom OBB Patching Script //~" 35 | 36 | ROM_DIR="" 37 | 38 | echo -e "${YELLOW}" 39 | echo "Enter full rom directory" 40 | echo "eg, /home/cyberjalagam/potato" 41 | echo -e "${RESET}" 42 | read ROM_DIR 43 | cd "$ROM_DIR" 44 | 45 | echo -e "${YELLOW}" 46 | # Apply obb patch 47 | echo -e "\n======================== Obb patch ============================\n" 48 | echo -e "${RESET}" 49 | cd frameworks/native && git fetch https://github.com/phhusson/platform_frameworks_native android-11.0.0_r28-phh && git cherry-pick cc94e422c0a8b2680e7f9cfc391b2b03a56da765 50 | cd ../../ 51 | 52 | echo -e "${CYAN}" 53 | echo "<<<<< © RB INTERNATIONAL NETWORK™ >>>>>" 54 | echo -e "${RESET}" 55 | -------------------------------------------------------------------------------- /sefix.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (C) 2020 RB INTERNATIONAL NETWORK 4 | # 5 | # An Open Source Project 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # 19 | 20 | RESET='\033[0m' # Text Reset 21 | BLACK='\033[0;30m' # Black 22 | RED='\033[0;31m' # Red 23 | GREEN='\033[0;32m' # Green 24 | YELLOW='\033[0;33m' # Yellow 25 | BLUE='\033[0;34m' # Blue 26 | PURPLE='\033[0;35m' # Purple 27 | CYAN='\033[0;36m' # Cyan 28 | WHITE='\033[0;37m' # White 29 | 30 | echo -e "${CYAN}" 31 | echo "<<<<< © RB INTERNATIONAL NETWORK™ >>>>>" 32 | 33 | echo -e "${RED}" 34 | echo " ~// Selinux patching Script //~" 35 | 36 | ROM_DIR="" 37 | 38 | echo -e "${YELLOW}" 39 | echo "Enter full rom directory" 40 | echo "eg, /home/cyberjalagam/potato" 41 | echo -e "${RESET}" 42 | read ROM_DIR 43 | cd "$ROM_DIR" 44 | 45 | # Revert an selinux commit 46 | echo -e "${YELLOW}" 47 | echo -e "\n======================== SeFix ============================\n" 48 | cd external/selinux 49 | echo -e "${RESET}" 50 | wget https://github.com/CyberJalagam/android_rom_building_scripts/raw/master/patches/Revert-libsepol:Make-an-unknown-permission-an-error-in-CIL.patch 51 | git am Revert-"libsepol:Make-an-unknown-permission-an-error-in-CIL".patch 52 | 53 | echo -e "${CYAN}" 54 | echo "<<<<< © RB INTERNATIONAL NETWORK™ >>>>>" 55 | echo -e "${RESET}" 56 | -------------------------------------------------------------------------------- /volte.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (C) 2020 RB INTERNATIONAL NETWORK 5 | # 6 | # An Open Source Project 7 | # 8 | # Licensed under the Apache License, Version 2.0 (the "License"); 9 | # you may not use this file except in compliance with the License. 10 | # You may obtain a copy of the License at 11 | # 12 | # http://www.apache.org/licenses/LICENSE-2.0 13 | # 14 | # Unless required by applicable law or agreed to in writing, software 15 | # distributed under the License is distributed on an "AS IS" BASIS, 16 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | # See the License for the specific language governing permissions and 18 | # limitations under the License. 19 | # 20 | 21 | RESET='\033[0m' # Text Reset 22 | BLACK='\033[0;30m' # Black 23 | RED='\033[0;31m' # Red 24 | GREEN='\033[0;32m' # Green 25 | YELLOW='\033[0;33m' # Yellow 26 | BLUE='\033[0;34m' # Blue 27 | PURPLE='\033[0;35m' # Purple 28 | CYAN='\033[0;36m' # Cyan 29 | WHITE='\033[0;37m' # White 30 | 31 | echo -e "${CYAN}" 32 | echo "<<<<< © RB INTERNATIONAL NETWORK™ >>>>>" 33 | 34 | echo -e "${RED}" 35 | echo " ~// Volte patching Script //~" 36 | 37 | ROM_DIR="" 38 | 39 | echo -e "${YELLOW}" 40 | echo "enter full rom directory" 41 | echo "eg, /home/cyberjalagam/potato" 42 | echo -e "${RESET}" 43 | read ROM_DIR 44 | 45 | cd "$ROM_DIR" 46 | 47 | 48 | # some really necessary patches for IMS to work 49 | cd frameworks/base && git fetch https://github.com/Corvus-R/android_frameworks_base-staging 11 && git cherry-pick a2c6a3997cdb4598c654b0dea6824286a5a3f727 50 | cd ../../ 51 | cd frameworks/opt/net/wifi && git fetch https://github.com/PotatoProject/frameworks_opt_net_wifi dumaloo-release && git cherry-pick 88773b8285d7962d0add6a9f55c63fc045beb677 52 | cd ../../../../ 53 | cd frameworks/opt/net/ims && git fetch "http://gerrit.pixysos.com/PixysOS/frameworks_opt_net_ims" refs/changes/65/4665/1 && git cherry-pick FETCH_HEAD 54 | 55 | # Go to initial directory 56 | cd ../../../../ 57 | 58 | echo -e "${CYAN}" 59 | echo "<<<<< © RB INTERNATIONAL NETWORK™ >>>>>" 60 | echo -e "${RESET}" 61 | -------------------------------------------------------------------------------- /error.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # This script is personal 4 | # Make sure to make necessary changes 5 | # 6 | # Copyright (C) 2020 RB INTERNATIONAL NETWORK 7 | # 8 | # An Open Source Project 9 | # 10 | # Licensed under the Apache License, Version 2.0 (the "License"); 11 | # you may not use this file except in compliance with the License. 12 | # You may obtain a copy of the License at 13 | # 14 | # http://www.apache.org/licenses/LICENSE-2.0 15 | # 16 | # Unless required by applicable law or agreed to in writing, software 17 | # distributed under the License is distributed on an "AS IS" BASIS, 18 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | # See the License for the specific language governing permissions and 20 | # limitations under the License. 21 | # 22 | 23 | RESET='\033[0m' # Text Reset 24 | BLACK='\033[0;30m' # Black 25 | RED='\033[0;31m' # Red 26 | GREEN='\033[0;32m' # Green 27 | YELLOW='\033[0;33m' # Yellow 28 | BLUE='\033[0;34m' # Blue 29 | PURPLE='\033[0;35m' # Purple 30 | CYAN='\033[0;36m' # Cyan 31 | WHITE='\033[0;37m' # White 32 | 33 | echo -e "${CYAN}" 34 | echo "<<<<< © RB INTERNATIONAL NETWORK™ >>>>>" 35 | 36 | echo -e "${RED}" 37 | echo " ~// Rom error reading Script //~" 38 | 39 | echo -e "${RESET}" 40 | 41 | if [ ! -d go1.16.5.linux-amd64.tar.gz ] 42 | then 43 | # Go 44 | wget https://golang.org/dl/go1.16.5.linux-amd64.tar.gz; 45 | sudo tar -C /usr/local -xzf go1.16.5.linux-amd64.tar.gz; 46 | export PATH=$PATH:/usr/local/go/bin; 47 | 48 | # inu 49 | GO111MODULE=on go get -u github.com/dogbin/inu; 50 | [[ $PATH != ?(*:)$HOME/go/bin?(:*) ]] && export PATH=$HOME/go/bin:$PATH; 51 | fi 52 | 53 | echo -e "${YELLOW}" 54 | echo "Type in the full directory of rom folder"; 55 | echo "eg, /home/cyberjalagam/sakura"; 56 | echo -e "${RESET}" 57 | read ROM_DIR; 58 | cat "$ROM_DIR"/out/error.log; 59 | echo -e "${YELLOW}" 60 | echo "===================================================================="; 61 | echo -e "${RED}" 62 | echo "Error link:"; 63 | echo -e "${RESET}" 64 | cat "$ROM_DIR"/out/error.log | inu; 65 | 66 | echo -e "${CYAN}" 67 | echo "<<<<< © RB INTERNATIONAL NETWORK™ >>>>>" 68 | echo -e "${RESET}" 69 | -------------------------------------------------------------------------------- /device-specific/CPH1859/setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (C) 2020 RB INTERNATIONAL NETWORK 4 | # 5 | # An Open Source Project 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # 19 | RESET='\033[0m' # Text Reset 20 | BLACK='\033[0;30m' # Black 21 | RED='\033[0;31m' # Red 22 | GREEN='\033[0;32m' # Green 23 | YELLOW='\033[0;33m' # Yellow 24 | BLUE='\033[0;34m' # Blue 25 | PURPLE='\033[0;35m' # Purple 26 | CYAN='\033[0;36m' # Cyan 27 | WHITE='\033[0;37m' # White 28 | 29 | echo -e "${CYAN}" 30 | echo "<<<<< © RB INTERNATIONAL NETWORK™ >>>>>" 31 | ROM_DIR="" 32 | 33 | echo -e "${RED}" 34 | echo " ~// Build environment for Realme 1 //~" 35 | echo -e "${YELLOW}" 36 | echo "Enter full rom directory" 37 | echo -e "${RESET}" 38 | read ROM_DIR 39 | 40 | cd "$ROM_DIR" 41 | 42 | # Sefix 43 | cd external/selinux && git revert --no-edit `git log --oneline | grep "Make an unknown permission an error in CIL" | cut -d' ' -f 1` 44 | cd ../../ 45 | 46 | # Obb fix 47 | cd frameworks/native && git fetch https://github.com/phhusson/platform_frameworks_native android-11.0.0_r28-phh && git cherry-pick cc94e422c0a8b2680e7f9cfc391b2b03a56da765 48 | cd ../../ 49 | 50 | # Volte Patches 51 | cd frameworks/base && git fetch https://github.com/Corvus-R/android_frameworks_base-staging 11 && git cherry-pick a2c6a3997cdb4598c654b0dea6824286a5a3f727 52 | cd ../../ 53 | cd frameworks/opt/net/wifi && git fetch https://github.com/PotatoProject/frameworks_opt_net_wifi dumaloo-release && git cherry-pick 88773b8285d7962d0add6a9f55c63fc045beb677 54 | cd ../../../../ 55 | cd frameworks/opt/net/ims && git fetch "http://gerrit.pixysos.com/PixysOS/frameworks_opt_net_ims" refs/changes/65/4665/1 && git cherry-pick FETCH_HEAD 56 | 57 | # Go to initial directory 58 | cd ../../../../ 59 | echo "<<<<< © RB INTERNATIONAL NETWORK™ >>>>>" 60 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

Android Build Environment Scripts

2 |

An awesome script for Android Developers.

3 |
4 | Stars Badge 5 | Forks Badge 6 | Pull Requests Badge 7 | Issues Badge 8 | GitHub contributors 9 | License Badge 10 |
11 |
12 |

Loved the projectS? Please visit our Website

13 |
14 | 15 | STATUS: STABLE 16 | 17 | WARNING! I Force push way too many times. good luck with your fork xD 18 | 19 | # <<<<< © RB INTERNATIONAL NETWORK™ >>>>> 20 | # THIS MAKES YOUR LIFE FRIKIN EASIER 21 | # INSTALLATION 22 | 23 | Easy to use, 24 | ``` 25 | git clone https://github.com/CyberJalagam/scripts && cd scripts && chmod +x build.sh && bash build.sh 26 | ``` 27 | 28 | For peeps using screen while compiling, 29 | ``` 30 | git clone https://github.com/CyberJalagam/scripts && cd scripts && chmod +x build.sh && screen -LS script bash build.sh 31 | ``` 32 | ## Device specific environments 33 | 34 | -// Realme 1 | CPH1859 //- 35 | ``` 36 | git clone https://github.com/CyberJalagam/scripts && cd scripts && bash device-specific/CPH1859/setup.sh 37 | ``` 38 | 39 | 40 | If you like this Repo, Please click the :star: 41 | 42 | # Contribute 43 | 44 | Contributions are always welcome! Please create a PR to add Github Profile. 45 | 46 | ## :man_astronaut: Show your support 47 | 48 | Give a ⭐️ if this project helped you! 49 | 50 | -------------------------------------------------------------------------------- /sync.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (C) 2020 RB INTERNATIONAL NETWORK 5 | # 6 | # An Open Source Project 7 | # 8 | # Licensed under the Apache License, Version 2.0 (the "License"); 9 | # you may not use this file except in compliance with the License. 10 | # You may obtain a copy of the License at 11 | # 12 | # http://www.apache.org/licenses/LICENSE-2.0 13 | # 14 | # Unless required by applicable law or agreed to in writing, software 15 | # distributed under the License is distributed on an "AS IS" BASIS, 16 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | # See the License for the specific language governing permissions and 18 | # limitations under the License. 19 | # 20 | 21 | RESET='\033[0m' # Text Reset 22 | BLACK='\033[0;30m' # Black 23 | RED='\033[0;31m' # Red 24 | GREEN='\033[0;32m' # Green 25 | YELLOW='\033[0;33m' # Yellow 26 | BLUE='\033[0;34m' # Blue 27 | PURPLE='\033[0;35m' # Purple 28 | CYAN='\033[0;36m' # Cyan 29 | WHITE='\033[0;37m' # White 30 | 31 | echo -e "${CYAN}" 32 | 33 | DIR="" 34 | ROM_MANIFEST="" 35 | BRANCH_NAME="" 36 | 37 | echo "<<<<< © RB INTERNATIONAL NETWORK™ >>>>>" 38 | 39 | echo -e "${RED}" 40 | echo " ~// Rom syncing Script //~" 41 | 42 | echo -e "${YELLOW}" 43 | echo "Enter full directory of rom folder" 44 | echo -e "${RESET}" 45 | read DIR 46 | 47 | cd "$DIR" 48 | 49 | echo -e "${YELLOW}" 50 | echo "Enter the link of rom manifest: " 51 | echo -e "${RESET}" 52 | read ROM_MANIFEST 53 | echo -e "${YELLOW}" 54 | echo "====================================" 55 | echo "Enter the branch: " 56 | echo -e "${RESET}" 57 | read BRANCH_NAME 58 | echo -e "${YELLOW}" 59 | echo "====================================" 60 | 61 | echo "Do you need an optimised sync?" 62 | echo "This will shallow clone all repos" 63 | echo -e "${GREEN}" 64 | echo "Pressing n will do a normal sync" 65 | echo "====================================" 66 | echo -e "${YELLOW}" 67 | read -p "y or n " -n 1 -r 68 | if [[ ! $REPLY =~ ^[Yy]$ ]] 69 | then 70 | repo init -u "$ROM_MANIFEST" -b "$BRANCH_NAME" 71 | echo -e "${GREEN}" 72 | echo "====================================" 73 | echo " Syncing repo. This may take a while depending on your internet speed : " 74 | echo "====================================" 75 | echo -e "${RESET}" 76 | repo sync --force-sync -j$(nproc --all) 77 | else 78 | repo init --depth=1 -u "$ROM_MANIFEST" -b "$BRANCH_NAME" 79 | echo -e "${GREEN}" 80 | echo "====================================" 81 | echo " Syncing repo. This may take a while depending on your internet speed : " 82 | echo "====================================" 83 | echo -e "${RESET}" 84 | repo sync -c --force-sync --optimized-fetch --no-tags --no-clone-bundle --prune -j$(nproc --all) 85 | fi 86 | 87 | echo -e "${CYAN}" 88 | echo "<<<<< © RB INTERNATIONAL NETWORK™ >>>>>" 89 | echo -e "${RESET}" 90 | -------------------------------------------------------------------------------- /upload.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (C) 2020 RB INTERNATIONAL NETWORK 4 | # 5 | # An Open Source Project 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # 19 | 20 | RESET='\033[0m' # Text Reset 21 | BLACK='\033[0;30m' # Black 22 | RED='\033[0;31m' # Red 23 | GREEN='\033[0;32m' # Green 24 | YELLOW='\033[0;33m' # Yellow 25 | BLUE='\033[0;34m' # Blue 26 | PURPLE='\033[0;35m' # Purple 27 | CYAN='\033[0;36m' # Cyan 28 | WHITE='\033[0;37m' # White 29 | 30 | echo -e "${CYAN}" 31 | echo "<<<<< © RB INTERNATIONAL NETWORK™ >>>>>" 32 | 33 | echo -e "${RED}" 34 | echo " ~// Rom uploading Script //~" 35 | 36 | FILE_NAME="" 37 | ROM_DIR="" 38 | CODENAME="" 39 | 40 | echo -e "${GREEN}" 41 | chmod +x assets/gdrive 42 | sudo install assets/gdrive /usr/local/bin/gdrive 43 | 44 | echo -e "${YELLOW}" 45 | echo "====================================" 46 | echo "Enter full rom directory" 47 | echo "eg, /home/jaishnavprasad/sakura" 48 | echo -e "${RESET}" 49 | read ROM_DIR 50 | 51 | echo -e "${YELLOW}" 52 | echo "====================================" 53 | echo "Enter codename" 54 | echo "eg, begonia, CPH1859 etc..." 55 | echo -e "${RESET}" 56 | read CODENAME 57 | 58 | cd "$ROM_DIR"/out/target/product/"$CODENAME" 59 | ls 60 | echo -e "${YELLOW}" 61 | echo "==============================================================" 62 | echo "==============================================================" 63 | echo "Enter the rom name" 64 | echo -e "${RESET}" 65 | read FILE_NAME 66 | 67 | echo -e "${YELLOW}" 68 | echo "====================================" 69 | echo " Press y to use gdrive " 70 | echo " Press n to use we transfer" 71 | echo "====================================" 72 | echo -e "${RESET}" 73 | read -p " y or n " -n 1 -r 74 | if [[ ! $REPLY =~ ^[Yy]$ ]] 75 | then 76 | if [ ! -d transfer ] 77 | then 78 | curl -sL https://git.io/file-transfer | sh 79 | fi 80 | ./transfer wet "$ROM_DIR"/out/target/product/"$CODENAME"/"$FILE_NAME" 81 | else 82 | gdrive upload "$ROM_DIR"/out/target/product/"$CODENAME"/"$FILE_NAME" 83 | fi 84 | 85 | 86 | #curl https://bashupload.com/"$FILE_NAME" --data-binary @"$ROM_DIR"/out/target/product/"$CODENAME"/"$FILE_NAME" 87 | echo -e "${GREEN}" 88 | echo "Operation sucessful!, file has been uploaded" 89 | 90 | echo -e "${CYAN}" 91 | echo "<<<<< © RB INTERNATIONAL NETWORK™ >>>>>" 92 | echo -e "${RESET}" 93 | -------------------------------------------------------------------------------- /git.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (C) 2020 RB INTERNATIONAL NETWORK 4 | # 5 | # An Open Source Project 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # 19 | 20 | RESET='\033[0m' # Text Reset 21 | BLACK='\033[0;30m' # Black 22 | RED='\033[0;31m' # Red 23 | GREEN='\033[0;32m' # Green 24 | YELLOW='\033[0;33m' # Yellow 25 | BLUE='\033[0;34m' # Blue 26 | PURPLE='\033[0;35m' # Purple 27 | CYAN='\033[0;36m' # Cyan 28 | WHITE='\033[0;37m' # White 29 | 30 | echo -e "${CYAN}" 31 | echo "<<<<< © RB INTERNATIONAL NETWORK™ >>>>>" 32 | 33 | echo -e "${RED}" 34 | echo " ~// Github environment script //~" 35 | 36 | echo -e "${RESET}" 37 | 38 | GIT_USERNAME="" 39 | GIT_MAIL="" 40 | 41 | echo -e "${YELLOW}" 42 | echo "Enter GitHub Username: " 43 | echo -e "${RESET}" 44 | read GIT_USERNAME 45 | echo -e "${YELLOW}" 46 | echo "====================================" 47 | echo "Enter GitHub Email: " 48 | echo -e "${RESET}" 49 | read GIT_MAIL 50 | 51 | echo -e "${YELLOW}" 52 | # Username 53 | echo -e "\n================== Adding Username ==================\n" 54 | git config --global user.name "$GIT_USERNAME" 55 | echo -e "${GREEN}" 56 | echo -e "\n Added your username!\n" 57 | 58 | echo -e "${YELLOW}" 59 | #Email 60 | echo -e "\n================== Adding Email ==================\n" 61 | git config --global user.email "$GIT_MAIL" 62 | echo -e "${GREEN}" 63 | echo -e "\n Added your email!\n" 64 | 65 | echo -e "${YELLOW}" 66 | #List Settings 67 | echo -e "\n================== List Settings ==================\n" 68 | echo -e "${RESET}" 69 | git config --list 70 | 71 | echo -e "${YELLOW}" 72 | #Aliases 73 | echo -e "\n================== Added Aliases ==================\n" 74 | git config --global alias.cp cherry-pick 75 | git config --global alias.rb rebase 76 | git config --global alias.cm commit 77 | git config --global alias.f fetch 78 | git config --global alias.co checkout 79 | git config --global alias.rv revert 80 | git config --global alias.b branch 81 | git config --global alias.s status 82 | git config --global alias.cpc "cherry-pick --continue" 83 | git config --global alias.cpa "cherry-pick --abort" 84 | 85 | echo -e "${YELLOW}" 86 | echo "Now u can use shortcuts for git commands!" 87 | echo -e "${GREEN}" 88 | echo "----------------------------------------------------------" 89 | echo "- ====================================================== -" 90 | echo "- | For git cherry-pick ------ u can use git cp | -" 91 | echo "- | For git rebase ------ u can use git rb | -" 92 | echo "- | For git commit ------ u can use git cm | -" 93 | echo "- | For git fetch ------ u can use git f | -" 94 | echo "- | For git checkout ------ u can use git co | -" 95 | echo "- | For git revert ------ u can use git rv | -" 96 | echo "- | For git branch ------ u can use git b | -" 97 | echo "- | For git status ------ u can use git s | -" 98 | echo "- | For git cherry-pick --continue u can use git cpc | -" 99 | echo "- | For git cherry-pick --abort u can use git cpa | -" 100 | echo "- ====================================================== -" 101 | echo "----------------------------------------------------------" 102 | 103 | echo -e "${CYAN}" 104 | echo "<<<<< © RB INTERNATIONAL NETWORK™ >>>>>" 105 | echo -e "${RESET}" 106 | -------------------------------------------------------------------------------- /init.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (C) 2020 RB INTERNATIONAL NETWORK 4 | # 5 | # An Open Source Project 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # 19 | 20 | RESET='\033[0m' # Text Reset 21 | BLACK='\033[0;30m' # Black 22 | RED='\033[0;31m' # Red 23 | GREEN='\033[0;32m' # Green 24 | YELLOW='\033[0;33m' # Yellow 25 | BLUE='\033[0;34m' # Blue 26 | PURPLE='\033[0;35m' # Purple 27 | CYAN='\033[0;36m' # Cyan 28 | WHITE='\033[0;37m' # White 29 | 30 | echo -e "${CYAN}" 31 | echo "<<<<< © RB INTERNATIONAL NETWORK™ >>>>>" 32 | 33 | echo -e "${RED}" 34 | echo " ~// Device trees initialization Script //~" 35 | 36 | DEVICE_TREE="" 37 | DEVICE_TREE_BRANCH="" 38 | 39 | BRAND="" 40 | CODENAME="" 41 | 42 | VENDOR_TREE="" 43 | VENDOR_TREE_BRANCH="" 44 | 45 | KERNEL_TREE="" 46 | KERNEL_TREE_BRANCH="" 47 | 48 | CHIPSET="" 49 | ROM_DIR="" 50 | 51 | echo -e "${YELLOW}" 52 | echo "Enter full rom directory: " 53 | echo "eg, /home/cyberjalagam/potato" 54 | echo -e "${RESET}" 55 | read ROM_DIR 56 | 57 | echo -e "${YELLOW}" 58 | echo "====================================" 59 | echo "Enter codename: " 60 | echo -e "${RESET}" 61 | read CODENAME 62 | 63 | echo -e "${YELLOW}" 64 | echo "====================================" 65 | echo "Enter Brand: " 66 | echo -e "${RESET}" 67 | read BRAND 68 | 69 | echo -e "${YELLOW}" 70 | echo "====================================" 71 | echo "Enter chipset (for kernel path): " 72 | echo -e "${RESET}" 73 | read CHIPSET 74 | 75 | echo -e "${YELLOW}" 76 | echo "====================================" 77 | echo "Enter Device tree link: " 78 | echo -e "${RESET}" 79 | read DEVICE_TREE 80 | 81 | echo -e "${YELLOW}" 82 | echo "====================================" 83 | echo "Enter Device tree branch: " 84 | echo -e "${RESET}" 85 | read DEVICE_TREE_BRANCH 86 | 87 | echo -e "${YELLOW}" 88 | echo "====================================" 89 | echo "Enter Vendor tree link: " 90 | echo -e "${RESET}" 91 | read VENDOR_TREE 92 | 93 | echo -e "${YELLOW}" 94 | echo "====================================" 95 | echo "Enter Vendor tree branch: " 96 | echo -e "${RESET}" 97 | read VENDOR_TREE_BRANCH 98 | 99 | echo -e "${YELLOW}" 100 | echo "====================================" 101 | echo "Enter Kernel tree link: " 102 | echo -e "${RESET}" 103 | read KERNEL_TREE 104 | 105 | echo -e "${YELLOW}" 106 | echo "====================================" 107 | echo "Enter Kernel tree branch: " 108 | echo -e "${RESET}" 109 | read KERNEL_TREE_BRANCH 110 | 111 | cd "$ROM_DIR" 112 | echo -e "${YELLOW}" 113 | # Device tree 114 | echo -e "\n================== Clonning device tree ==================\n" 115 | echo -e "${GREEN}" 116 | git clone "$DEVICE_TREE" -b "$DEVICE_TREE_BRANCH" device/"$BRAND"/"$CODENAME" 117 | 118 | # Vendor Tree 119 | echo -e "${YELLOW}" 120 | echo -e "\n================== Clonning vendor tree ==================\n" 121 | echo -e "${GREEN}" 122 | git clone "$VENDOR_TREE" -b "$VENDOR_TREE_BRANCH" vendor/"$BRAND"/"$CODENAME" 123 | 124 | # Kernel Tree 125 | echo -e "${YELLOW}" 126 | echo -e "\n================== Clonning kernel tree ==================\n" 127 | echo -e "${GREEN}" 128 | git clone "$KERNEL_TREE" -b "$KERNEL_TREE_BRANCH" kernel/"$BRAND"/"$CHIPSET" 129 | 130 | echo -e "${YELLOW}" 131 | echo -e "\n Done!\n" 132 | 133 | echo -e "${CYAN}" 134 | echo "<<<<< © RB INTERNATIONAL NETWORK™ >>>>>" 135 | echo -e "${RESET}" 136 | -------------------------------------------------------------------------------- /patches/WifiManager:Add-StaState-API.patch: -------------------------------------------------------------------------------- 1 | From a2c6a3997cdb4598c654b0dea6824286a5a3f727 Mon Sep 17 00:00:00 2001 2 | From: Kshitij Gupta 3 | Date: Wed, 10 Jun 2020 14:19:12 +0000 4 | Subject: [PATCH] WifiManager: Add StaState API 5 | 6 | - Reversed out from miui_BEGONIAININGlobal_V11.0.2.0.QGGINXM_7e11a54a70_10.0 7 | 8 | Change-Id: I7309906d775f45c7ea42b3324679a0f7b776a1c9 9 | --- 10 | .../android/net/wifi/IStaStateCallback.aidl | 28 ++++++++ 11 | wifi/java/android/net/wifi/IWifiManager.aidl | 5 ++ 12 | wifi/java/android/net/wifi/WifiManager.java | 65 +++++++++++++++++++ 13 | 3 files changed, 98 insertions(+) 14 | create mode 100644 wifi/java/android/net/wifi/IStaStateCallback.aidl 15 | 16 | diff --git a/wifi/java/android/net/wifi/IStaStateCallback.aidl b/wifi/java/android/net/wifi/IStaStateCallback.aidl 17 | new file mode 100644 18 | index 0000000000000..fc4bd6c9f22c8 19 | --- /dev/null 20 | +++ b/wifi/java/android/net/wifi/IStaStateCallback.aidl 21 | @@ -0,0 +1,28 @@ 22 | +/* 23 | + * Copyright (C) 2020 The Potato Open Sauce Project 24 | + * 25 | + * Licensed under the Apache License, Version 2.0 (the "License"); 26 | + * you may not use this file except in compliance with the License. 27 | + * You may obtain a copy of the License at 28 | + * 29 | + * http://www.apache.org/licenses/LICENSE-2.0 30 | + * 31 | + * Unless required by applicable law or agreed to in writing, software 32 | + * distributed under the License is distributed on an "AS IS" BASIS, 33 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 34 | + * See the License for the specific language governing permissions and 35 | + * limitations under the License. 36 | + */ 37 | + 38 | +package android.net.wifi; 39 | + 40 | +/** 41 | + * @hide 42 | + */ 43 | +oneway interface IStaStateCallback 44 | +{ 45 | + /** 46 | + * @hide 47 | + */ 48 | + void onStaToBeOff(); 49 | +} 50 | diff --git a/wifi/java/android/net/wifi/IWifiManager.aidl b/wifi/java/android/net/wifi/IWifiManager.aidl 51 | index 5063ad66e446b..aa8b69e00df98 100644 52 | --- a/wifi/java/android/net/wifi/IWifiManager.aidl 53 | +++ b/wifi/java/android/net/wifi/IWifiManager.aidl 54 | @@ -33,6 +33,7 @@ import android.net.wifi.IOnWifiUsabilityStatsListener; 55 | import android.net.wifi.IScanResultsCallback; 56 | import android.net.wifi.ISoftApCallback; 57 | import android.net.wifi.ISuggestionConnectionStatusListener; 58 | +import android.net.wifi.IStaStateCallback; 59 | import android.net.wifi.ITrafficStateCallback; 60 | import android.net.wifi.IWifiConnectedNetworkScorer; 61 | import android.net.wifi.ScanResult; 62 | @@ -275,4 +276,8 @@ interface IWifiManager 63 | void setAutoWakeupEnabled(boolean enable); 64 | 65 | boolean isAutoWakeupEnabled(); 66 | + 67 | + void registerStaStateCallback(in IBinder binder, in IStaStateCallback callback, int callbackIdentifier); 68 | + 69 | + void unregisterStaStateCallback(int callbackIdentifier); 70 | } 71 | diff --git a/wifi/java/android/net/wifi/WifiManager.java b/wifi/java/android/net/wifi/WifiManager.java 72 | index fb6af5b550b01..c75ca199b2a96 100644 73 | --- a/wifi/java/android/net/wifi/WifiManager.java 74 | +++ b/wifi/java/android/net/wifi/WifiManager.java 75 | @@ -5270,6 +5270,71 @@ public void unregisterTrafficStateCallback(@NonNull TrafficStateCallback callbac 76 | } 77 | } 78 | 79 | + /** 80 | + * @hide 81 | + */ 82 | + public interface StaStateCallback { 83 | + /** 84 | + * @hide 85 | + */ 86 | + void onStaToBeOff(); 87 | + } 88 | + 89 | + /** 90 | + * @hide 91 | + */ 92 | + private class StaStateCallbackProxy extends IStaStateCallback.Stub { 93 | + private final Handler mHandler; 94 | + private final StaStateCallback mCallback; 95 | + 96 | + StaStateCallbackProxy(Looper looper, StaStateCallback callback) { 97 | + mHandler = new Handler(looper); 98 | + mCallback = callback; 99 | + } 100 | + 101 | + @Override 102 | + public void onStaToBeOff() { 103 | + if (mVerboseLoggingEnabled) { 104 | + Log.v(TAG, "StaStateCallbackProxy: onStaToBeOff"); 105 | + } 106 | + mHandler.post(() -> { 107 | + mCallback.onStaToBeOff(); 108 | + }); 109 | + } 110 | + } 111 | + 112 | + /** 113 | + * @hide 114 | + */ 115 | + public void registerStaStateCallback(@NonNull StaStateCallback callback, 116 | + @Nullable Handler handler) { 117 | + if (callback == null) throw new IllegalArgumentException("callback cannot be null"); 118 | + Log.v(TAG, "registerStaStateCallback: callback=" + callback + ", handler=" + handler); 119 | + 120 | + Looper looper = (handler == null) ? mContext.getMainLooper() : handler.getLooper(); 121 | + Binder binder = new Binder(); 122 | + try { 123 | + mService.registerStaStateCallback( 124 | + binder, new StaStateCallbackProxy(looper, callback), callback.hashCode()); 125 | + } catch (RemoteException e) { 126 | + throw e.rethrowFromSystemServer(); 127 | + } 128 | + } 129 | + 130 | + /** 131 | + * @hide 132 | + */ 133 | + public void unregisterStaStateCallback(@NonNull StaStateCallback callback) { 134 | + if (callback == null) throw new IllegalArgumentException("callback cannot be null"); 135 | + Log.v(TAG, "unregisterStaStateCallback: callback=" + callback); 136 | + 137 | + try { 138 | + mService.unregisterStaStateCallback(callback.hashCode()); 139 | + } catch (RemoteException e) { 140 | + throw e.rethrowFromSystemServer(); 141 | + } 142 | + } 143 | + 144 | /** 145 | * Helper method to update the local verbose logging flag based on the verbose logging 146 | * level from wifi service. 147 | -------------------------------------------------------------------------------- /patches/Partially-Revert-Remove-references-to-deprecated-device.patch: -------------------------------------------------------------------------------- 1 | From 2460ed435a3b20c83756abee667fe2d4eb1584c8 Mon Sep 17 00:00:00 2001 2 | From: Kshitij Gupta 3 | Date: Mon, 28 Dec 2020 21:23:12 +0530 4 | Subject: [PATCH] Partially Revert "Remove references to deprecated device 5 | config" 6 | 7 | This reverts commit e2ac4f5ca0bed63eecd2a071705091608fbdcdc3. 8 | 9 | Change-Id: I05f50e14d04453773093f253bbbebadb879389c1 10 | Signed-off-by: LordShenron 11 | --- 12 | src/java/com/android/ims/ImsServiceBase.java | 222 +++++++++++++++++++ 13 | 1 file changed, 222 insertions(+) 14 | create mode 100644 src/java/com/android/ims/ImsServiceBase.java 15 | 16 | diff --git a/src/java/com/android/ims/ImsServiceBase.java b/src/java/com/android/ims/ImsServiceBase.java 17 | new file mode 100644 18 | index 0000000..0a15c9d 19 | --- /dev/null 20 | +++ b/src/java/com/android/ims/ImsServiceBase.java 21 | @@ -0,0 +1,222 @@ 22 | +/* 23 | + * Copyright (C) 2015 The Android Open Source Project 24 | + * 25 | + * Licensed under the Apache License, Version 2.0 (the "License"); 26 | + * you may not use this file except in compliance with the License. 27 | + * You may obtain a copy of the License at 28 | + * 29 | + * http://www.apache.org/licenses/LICENSE-2.0 30 | + * 31 | + * Unless required by applicable law or agreed to in writing, software 32 | + * distributed under the License is distributed on an "AS IS" BASIS, 33 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 34 | + * See the License for the specific language governing permissions and 35 | + * limitations under the License. 36 | + */ 37 | + 38 | +package com.android.ims; 39 | + 40 | +import android.app.PendingIntent; 41 | + 42 | +import android.telephony.ims.ImsCallProfile; 43 | +import com.android.ims.internal.IImsCallSession; 44 | +import com.android.ims.internal.IImsCallSessionListener; 45 | +import com.android.ims.internal.IImsConfig; 46 | +import com.android.ims.internal.IImsEcbm; 47 | +import com.android.ims.internal.IImsMultiEndpoint; 48 | +import com.android.ims.internal.IImsRegistrationListener; 49 | +import com.android.ims.internal.IImsService; 50 | +import com.android.ims.internal.IImsUt; 51 | +import android.os.Message; 52 | + 53 | +/* 54 | + * Stub for IImsService interface. To enable forward compatibility during 55 | + * development - empty APIs should not be deployed. 56 | + * 57 | + * @hide 58 | + */ 59 | +public abstract class ImsServiceBase { 60 | + /** 61 | + * IImsService stub implementation. 62 | + */ 63 | + private final class ImsServiceBinder extends IImsService.Stub { 64 | + @Override 65 | + public int open(int phoneId, int serviceClass, PendingIntent incomingCallIntent, 66 | + IImsRegistrationListener listener) { 67 | + return onOpen(phoneId, serviceClass, incomingCallIntent, listener); 68 | + } 69 | + 70 | + @Override 71 | + public void close(int serviceId) { 72 | + onClose(serviceId); 73 | + } 74 | + 75 | + @Override 76 | + public boolean isConnected(int serviceId, int serviceType, int callType) { 77 | + return onIsConnected(serviceId, serviceType, callType); 78 | + } 79 | + 80 | + @Override 81 | + public boolean isOpened(int serviceId) { 82 | + return onIsOpened(serviceId); 83 | + } 84 | + 85 | + @Override 86 | + public void setRegistrationListener(int serviceId, IImsRegistrationListener listener) { 87 | + onSetRegistrationListener(serviceId, listener); 88 | + } 89 | + 90 | + @Override 91 | + public void addRegistrationListener(int serviceId, int serviceType, IImsRegistrationListener listener) { 92 | + onAddRegistrationListener(serviceId, serviceType, listener); 93 | + } 94 | + 95 | + 96 | + @Override 97 | + public ImsCallProfile createCallProfile(int serviceId, int serviceType, int callType) { 98 | + return onCreateCallProfile(serviceId, serviceType, callType); 99 | + } 100 | + 101 | + @Override 102 | + public IImsCallSession createCallSession(int serviceId, ImsCallProfile profile, 103 | + IImsCallSessionListener listener) { 104 | + return onCreateCallSession(serviceId, profile, listener); 105 | + } 106 | + 107 | + @Override 108 | + public IImsCallSession getPendingCallSession(int serviceId, String callId) { 109 | + return onGetPendingCallSession(serviceId, callId); 110 | + } 111 | + 112 | + @Override 113 | + public IImsUt getUtInterface(int serviceId) { 114 | + return onGetUtInterface(serviceId); 115 | + } 116 | + 117 | + @Override 118 | + public IImsConfig getConfigInterface(int phoneId) { 119 | + return onGetConfigInterface(phoneId); 120 | + } 121 | + 122 | + @Override 123 | + public void turnOnIms(int phoneId) { 124 | + onTurnOnIms(phoneId); 125 | + } 126 | + 127 | + @Override 128 | + public void turnOffIms(int phoneId) { 129 | + onTurnOffIms(phoneId); 130 | + } 131 | + 132 | + @Override 133 | + public IImsEcbm getEcbmInterface(int serviceId) { 134 | + return onGetEcbmInterface(serviceId); 135 | + } 136 | + 137 | + @Override 138 | + public void setUiTTYMode(int serviceId, int uiTtyMode, Message onComplete) { 139 | + onSetUiTTYMode(serviceId, uiTtyMode, onComplete); 140 | + } 141 | + 142 | + @Override 143 | + public IImsMultiEndpoint getMultiEndpointInterface(int serviceId) { 144 | + return onGetMultiEndpointInterface(serviceId); 145 | + } 146 | + } 147 | + 148 | + private ImsServiceBinder mBinder; 149 | + 150 | + public ImsServiceBinder getBinder() { 151 | + if (mBinder == null) { 152 | + mBinder = new ImsServiceBinder(); 153 | + } 154 | + 155 | + return mBinder; 156 | + } 157 | + 158 | + protected int onOpen(int phoneId, int serviceClass, PendingIntent incomingCallIntent, 159 | + IImsRegistrationListener listener) { 160 | + // no-op 161 | + 162 | + return 0; // DUMMY VALUE 163 | + } 164 | + 165 | + protected void onClose(int serviceId) { 166 | + // no-op 167 | + } 168 | + 169 | + protected boolean onIsConnected(int serviceId, int serviceType, int callType) { 170 | + // no-op 171 | + 172 | + return false; // DUMMY VALUE 173 | + } 174 | + 175 | + protected boolean onIsOpened(int serviceId) { 176 | + // no-op 177 | + 178 | + return false; // DUMMY VALUE 179 | + } 180 | + 181 | + protected void onSetRegistrationListener(int serviceId, IImsRegistrationListener listener) { 182 | + // no-op 183 | + } 184 | + 185 | + protected void onAddRegistrationListener(int serviceId, int serviceType, IImsRegistrationListener listener) { 186 | + // no-op 187 | + } 188 | + 189 | + protected ImsCallProfile onCreateCallProfile(int serviceId, int serviceType, int callType) { 190 | + // no-op 191 | + 192 | + return null; 193 | + } 194 | + 195 | + protected IImsCallSession onCreateCallSession(int serviceId, ImsCallProfile profile, 196 | + IImsCallSessionListener listener) { 197 | + // no-op 198 | + 199 | + return null; 200 | + } 201 | + 202 | + protected IImsCallSession onGetPendingCallSession(int serviceId, String callId) { 203 | + // no-op 204 | + 205 | + return null; 206 | + } 207 | + 208 | + protected IImsUt onGetUtInterface(int serviceId) { 209 | + // no-op 210 | + 211 | + return null; 212 | + } 213 | + 214 | + protected IImsConfig onGetConfigInterface(int phoneId) { 215 | + // no-op 216 | + 217 | + return null; 218 | + } 219 | + 220 | + protected void onTurnOnIms(int phoneId) { 221 | + // no-op 222 | + } 223 | + 224 | + protected void onTurnOffIms(int phoneId) { 225 | + // no-op 226 | + } 227 | + 228 | + protected IImsEcbm onGetEcbmInterface(int serviceId) { 229 | + // no-op 230 | + 231 | + return null; 232 | + } 233 | + 234 | + protected void onSetUiTTYMode(int serviceId, int uiTtyMode, Message onComplete) { 235 | + // no-op 236 | + } 237 | + 238 | + protected IImsMultiEndpoint onGetMultiEndpointInterface(int serviceId) { 239 | + // no-op 240 | + return null; 241 | + } 242 | +} 243 | + 244 | -------------------------------------------------------------------------------- /patches/wifi:Add-StaState-API.patch: -------------------------------------------------------------------------------- 1 | From a6b2db1a5875fc7156ef7736bd5f3075e132914a Mon Sep 17 00:00:00 2001 2 | From: Kshitij Gupta 3 | Date: Sun, 21 Jun 2020 10:36:36 +0000 4 | Subject: [PATCH] wifi: Add StaState API 5 | 6 | Change-Id: I1f51ae6189a909132f566ebddfb6f9cbdf9acb2d 7 | --- 8 | .../android/server/wifi/ActiveModeWarden.java | 3 + 9 | .../android/server/wifi/BaseWifiService.java | 12 ++++ 10 | .../com/android/server/wifi/WifiInjector.java | 7 ++ 11 | .../android/server/wifi/WifiServiceImpl.java | 29 ++++++++ 12 | .../server/wifi/WifiStaStateNotifier.java | 72 +++++++++++++++++++ 13 | 5 files changed, 123 insertions(+) 14 | create mode 100644 service/java/com/android/server/wifi/WifiStaStateNotifier.java 15 | 16 | diff --git a/service/java/com/android/server/wifi/ActiveModeWarden.java b/service/java/com/android/server/wifi/ActiveModeWarden.java 17 | index cf54e328b..e370a8c02 100644 18 | --- a/service/java/com/android/server/wifi/ActiveModeWarden.java 19 | +++ b/service/java/com/android/server/wifi/ActiveModeWarden.java 20 | @@ -966,4 +966,7 @@ public boolean processMessageFiltered(Message msg) { 21 | } 22 | } 23 | } 24 | + 25 | + public void registerStaEventCallback() {} 26 | + public void unregisterStaEventCallback() {} 27 | } 28 | diff --git a/service/java/com/android/server/wifi/BaseWifiService.java b/service/java/com/android/server/wifi/BaseWifiService.java 29 | index 7614cf6eb..9e2f93561 100644 30 | --- a/service/java/com/android/server/wifi/BaseWifiService.java 31 | +++ b/service/java/com/android/server/wifi/BaseWifiService.java 32 | @@ -27,6 +27,7 @@ 33 | import android.net.wifi.IOnWifiUsabilityStatsListener; 34 | import android.net.wifi.IScanResultsCallback; 35 | import android.net.wifi.ISoftApCallback; 36 | +import android.net.wifi.IStaStateCallback; 37 | import android.net.wifi.ISuggestionConnectionStatusListener; 38 | import android.net.wifi.ITrafficStateCallback; 39 | import android.net.wifi.ITxPacketCountListener; 40 | @@ -677,4 +678,15 @@ public void setAutoWakeupEnabled(boolean enable) { 41 | public boolean isAutoWakeupEnabled() { 42 | throw new UnsupportedOperationException(); 43 | } 44 | + 45 | + @Override 46 | + public void registerStaStateCallback( 47 | + IBinder binder, IStaStateCallback callback, int callbackIdentifier) { 48 | + throw new UnsupportedOperationException(); 49 | + } 50 | + 51 | + @Override 52 | + public void unregisterStaStateCallback(int callbackIdentifier) { 53 | + throw new UnsupportedOperationException(); 54 | + } 55 | } 56 | diff --git a/service/java/com/android/server/wifi/WifiInjector.java b/service/java/com/android/server/wifi/WifiInjector.java 57 | index 993debba5..5d8d85ae5 100644 58 | --- a/service/java/com/android/server/wifi/WifiInjector.java 59 | +++ b/service/java/com/android/server/wifi/WifiInjector.java 60 | @@ -106,6 +106,7 @@ 61 | private final ScoringParams mScoringParams; 62 | private final ClientModeImpl mClientModeImpl; 63 | private final ActiveModeWarden mActiveModeWarden; 64 | + private final WifiStaStateNotifier mWifiStaStateNotifier; 65 | private final WifiSettingsStore mSettingsStore; 66 | private OpenNetworkNotifier mOpenNetworkNotifier; 67 | private final WifiLockManager mLockManager; 68 | @@ -382,6 +383,8 @@ public WifiInjector(WifiContext context) { 69 | mWifiNetworkSelector.registerNetworkNominator(mNetworkSuggestionNominator); 70 | mWifiNetworkSelector.registerNetworkNominator(mScoredNetworkNominator); 71 | 72 | + mWifiStaStateNotifier = new WifiStaStateNotifier(wifiLooper, this); 73 | + 74 | mClientModeImpl.start(); 75 | } 76 | 77 | @@ -479,6 +482,10 @@ public ActiveModeWarden getActiveModeWarden() { 78 | return mActiveModeWarden; 79 | } 80 | 81 | + public WifiStaStateNotifier getWifiStaStateNotifier() { 82 | + return mWifiStaStateNotifier; 83 | + } 84 | + 85 | public WifiSettingsStore getWifiSettingsStore() { 86 | return mSettingsStore; 87 | } 88 | diff --git a/service/java/com/android/server/wifi/WifiServiceImpl.java b/service/java/com/android/server/wifi/WifiServiceImpl.java 89 | index 5019f54e8..6f88d592d 100644 90 | --- a/service/java/com/android/server/wifi/WifiServiceImpl.java 91 | +++ b/service/java/com/android/server/wifi/WifiServiceImpl.java 92 | @@ -60,6 +60,7 @@ 93 | import android.net.wifi.IScanResultsCallback; 94 | import android.net.wifi.ISoftApCallback; 95 | import android.net.wifi.ISuggestionConnectionStatusListener; 96 | +import android.net.wifi.IStaStateCallback; 97 | import android.net.wifi.ITrafficStateCallback; 98 | import android.net.wifi.IWifiConnectedNetworkScorer; 99 | import android.net.wifi.ScanResult; 100 | @@ -188,6 +189,8 @@ 101 | private final WifiConfigManager mWifiConfigManager; 102 | private final PasspointManager mPasspointManager; 103 | private final WifiLog mLog; 104 | + private WifiStaStateNotifier mWifiStaStateNotifier; 105 | + 106 | /** 107 | * Verbose logging flag. Toggled by developer options. 108 | */ 109 | @@ -329,6 +332,7 @@ public WifiServiceImpl(Context context, WifiInjector wifiInjector, AsyncChannel 110 | mWifiScoreCard = mWifiInjector.getWifiScoreCard(); 111 | mMemoryStoreImpl = new MemoryStoreImpl(mContext, mWifiInjector, 112 | mWifiScoreCard, mWifiInjector.getWifiHealthMonitor()); 113 | + mWifiStaStateNotifier = mWifiInjector.getWifiStaStateNotifier(); 114 | } 115 | 116 | /** 117 | @@ -3729,6 +3733,31 @@ public void unregisterTrafficStateCallback(int callbackIdentifier) { 118 | mWifiTrafficPoller.removeCallback(callbackIdentifier)); 119 | } 120 | 121 | + @Override 122 | + public void registerStaStateCallback(IBinder binder, IStaStateCallback callback, 123 | + int callbackIdentifier) { 124 | + if (binder == null) { 125 | + throw new IllegalArgumentException("Binder must not be null"); 126 | + } 127 | + if (callback == null) { 128 | + throw new IllegalArgumentException("Callback must not be null"); 129 | + } 130 | + if (mVerboseLoggingEnabled) { 131 | + mLog.info("registerStaStateCallback uid=%").c(Binder.getCallingUid()).flush(); 132 | + } 133 | + mWifiThreadRunner.post(() -> 134 | + mWifiStaStateNotifier.addCallback(binder, callback, callbackIdentifier)); 135 | + } 136 | + 137 | + @Override 138 | + public void unregisterStaStateCallback(int callbackIdentifier) { 139 | + if (mVerboseLoggingEnabled) { 140 | + mLog.info("unregisterStaStateCallback uid=%").c(Binder.getCallingUid()).flush(); 141 | + } 142 | + mWifiThreadRunner.post(() -> 143 | + mWifiStaStateNotifier.removeCallback(callbackIdentifier)); 144 | + } 145 | + 146 | private long getSupportedFeaturesInternal() { 147 | final AsyncChannel channel = mClientModeImplChannel; 148 | long supportedFeatureSet = 0L; 149 | diff --git a/service/java/com/android/server/wifi/WifiStaStateNotifier.java b/service/java/com/android/server/wifi/WifiStaStateNotifier.java 150 | new file mode 100644 151 | index 000000000..05dd87993 152 | --- /dev/null 153 | +++ b/service/java/com/android/server/wifi/WifiStaStateNotifier.java 154 | @@ -0,0 +1,72 @@ 155 | +/* 156 | + * Copyright (C) 2020 The Android Open Source Project 157 | + * 158 | + * Licensed under the Apache License, Version 2.0 (the "License"); 159 | + * you may not use this file except in compliance with the License. 160 | + * You may obtain a copy of the License at 161 | + * 162 | + * http://www.apache.org/licenses/LICENSE-2.0 163 | + * 164 | + * Unless required by applicable law or agreed to in writing, software 165 | + * distributed under the License is distributed on an "AS IS" BASIS, 166 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 167 | + * See the License for the specific language governing permissions and 168 | + * limitations under the License. 169 | + */ 170 | + 171 | +package com.android.server.wifi; 172 | + 173 | +import android.annotation.NonNull; 174 | +import android.net.wifi.IStaStateCallback; 175 | +import android.os.Handler; 176 | +import android.os.IBinder; 177 | +import android.os.Looper; 178 | +import android.os.RemoteException; 179 | +import android.util.Log; 180 | + 181 | +import com.android.server.wifi.util.ExternalCallbackTracker; 182 | + 183 | + 184 | +public class WifiStaStateNotifier { 185 | + private final ExternalCallbackTracker mRegisteredCallbacks; 186 | + private static WifiInjector mWifiInjector; 187 | + private static final String TAG = "WifiStaStateNotifier"; 188 | + private static final boolean DEBUG = false; 189 | + 190 | + WifiStaStateNotifier(@NonNull Looper looper, WifiInjector wifiInjector) { 191 | + mRegisteredCallbacks = new ExternalCallbackTracker(new Handler(looper)); 192 | + mWifiInjector = wifiInjector; 193 | + } 194 | + 195 | + public void addCallback(IBinder binder, IStaStateCallback callback, 196 | + int callbackIdentifier) { 197 | + if (DEBUG) Log.d(TAG, "addCallback"); 198 | + if (mRegisteredCallbacks.getNumCallbacks() > 0) { 199 | + if (DEBUG) Log.e(TAG, "Failed to add callback, only support single request!"); 200 | + return; 201 | + } 202 | + if (!mRegisteredCallbacks.add(binder, callback, callbackIdentifier)) { 203 | + if (DEBUG) Log.e(TAG, "Failed to add callback"); 204 | + return; 205 | + } 206 | + mWifiInjector.getActiveModeWarden().registerStaEventCallback(); 207 | + } 208 | + 209 | + public void removeCallback(int callbackIdentifier) { 210 | + if (DEBUG) Log.d(TAG, "removeCallback"); 211 | + mRegisteredCallbacks.remove(callbackIdentifier); 212 | + mWifiInjector.getActiveModeWarden().unregisterStaEventCallback(); 213 | + } 214 | + 215 | + public void onStaToBeOff() { 216 | + if (DEBUG) Log.d(TAG, "onStaToBeOff"); 217 | + for (IStaStateCallback callback : mRegisteredCallbacks.getCallbacks()) { 218 | + try { 219 | + if (DEBUG) Log.d(TAG, "callback onStaToBeOff"); 220 | + callback.onStaToBeOff(); 221 | + } catch (RemoteException e) { 222 | + // do nothing 223 | + } 224 | + } 225 | + } 226 | +} 227 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | --------------------------------------------------------------------------------