Jon Miranda | 16ea1b1 | 2017-12-12 14:52:48 -0800 | [diff] [blame] | 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 | /** |
Santiago Etchebehere | fab4961 | 2019-01-15 12:22:42 -0800 | [diff] [blame] | 19 | * Interface for activities that launch an Android custom image picker. |
Jon Miranda | 16ea1b1 | 2017-12-12 14:52:48 -0800 | [diff] [blame] | 20 | */ |
Santiago Etchebehere | fab4961 | 2019-01-15 12:22:42 -0800 | [diff] [blame] | 21 | public interface MyPhotosStarter { |
Jon Miranda | 16ea1b1 | 2017-12-12 14:52:48 -0800 | [diff] [blame] | 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 | */ |
| 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 | */ |
| 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 | */ |
| 44 | void onPermissionsDenied(boolean dontAskAgain); |
| 45 | } |
Santiago Etchebehere | fab4961 | 2019-01-15 12:22:42 -0800 | [diff] [blame] | 46 | |
| 47 | interface MyPhotosStarterProvider { |
| 48 | |
| 49 | MyPhotosStarter getMyPhotosStarter(); |
| 50 | } |
Jon Miranda | 16ea1b1 | 2017-12-12 14:52:48 -0800 | [diff] [blame] | 51 | } |