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 package com.android.wallpaper.model;
17 
18 import android.app.WallpaperInfo;
19 import android.graphics.Point;
20 import android.graphics.Rect;
21 import android.net.Uri;
22 
23 import androidx.annotation.Nullable;
24 
25 import java.util.List;
26 import java.util.Map;
27 
28 /**
29  * Live wallpaper-specific wrapper for user-facing wallpaper metadata.
30  */
31 public class LiveWallpaperMetadata extends WallpaperMetadata {
32     @Nullable private final Uri mPreviewUri;
33 
LiveWallpaperMetadata(android.app.WallpaperInfo wallpaperComponent, @Nullable Uri previewUri)34     public LiveWallpaperMetadata(android.app.WallpaperInfo wallpaperComponent,
35             @Nullable Uri previewUri) {
36         super(null, null, null, wallpaperComponent, null);
37         mPreviewUri = previewUri;
38     }
39 
40     @Override
getAttributions()41     public List<String> getAttributions() {
42         throw new UnsupportedOperationException("Not implemented for live wallpapers");
43     }
44 
45     @Override
getActionUrl()46     public String getActionUrl() {
47         throw new UnsupportedOperationException("Not implemented for live wallpapers");
48     }
49 
50     @Override
getCollectionId()51     public String getCollectionId() {
52         throw new UnsupportedOperationException("Not implemented for live wallpapers");
53     }
54 
55     @Override
getWallpaperComponent()56     public WallpaperInfo getWallpaperComponent() {
57         return mWallpaperComponent;
58     }
59 
60     @Nullable
61     @Override
getWallpaperCropHints()62     public Map<Point, Rect> getWallpaperCropHints() {
63         throw new UnsupportedOperationException("Not implemented for live wallpapers");
64     }
65 
66     @Nullable
getPreviewUri()67     public Uri getPreviewUri() {
68         return mPreviewUri;
69     }
70 }
71