GTS 5.1_R3 GtsPackageManagerHostTestCases—com.google.android.pm.gts.PackageManagerHostTest#testSettingsReadable

[DESCRIPTION]
GtsPackageManagerHostTestCases—com.google.android.pm.gts.PackageManagerHostTest#testSettingsReadable

[SOLUTION]


IT’s a google issue,we found a fix for this on AOSP, please apply r.android.com/577142. We believe the next version of GTS will add better logging that will point to that patch too. In this case it’s better to apply that patch than to add the overlay.
https://android-review.googlesource.com/c/platform/frameworks/base/+/577142

and also,you can merger the following patch into the third file:
From b6108d621002d4de708ae526e7c2bc95dabef080 Mon Sep 17 00:00:00 2001
From: Chad Brubaker
Date: Sat, 23 Dec 2017 20:06:44 -0800
Subject: [PATCH] Relax Instant Apps Settings whitelist enforcement

The strict whitelist of settings for Instant Apps is leading to too much
unintended breakage, remove the enforcement until better infrastructure
can be added to make sure settings that should be whitelisted are.

Bug: 71009655
Test: Coming in a follow up
Change-Id: Ie089dc26cec87207515d15ba881e1a0aa49a9c51

diff –git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
index 7d7f9ae..04be92e 100644
— a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
@@ -1687,18 +1687,9 @@
}

private List getSettingsNamesLocked(int settingsType, int userId) {
– boolean instantApp;
– if (UserHandle.getAppId(Binder.getCallingUid()) < Process.FIRST_APPLICATION_UID) {
– instantApp = false;
– } else {
– ApplicationInfo ai = getCallingApplicationInfoOrThrow();
– instantApp = ai.isInstantApp();
– }
– if (instantApp) {
– return new ArrayList(getInstantAppAccessibleSettings(settingsType));
– } else {
– return mSettingsRegistry.getSettingsNamesLocked(settingsType, userId);
– }
+ // Don’t enforce the instant app whitelist for now — its too prone to unintended breakage
+ // in the current form.
+ return mSettingsRegistry.getSettingsNamesLocked(settingsType, userId);
}

private void enforceSettingReadable(String settingName, int settingsType, int userId) {
@@ -1711,8 +1702,10 @@
}
if (!getInstantAppAccessibleSettings(settingsType).contains(settingName)
&& !getOverlayInstantAppAccessibleSettings(settingsType).contains(settingName)) {
– throw new SecurityException(“Setting ” + settingName + ” is not accessible from”
– + ” ephemeral package ” + getCallingPackage());
+ // Don’t enforce the instant app whitelist for now — its too prone to unintended
+ // breakage in the current form.
+ Slog.w(LOG_TAG, “Instant App ” + ai.packageName
+ + ” trying to access unexposed setting, this will be an error in the future.”);
}
}

1、./external/svox/pico/src/com/svox/pico/providers/SettingsProvider.java
2、./frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
3、./vendor/mediatek/proprietary/packages/apps/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java

作者: RESSRC

个人资源站

发表评论

电子邮件地址不会被公开。 必填项已用*标注

This site uses Akismet to reduce spam. Learn how your comment data is processed.