1/* 2 * Copyright (C) 2014 The Android Open Source Project 3 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. 4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 5 * 6 * This code is free software; you can redistribute it and/or modify it 7 * under the terms of the GNU General Public License version 2 only, as 8 * published by the Free Software Foundation. Oracle designates this 9 * particular file as subject to the "Classpath" exception as provided 10 * by Oracle in the LICENSE file that accompanied this code. 11 * 12 * This code is distributed in the hope that it will be useful, but WITHOUT 13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 15 * version 2 for more details (a copy is included in the LICENSE file that 16 * accompanied this code). 17 * 18 * You should have received a copy of the GNU General Public License version 19 * 2 along with this work; if not, write to the Free Software Foundation, 20 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 21 * 22 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 23 * or visit www.oracle.com if you need additional information or have any 24 * questions. 25 */ 26 27 28package java.security; 29 30import java.util.Enumeration; 31 32 33/* Not used on Android, removed most of the code and made the class methods no-ops */ 34 35/** 36 * Legacy security code; do not use. 37 */ 38public abstract class Policy { 39 40 public static final PermissionCollection UNSUPPORTED_EMPTY_COLLECTION = 41 new UnsupportedEmptyCollection(); 42 43 public static Policy getPolicy() 44 { 45 return null; 46 } 47 48 public static void setPolicy(Policy p) 49 { 50 } 51 52 public static Policy getInstance(String type, Policy.Parameters params) 53 throws NoSuchAlgorithmException { 54 return null; 55 } 56 57 public static Policy getInstance(String type, 58 Policy.Parameters params, 59 String provider) 60 throws NoSuchProviderException, NoSuchAlgorithmException { 61 return null; 62 } 63 64 65 public static Policy getInstance(String type, 66 Policy.Parameters params, 67 Provider provider) 68 throws NoSuchAlgorithmException { 69 return null; 70 } 71 72 public Provider getProvider() { 73 return null; 74 } 75 76 public String getType() { 77 return null; 78 } 79 80 public Policy.Parameters getParameters() { 81 return null; 82 } 83 84 public PermissionCollection getPermissions(CodeSource codesource) { 85 return null; 86 } 87 88 public PermissionCollection getPermissions(ProtectionDomain domain) { 89 return null; 90 } 91 92 public boolean implies(ProtectionDomain domain, Permission permission) { 93 return true; 94 } 95 96 public void refresh() { } 97 98 public static interface Parameters { } 99 100 private static class UnsupportedEmptyCollection 101 extends PermissionCollection { 102 103 public UnsupportedEmptyCollection() { 104 } 105 106 @Override public void add(Permission permission) { 107 } 108 109 @Override public boolean implies(Permission permission) { 110 return true; 111 } 112 113 @Override public Enumeration<Permission> elements() { 114 return null; 115 } 116 } 117 118} 119