Skip to content

Commit

Permalink
overlay: Move webview overlay from device/vendor to GoogleWebView RRO.
Browse files Browse the repository at this point in the history
Replicate GoogleWebViewOverlay.apk that contains the webviewprovider
overlay and install it to the system partition, just like all other
Gapps.
This overlay would otherwise end up in the device-specific RRO (or built
directly into the framework when the device doesn't enforce an RRO for
framework-res) where it doesn't belong.

As far as I'm aware RRO packages have only recently been added in Oreo
(SDK 26).  A fallback for Nougat has been kept that adds the moved file
to the device overlay.

Signed-off-by: MarijnS95 <marijns95@gmail.com>
  • Loading branch information
MarijnS95 committed Dec 10, 2019
1 parent ee2f0ec commit 95a9e11
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 2 deletions.
25 changes: 25 additions & 0 deletions modules/GoogleWebViewOverlay/Android.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#
# Copyright 2018, 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.
#

LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)

LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res

LOCAL_PACKAGE_NAME := GoogleWebViewOverlay
LOCAL_SDK_VERSION := current

include $(BUILD_RRO_PACKAGE)
26 changes: 26 additions & 0 deletions modules/GoogleWebViewOverlay/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!--
/**
* Copyright (c) 2018, 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"
package="com.google.android.overlay.googlewebview"
android:versionCode="1"
android:versionName="1.0">
<overlay android:targetPackage="android"
android:isStatic="true"
android:priority="0" />
</manifest>

6 changes: 4 additions & 2 deletions opengapps-packages.mk
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,11 @@ PRODUCT_PACKAGES += $(filter-out $(GAPPS_EXCLUDED_PACKAGES),$(GAPPS_PRODUCT_PACK

ifeq ($(GAPPS_FORCE_WEBVIEW_OVERRIDES),true)
# starting with nougat, use a different overlay
ifneq ($(filter 24,$(call get-allowed-api-levels)),)
ifneq ($(filter 26,$(call get-allowed-api-levels)),)
PRODUCT_PACKAGES += GoogleWebViewOverlay
else ifneq ($(filter 24,$(call get-allowed-api-levels)),)
DEVICE_PACKAGE_OVERLAYS += \
$(GAPPS_DEVICE_FILES_PATH)/overlay/webview/24
$(GAPPS_DEVICE_FILES_PATH)/modules/GoogleWebViewOverlay/res/xml/config_webview_packages.xml
else
DEVICE_PACKAGE_OVERLAYS += \
$(GAPPS_DEVICE_FILES_PATH)/overlay/webview/21
Expand Down

0 comments on commit 95a9e11

Please sign in to comment.