From 3383aa5cc3bac56576cf48086183f59ac4de279e Mon Sep 17 00:00:00 2001 From: Mathew Inwood Date: Fri, 16 Mar 2018 14:18:33 +0000 Subject: Support for API exemptions from API blacklisting. Add support to VMRuntime for setting a list of exemptions from the hidden API enforcement. The list is used as a prefix match against the signature of a field/method. Any signatures that match are treated as being on the light grey list, rather than the dark grey list or blacklist. Refactor some code in hidden_api.h that deals with field/method signatures, to encapsulate the signature in a new class MemberSignature. This allows us to avoid building the entire signature in member, instead just using its constituent parts. Test: $ make test-art-host-gtest-hidden_api_test Test: $ adb shell settings put global hidden_api_blacklist_exemptions \ Test: Landroid/view/RemoteAnimationDefinition\\\;:Landroid/app/ActivityManager\\\$TaskDescription\\\; Test: Manually verify logcat output from app which uses named APIs Bug: 73337509 (cherry picked from commit 7d74ef585063ca2adc0ba9c18008b7c1671ff699) Merged-In: Id608743d1b5a7a37059875d8991d0d4d65f5fc36 Change-Id: Ic868557e12c3896888184501a59481a56edebd03 --- test/HiddenApiSignatures/Class12.java | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 test/HiddenApiSignatures/Class12.java (limited to 'test/HiddenApiSignatures/Class12.java') diff --git a/test/HiddenApiSignatures/Class12.java b/test/HiddenApiSignatures/Class12.java new file mode 100644 index 0000000000..82b22e365f --- /dev/null +++ b/test/HiddenApiSignatures/Class12.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2017 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 mypackage.packagea; + +public class Class12 { + public int field1; + + public void method1() { + } +} \ No newline at end of file -- cgit v1.2.3-59-g8ed1b