1 /*
2  * Copyright (C) 2023 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 
17 package com.android.providers.media.photopicker.ui.settings;
18 
19 import static java.util.Objects.requireNonNull;
20 
21 import android.content.Intent;
22 
23 import androidx.annotation.NonNull;
24 import androidx.annotation.Nullable;
25 
26 /* POJO for encapsulating the cloud provider authority and it's media collection info. */
27 class CloudProviderMediaCollectionInfo {
28     @NonNull
29     private final String mAuthority;
30     @Nullable
31     private final String mAccountName;
32     @Nullable
33     private final Intent mAccountConfigurationIntent;
34 
CloudProviderMediaCollectionInfo(@onNull String authority)35     CloudProviderMediaCollectionInfo(@NonNull String authority) {
36         mAuthority = requireNonNull(authority);
37         mAccountName = null;
38         mAccountConfigurationIntent = null;
39     }
40 
CloudProviderMediaCollectionInfo(@onNull String authority, @Nullable String accountName, @Nullable Intent accountConfigurationIntent)41     CloudProviderMediaCollectionInfo(@NonNull String authority, @Nullable String accountName,
42             @Nullable Intent accountConfigurationIntent) {
43         mAuthority = requireNonNull(authority);
44         mAccountName = accountName;
45         mAccountConfigurationIntent = accountConfigurationIntent;
46     }
47 
48     @NonNull
getAuthority()49     String getAuthority() {
50         return mAuthority;
51     }
52 
53     @Nullable
getAccountName()54     String getAccountName() {
55         return mAccountName;
56     }
57 
58     @Nullable
getAccountConfigurationIntent()59     Intent getAccountConfigurationIntent() {
60         return mAccountConfigurationIntent;
61     }
62 }
63