From 3782c4fbdd56ebe243af4474b9e0596ddce045ee Mon Sep 17 00:00:00 2001 From: Roman Lavrov Date: Wed, 14 Sep 2022 12:39:33 -0400 Subject: [PATCH] Move Android.bp change from internal http://ag/18177202 to aosp http://ag/19953212 reverts the change from internal branch and this CL re-adds it via the ANGLE -> roll_aosp.sh -> aosp route so Android.bp will now match between the branches. Bug: b/224558229 Bug: b/232149402 Bug: b/246559064 Change-Id: I0e25670717a56985981bc241654122b113e57575 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3891548 Reviewed-by: Ian Elliott Commit-Queue: Roman Lavrov --- scripts/generate_android_bp.py | 37 ++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/scripts/generate_android_bp.py b/scripts/generate_android_bp.py index 9877cfb52..ee5cb3309 100644 --- a/scripts/generate_android_bp.py +++ b/scripts/generate_android_bp.py @@ -651,10 +651,18 @@ def main(): blueprint_targets.append(( 'filegroup', { - 'name': 'ANGLE_srcs', - # Only add EmptyMainActivity.java since we just need to be able to reply to the intent + 'name': + 'ANGLE_srcs', + # We only need EmptyMainActivity.java since we just need to be able to reply to the intent # android.app.action.ANGLE_FOR_ANDROID to indicate ANGLE is present on the device. - 'srcs': ['src/android_system_settings/src/com/android/angle/EmptyMainActivity.java'], + # However, the internal branch currently uses these files with patches in that branch. + 'srcs': [ + 'src/android_system_settings/src/com/android/angle/MainActivity.java', + 'src/android_system_settings/src/com/android/angle/common/GlobalSettings.java', + 'src/android_system_settings/src/com/android/angle/common/MainFragment.java', + 'src/android_system_settings/src/com/android/angle/common/Receiver.java', + 'src/android_system_settings/src/com/android/angle/common/SearchProvider.java', + ], })) blueprint_targets.append(( 'java_defaults', @@ -670,8 +678,8 @@ def main(): for target in root_targets ], 'aaptflags': [ - # Don't compress *.json files - '-0 .json', + '-0 .json', # Don't compress *.json files + "--extra-packages com.android.angle.common", ], 'srcs': [':ANGLE_srcs'], 'plugins': ['java_api_finder',], @@ -680,10 +688,27 @@ def main(): 'owner': 'google', })) + blueprint_targets.append(('android_library', { + 'name': 'ANGLE_library', + 'sdk_version': 'system_current', + 'min_sdk_version': sdk_version, + 'resource_dirs': ['src/android_system_settings/res',], + 'asset_dirs': ['src/android_system_settings/assets',], + 'aaptflags': ['-0 .json',], + 'manifest': 'src/android_system_settings/src/com/android/angle/AndroidManifest.xml', + 'static_libs': ['androidx.preference_preference',], + })) + blueprint_targets.append(('android_app', { 'name': 'ANGLE', 'defaults': ['ANGLE_java_defaults'], - 'manifest': 'android/AndroidManifest.xml', + 'manifest': 'src/android_system_settings/src/com/android/angle/AndroidManifest.xml', + 'static_libs': ['ANGLE_library'], + 'optimize': { + 'enabled': True, + 'shrink': True, + 'proguard_compatibility': False, + }, 'asset_dirs': ['src/android_system_settings/assets',], }))