Commit 89ac8a44 by Tim Van Patten Committed by Angle LUCI CQ

Fix Loading ANGLE.apk in Android

The recent CL to remove the Settings GUI from the Android-built APK went a little too far removing Java code and emptying the AndroidManifest.xml. This resulted in ANGLE being unable to be loaded from the APK, since ANGLE was not able to respond to the intent android.app.action.ANGLE_FOR_ANDROID which indicates it contains ANGLE libraries. The AndroidManifest.xml requires various flags like android:forceQueryable="true" so the APK can be accessed by the framework. The assets/ directory was removed, which contains 'a4a_rules.json' and is required by GraphicsEnvironment. This is added back. Bug: b/187342779 Change-Id: Ic7b758c92ed12750972c7e313729276a13f76032 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2906632Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Tim Van Patten <timvp@google.com>
parent e2fc818a
...@@ -11,6 +11,26 @@ ...@@ -11,6 +11,26 @@
<application android:label="Angle for Android" <application android:label="Angle for Android"
android:extractNativeLibs="false" android:extractNativeLibs="false"
android:forceQueryable="true"
android:multiArch="true"> android:multiArch="true">
<activity android:name="com.android.angle.EmptyMainActivity"
android:label="Empty Main Activity"
android:visibleToInstantApps="true"
android:launchMode="singleTask"
android:exported="true">
<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>
</activity>
</application> </application>
</manifest> </manifest>
...@@ -505,6 +505,14 @@ def main(): ...@@ -505,6 +505,14 @@ def main():
# Add APKs with all of the root libraries # Add APKs with all of the root libraries
blueprint_targets.append(( blueprint_targets.append((
'filegroup',
{
'name': 'ANGLE_srcs',
# Only add 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'],
}))
blueprint_targets.append((
'java_defaults', 'java_defaults',
{ {
'name': 'ANGLE_java_defaults', 'name': 'ANGLE_java_defaults',
...@@ -521,6 +529,7 @@ def main(): ...@@ -521,6 +529,7 @@ def main():
# Don't compress *.json files # Don't compress *.json files
'-0 .json', '-0 .json',
], ],
'srcs': [':ANGLE_srcs'],
'plugins': ['java_api_finder',], 'plugins': ['java_api_finder',],
'privileged': True, 'privileged': True,
'product_specific': True, 'product_specific': True,
...@@ -531,6 +540,7 @@ def main(): ...@@ -531,6 +540,7 @@ def main():
'name': 'ANGLE', 'name': 'ANGLE',
'defaults': ['ANGLE_java_defaults'], 'defaults': ['ANGLE_java_defaults'],
'manifest': 'android/AndroidManifest.xml', 'manifest': 'android/AndroidManifest.xml',
'asset_dirs': ['src/android_system_settings/assets',],
})) }))
output = [ output = [
......
/*
* 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.android.angle;
import android.app.Activity;
public class EmptyMainActivity extends Activity
{
private final String TAG = this.getClass().getSimpleName();
}
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