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

Commit 169ed456 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Re-enable app_functions on Wear." into main

parents 679ba232 cab71af0
Loading
Loading
Loading
Loading
+2 −9
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@ import static android.app.appfunctions.flags.Flags.enableAppFunctionManager;

import android.annotation.NonNull;
import android.content.Context;
import android.content.pm.PackageManager;

/**
 * Represents the system configuration of support for the {@code AppFunctionManager} and associated
@@ -29,15 +28,13 @@ import android.content.pm.PackageManager;
 * @hide
 */
public class AppFunctionManagerConfiguration {
    private final Context mContext;

    /**
     * Constructs a new instance of {@code AppFunctionManagerConfiguration}.
     *
     * @param context context
     */
    public AppFunctionManagerConfiguration(@NonNull final Context context) {
        mContext = context;
        // Context can be used to access system features, etc.
    }

    /**
@@ -46,7 +43,7 @@ public class AppFunctionManagerConfiguration {
     * @return {@code true} if supported; otherwise {@code false}
     */
    public boolean isSupported() {
        return enableAppFunctionManager() && !isWatch();
        return enableAppFunctionManager();
    }

    /**
@@ -58,8 +55,4 @@ public class AppFunctionManagerConfiguration {
    public static boolean isSupported(@NonNull final Context context) {
        return new AppFunctionManagerConfiguration(context).isSupported();
    }

    private boolean isWatch() {
        return mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_WATCH);
    }
}