Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e3e3b3c0 authored by Weien Wang's avatar Weien Wang
Browse files

Fix getSettingsSliceUri API review issues

    1. Permissions for wallpaper settings Slice.
    2. Return value must be marked either @NonNull or @Nullable.

Solution:
    1. Add more explanation for settingsSliceUri API usage in javadoc.
    2. Follow the public API annotation rule.

Bug: 119118548
Bug: 126699851
Test: atest tests/Internal/src/android/app/WallpaperInfoTest.java

Change-Id: I5db88ce35ba11b018abe42f2192afed44a19fea5
parent 81049a62
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -6419,7 +6419,7 @@ package android.app {
    method public android.content.pm.ServiceInfo getServiceInfo();
    method public String getServiceName();
    method public String getSettingsActivity();
    method public android.net.Uri getSettingsSliceUri();
    method @Nullable public android.net.Uri getSettingsSliceUri();
    method public boolean getShowMetadataInPreview();
    method public CharSequence loadAuthor(android.content.pm.PackageManager) throws android.content.res.Resources.NotFoundException;
    method public CharSequence loadContextDescription(android.content.pm.PackageManager) throws android.content.res.Resources.NotFoundException;
+6 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package android.app;

import android.annotation.Nullable;
import android.annotation.SystemApi;
import android.app.slice.Slice;
import android.content.ComponentName;
@@ -354,12 +355,17 @@ public final class WallpaperInfo implements Parcelable {
    
    /**
     * Returns an URI that provides a settings {@link Slice} for this wallpaper.
     * The wallpaper should implement a SliceProvider associated with this URI.
     * The system will display the Slice in the customization section while previewing the live
     * wallpaper. Because this URI is accessible to other apps, it is recommended to protect it
     * with the android.permission.BIND_WALLPAPER permission.
     *
     * <p>{@code null} will be returned if there is no settings Slice URI associated
     * with the wallpaper.
     *
     * @return The URI.
     */
    @Nullable
    public Uri getSettingsSliceUri() {
        if (mSettingsSliceUri == null) {
            return null;