1 /* 2 * Copyright (C) 2011 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package com.android.keychain.tests.support; 17 18 import android.accounts.Account; 19 20 /** 21 * Service that runs as the system user for the use of the 22 * KeyChainServiceTest which needs to run as a regular app user, but 23 * needs to automate some steps only permissable to the system 24 * user. In particular, revokeAppPermission and grantAppPermission 25 * must be run within the system_server itself. In a real application, 26 * the user is prompted to perform these steps via the 27 * com.android.credentials.UNLOCK Intent and 28 * KeyChainActivity. 29 * 30 * @hide 31 */ 32 interface IKeyChainServiceTestSupport { keystoreReset()33 boolean keystoreReset(); keystorePassword(String password)34 boolean keystorePassword(String password); keystorePut(String key, in byte[] value)35 boolean keystorePut(String key, in byte[] value); keystoreImportKey(String key, in byte[] value)36 boolean keystoreImportKey(String key, in byte[] value); revokeAppPermission(int uid, String alias)37 void revokeAppPermission(int uid, String alias); grantAppPermission(int uid, String alias)38 void grantAppPermission(int uid, String alias); 39 } 40