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

Commit 417ee5ba authored by Tor Norbye's avatar Tor Norbye
Browse files

Add resource type annotations to some APIs

Change-Id: I37c8afdaea455aa92bc8270bb2dfd60616c5f9bc
parent 4998467c
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package android.preference;

import android.annotation.Nullable;
import android.annotation.XmlRes;
import android.app.Activity;
import android.app.Fragment;
import android.content.Intent;
@@ -294,7 +295,7 @@ public abstract class PreferenceFragment extends Fragment implements
     *
     * @param preferencesResId The XML resource ID to inflate.
     */
    public void addPreferencesFromResource(int preferencesResId) {
    public void addPreferencesFromResource(@XmlRes int preferencesResId) {
        requirePreferenceManager();

        setPreferenceScreen(mPreferenceManager.inflateFromResource(getActivity(),
+1 −1
Original line number Diff line number Diff line
@@ -918,7 +918,7 @@ public class TextToSpeech {
     *
     * @return Code indicating success or failure. See {@link #ERROR} and {@link #SUCCESS}.
     */
    public int addSpeech(CharSequence text, String packagename, int resourceId) {
    public int addSpeech(CharSequence text, String packagename, @RawRes int resourceId) {
        synchronized (mStartLock) {
            mUtterances.put(text, makeResourceUri(packagename, resourceId));
            return SUCCESS;
+2 −1
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package android.view;

import android.annotation.StyleRes;
import android.content.Context;
import android.content.ContextWrapper;
import android.content.res.Configuration;
@@ -36,7 +37,7 @@ public class ContextThemeWrapper extends ContextWrapper {
        super(null);
    }

    public ContextThemeWrapper(Context base, int themeResId) {
    public ContextThemeWrapper(Context base, @StyleRes int themeResId) {
        super(base);
        mThemeResource = themeResId;
    }
+2 −1
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import android.annotation.DrawableRes;
import android.annotation.FloatRange;
import android.annotation.IdRes;
import android.annotation.IntDef;
import android.annotation.LayoutRes;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.Size;
@@ -18614,7 +18615,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     * layout_* parameters.
     * @see LayoutInflater
     */
    public static View inflate(Context context, int resource, ViewGroup root) {
    public static View inflate(Context context, @LayoutRes int resource, ViewGroup root) {
        LayoutInflater factory = LayoutInflater.from(context);
        return factory.inflate(resource, root);
    }
+2 −1
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import android.annotation.IdRes;
import android.annotation.LayoutRes;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.StyleRes;
import android.annotation.SystemApi;
import android.content.Context;
import android.content.res.Configuration;
@@ -738,7 +739,7 @@ public abstract class Window {
     * 0 here will override the animations the window would
     * normally retrieve from its theme.
     */
    public void setWindowAnimations(int resId) {
    public void setWindowAnimations(@StyleRes int resId) {
        final WindowManager.LayoutParams attrs = getAttributes();
        attrs.windowAnimations = resId;
        dispatchWindowAttributesChanged(attrs);
Loading