Commit 14aaa1eb by Geoff Lang Committed by Commit Bot

Refactor ANGLE target to allow GoogleANGLE to override it.

GoogleANGLE will be signed in a different part of Android so it needs to be able to reference ANGLE's target and defaults to override certain properties. Update the manifests to request the needed permissions to use the developer options. Bug: b:142320172 Change-Id: Ia47815ab53f8de66332412efa2cc0fca3175e2cc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2096815Reviewed-by: 's avatarTim Van Patten <timvp@google.com> Commit-Queue: Geoff Lang <geofflang@chromium.org>
parent 9e5bbb38
...@@ -291,9 +291,6 @@ def library_target_to_blueprint(target, build_info): ...@@ -291,9 +291,6 @@ def library_target_to_blueprint(target, build_info):
bp = {} bp = {}
bp['name'] = gn_target_to_blueprint_target(target, target_info) bp['name'] = gn_target_to_blueprint_target(target, target_info)
if target in root_targets:
bp['visibility'] = ["//visibility:public"]
if 'sources' in target_info: if 'sources' in target_info:
bp['srcs'] = gn_sources_to_blueprint_sources(target_info['sources']) bp['srcs'] = gn_sources_to_blueprint_sources(target_info['sources'])
...@@ -423,18 +420,20 @@ def main(): ...@@ -423,18 +420,20 @@ def main():
blueprint_targets = [] blueprint_targets = []
# Set the default visibility to private
blueprint_targets.append(('package', {'default_visibility': ['//visibility:private']}))
for target in targets_to_write: for target in targets_to_write:
blueprint_targets.append(gn_target_to_blueprint(target, build_info)) blueprint_targets.append(gn_target_to_blueprint(target, build_info))
# Add APKs with all of the root libraries # Add APKs with all of the root libraries
blueprint_targets.append(('filegroup', {
'name': 'ANGLE_srcs',
'srcs': ['src/**/*.java',],
}))
blueprint_targets.append(( blueprint_targets.append((
'android_app', 'java_defaults',
{ {
'name': 'name':
'ANGLE', 'ANGLE_defaults',
'sdk_version': 'sdk_version':
'system_current', 'system_current',
'min_sdk_version': 'min_sdk_version':
...@@ -443,31 +442,47 @@ def main(): ...@@ -443,31 +442,47 @@ def main():
'both', 'both',
'use_embedded_native_libs': 'use_embedded_native_libs':
True, True,
'resource_dirs': ['src/android_system_settings/res',], 'jni_libs': [
'asset_dirs': ['src/android_system_settings/assets',], gn_target_to_blueprint_target(target, build_info[target])
'srcs': [ for target in root_targets
'src/android_system_settings/src/com/android/angle/common/*.java',
'src/android_system_settings/src/com/android/angle/*.java',
], ],
'manifest':
'src/android_system_settings/src/com/android/angle/AndroidManifest.xml',
'aaptflags': [ 'aaptflags': [
# Don't compress *.json files # Don't compress *.json files
'-0 .json', '-0 .json',
# Give com.android.angle.common Java files access to the R class # Give com.android.angle.common Java files access to the R class
'--extra-packages com.android.angle.common', '--extra-packages com.android.angle.common',
], ],
'static_libs': ['androidx.preference_preference',], 'srcs': [':ANGLE_srcs'],
'jni_libs': [
gn_target_to_blueprint_target(target, build_info[target])
for target in root_targets
],
'privileged': 'privileged':
True, True,
'owner': 'owner':
'google', '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': [
# Don't compress *.json files
'-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_defaults'],
'static_libs': ['ANGLE_library'],
'manifest': 'src/android_system_settings/src/com/android/angle/AndroidManifest.xml',
'required': ['privapp_whitelist_com.android.angle'],
}))
output = [ output = [
"""// GENERATED FILE - DO NOT EDIT. """// GENERATED FILE - DO NOT EDIT.
// Generated by %s // Generated by %s
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS" /> <uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />
<uses-sdk android:minSdkVersion="26" <uses-sdk android:minSdkVersion="26"
android:targetSdkVersion="28"> android:targetSdkVersion="28">
...@@ -30,12 +31,14 @@ ...@@ -30,12 +31,14 @@
<application android:label="Android System Angle" <application android:label="Android System Angle"
android:icon="@drawable/icon" android:icon="@drawable/icon"
android:extractNativeLibs="false" android:extractNativeLibs="false"
android:forceQueryable="true"
android:multiArch="true"> android:multiArch="true">
<activity android:name=".MainActivity" <activity android:name=".MainActivity"
android:label="@string/angle_preferences" android:label="@string/angle_preferences"
android:description="@string/angle_preferences_summary" android:description="@string/angle_preferences_summary"
android:theme="@style/Theme.Settings" android:theme="@style/Theme.Settings"
android:visibleToInstantApps="true"
android:launchMode="singleTask"> android:launchMode="singleTask">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN"/> <action android:name="android.intent.action.MAIN"/>
...@@ -61,6 +64,7 @@ ...@@ -61,6 +64,7 @@
<meta-data android:name="com.android.settings.summary" android:resource="@string/angle_preferences_summary" /> <meta-data android:name="com.android.settings.summary" android:resource="@string/angle_preferences_summary" />
<meta-data android:name="com.android.settings.order" android:value="20" /> <meta-data android:name="com.android.settings.order" android:value="20" />
<meta-data android:name="com.android.settings.profile" android:value="primary_profile_only" /> <meta-data android:name="com.android.settings.profile" android:value="primary_profile_only" />
<meta-data android:name="instantapps.clients.allowed" android:value="true" />
</activity> </activity>
<receiver android:name="com.android.angle.common.Receiver" <receiver android:name="com.android.angle.common.Receiver"
...@@ -70,5 +74,17 @@ ...@@ -70,5 +74,17 @@
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" /> <action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
</intent-filter> </intent-filter>
</receiver> </receiver>
<provider
android:name="com.android.angle.common.SearchProvider"
android:authorities="com.android.angle"
android:multiprocess="false"
android:grantUriPermissions="true"
android:permission="android.permission.READ_SEARCH_INDEXABLES"
android:exported="true">
<intent-filter>
<action android:name="android.content.action.SEARCH_INDEXABLES_PROVIDER" />
</intent-filter>
</provider>
</application> </application>
</manifest> </manifest>
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2019 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:versionCode="290000000"
android:versionName="2019-09"
package="com.google.android.angle">
<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-sdk android:minSdkVersion="29"
android:targetSdkVersion="29">
</uses-sdk>
<application android:label="Android System Angle"
android:icon="@drawable/icon"
android:extractNativeLibs="false"
android:multiArch="true">
<activity android:name=".MainActivity"
android:label="@string/angle_preferences"
android:description="@string/angle_preferences_summary"
android:theme="@style/Theme.Settings"
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.INFO"/>
</intent-filter>
<!-- Indicate that this PKG is ANGLE. -->
<intent-filter android:priority="1">
<action android:name="android.app.action.ANGLE_FOR_ANDROID" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.service.quicksettings.action.QS_TILE_PREFERENCES" />
</intent-filter>
<!-- Mark this fragment as a dynamic setting in the development category. -->
<intent-filter>
<action android:name="com.android.settings.action.IA_SETTINGS" />
</intent-filter>
<meta-data android:name="com.android.settings.category"
android:value="com.android.settings.category.ia.development" />
<meta-data android:name="com.android.settings.summary" android:resource="@string/angle_preferences_summary" />
<meta-data android:name="com.android.settings.order" android:value="20" />
<meta-data android:name="com.android.settings.profile" android:value="primary_profile_only" />
</activity>
<receiver android:name="com.android.angle.common.Receiver"
android:directBootAware="true">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
<action android:name="android.app.action.ANGLE_FOR_ANDROID_TOAST_MESSAGE" />
</intent-filter>
</receiver>
<provider
android:name="com.android.angle.common.SearchProvider"
android:authorities="com.google.android.angle"
android:multiprocess="false"
android:grantUriPermissions="true"
android:permission="android.permission.READ_SEARCH_INDEXABLES"
android:exported="true">
<intent-filter>
<action android:name="android.content.action.SEARCH_INDEXABLES_PROVIDER" />
</intent-filter>
</provider>
</application>
</manifest>
/*
* Copyright 2019 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.android.angle;
import android.app.Activity;
import android.os.Bundle;
import com.android.angle.common.*;
public class MainActivity extends Activity
{
private final String TAG = this.getClass().getSimpleName();
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.fragment);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment