blob: d79b3b5c87edd8e4164d027036d64ce3b21ffd57 [file] [log] [blame]
Jon Miranda16ea1b12017-12-12 14:52:48 -08001/*
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 */
16package com.android.wallpaper.picker;
17
18/**
Santiago Etchebeherefab49612019-01-15 12:22:42 -080019 * Interface for activities that launch an Android custom image picker.
Jon Miranda16ea1b12017-12-12 14:52:48 -080020 */
Santiago Etchebeherefab49612019-01-15 12:22:42 -080021public interface MyPhotosStarter {
Jon Miranda16ea1b12017-12-12 14:52:48 -080022
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 Etchebeherefab49612019-01-15 12:22:42 -080046
47 interface MyPhotosStarterProvider {
48
49 MyPhotosStarter getMyPhotosStarter();
50 }
Jon Miranda16ea1b12017-12-12 14:52:48 -080051}