Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge in unified nlp patch supprt and ccache typo fix #3

Merged
merged 5 commits into from
Mar 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ ENV USER root
ENV USE_CCACHE 1

# We need to specify the ccache binary since it is no longer packaged along with AOSP
ENV CACHE_EXEC /usr/bin/ccache
ENV CCACHE_EXEC /usr/bin/ccache

# ccache maximum size. It should be a number followed by an optional suffix: k,
# M, G, T (decimal), Ki, Mi, Gi or Ti (binary). The default suffix is G. Use 0
Expand Down Expand Up @@ -108,6 +108,9 @@ ENV LOGS_SUBDIR true
# example.
ENV SIGNATURE_SPOOFING "no"

# Apply the microG unifiedNLP patch
ENV SUPPORT_UNIFIEDNLP false

# Generate delta files
ENV BUILD_DELTA false

Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,21 @@ The signature spoofing patch can be optionally included with:
If in doubt, use `restricted`: note that packages that requires the
FAKE_SIGNATURE permission must be embedded in the build by adding them in

### UnifiedNLP support

If you enable signature spoofing and want to use unifiednlp from microg, the patche
to support is can be enabled using:
* `UNIFIEDNLP_SUPPORT` (false): `true` to patch in unifiednlp support

### Custom Packages

* `CUSTOM_PACKAGES`

Extra packages can be included in the tree by adding the corresponding manifest
XML to the local_manifests volume.



### Proprietary files

Some proprietary files are needed to create a LineageOS build, but they're not
Expand Down
19 changes: 19 additions & 0 deletions src/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,25 @@ for branch in ${BRANCH_NAME//,/ }; do
fi
fi

if [ "$SUPPORT_UNIFIEDNLP" = "true" ]; then
# Determine which patch should be applied to the current Android source tree
patch_name=""
case $android_version in
10* ) patch_name="android_frameworks_base-Q.patch" ;;
esac

if ! [ -z $patch_name ]; then
cd frameworks/base
echo ">> [$(date)] Applying location services patch"
patch --quiet -p1 -i "/root/location_services_patches/$patch_name"
git clean -q -f
cd ../..
else
echo ">> [$(date)] ERROR: can't find a unifiednlp support patch for the current Android version ($android_version)"
exit 1
fi
fi

echo ">> [$(date)] Setting \"$RELEASE_TYPE\" as release type"
sed -i "/\$(filter .*\$(${vendor^^}_BUILDTYPE)/,+2d" "vendor/$vendor/config/common.mk"

Expand Down
14 changes: 14 additions & 0 deletions src/location_services_patches/android_frameworks_base-N.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/services/core/java/com/android/server/ServiceWatcher.java b/services/core/java/com/android/server/ServiceWatcher.java
index 383e25a..31ae918 100644
--- a/services/core/java/com/android/server/ServiceWatcher.java
+++ b/services/core/java/com/android/server/ServiceWatcher.java
@@ -92,8 +92,7 @@ public class ServiceWatcher implements ServiceConnection {
String pkg = initialPackageNames.get(i);
try {
HashSet<Signature> set = new HashSet<Signature>();
- Signature[] sigs = pm.getPackageInfo(pkg, PackageManager.MATCH_SYSTEM_ONLY
- | PackageManager.GET_SIGNATURES).signatures;
+ Signature[] sigs = pm.getPackageInfo(pkg, PackageManager.GET_SIGNATURES).signatures;
set.addAll(Arrays.asList(sigs));
sigSets.add(set);
} catch (NameNotFoundException e) {
16 changes: 16 additions & 0 deletions src/location_services_patches/android_frameworks_base-Q.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
diff --git a/services/core/java/com/android/server/ServiceWatcher.java b/services/core/java/com/android/server/ServiceWatcher.java
index e3dc3b7a984..d72fc64dbcd 100644
--- a/services/core/java/com/android/server/ServiceWatcher.java
+++ b/services/core/java/com/android/server/ServiceWatcher.java
@@ -87,9 +87,8 @@ public class ServiceWatcher implements ServiceConnection {
ArrayList<HashSet<Signature>> signatureSets = new ArrayList<>(packageNames.length);
for (String packageName : packageNames) {
try {
- Signature[] signatures = pm.getPackageInfo(packageName,
- PackageManager.MATCH_SYSTEM_ONLY
- | PackageManager.GET_SIGNATURES).signatures;
+ Signature[] signatures = pm.getPackageInfo(packageName, PackageManager.GET_SIGNATURES).signatures;
+

HashSet<Signature> set = new HashSet<>();
Collections.addAll(set, signatures);