1 /* 2 * Copyright (C) 2017 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.wallpaper.picker; 17 18 /** 19 * Interface for activities that launch an Android custom image picker. 20 */ 21 public interface MyPhotosStarter { 22 23 /** 24 * Requests that this Activity show the Android custom photo picker for the sake of picking a 25 * photo to set as the device's wallpaper. 26 */ requestCustomPhotoPicker(PermissionChangedListener listener)27 void requestCustomPhotoPicker(PermissionChangedListener listener); 28 29 /** 30 * Interface for clients to implement in order to be notified of permissions grant status changes. 31 */ 32 interface PermissionChangedListener { 33 /** 34 * Notifies that the user granted permissions. 35 */ onPermissionsGranted()36 void onPermissionsGranted(); 37 38 /** 39 * Notifies that the user denied permissions. 40 * 41 * @param dontAskAgain True if user checked "Don't ask again" on the most recent permissions 42 * request prior to denying it. 43 */ onPermissionsDenied(boolean dontAskAgain)44 void onPermissionsDenied(boolean dontAskAgain); 45 } 46 47 interface MyPhotosStarterProvider { 48 getMyPhotosStarter()49 MyPhotosStarter getMyPhotosStarter(); 50 } 51 } 52