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

Commit bd7ee736 authored by vadimt's avatar vadimt
Browse files

Checking for success of interactions with Wellbeing

Bug: 157589968
Change-Id: I9a5cc6341c0133ae5e31c47b6bd89f80e15c9099
parent 7149a7e0
Loading
Loading
Loading
Loading
+5 −3
Original line number Original line Diff line number Diff line
@@ -77,6 +77,7 @@ public final class WellbeingModel {
    private static final String EXTRA_ACTION = "action";
    private static final String EXTRA_ACTION = "action";
    private static final String EXTRA_MAX_NUM_ACTIONS_SHOWN = "max_num_actions_shown";
    private static final String EXTRA_MAX_NUM_ACTIONS_SHOWN = "max_num_actions_shown";
    private static final String EXTRA_PACKAGES = "packages";
    private static final String EXTRA_PACKAGES = "packages";
    private static final String EXTRA_SUCCESS = "success";


    public static final MainThreadInitializedObject<WellbeingModel> INSTANCE =
    public static final MainThreadInitializedObject<WellbeingModel> INSTANCE =
            new MainThreadInitializedObject<>(WellbeingModel::new);
            new MainThreadInitializedObject<>(WellbeingModel::new);
@@ -221,6 +222,7 @@ public final class WellbeingModel {
            params.putInt(EXTRA_MAX_NUM_ACTIONS_SHOWN, 1);
            params.putInt(EXTRA_MAX_NUM_ACTIONS_SHOWN, 1);
            // Perform wellbeing call .
            // Perform wellbeing call .
            remoteActionBundle = client.call(METHOD_GET_ACTIONS, null, params);
            remoteActionBundle = client.call(METHOD_GET_ACTIONS, null, params);
            if (!remoteActionBundle.getBoolean(EXTRA_SUCCESS, true)) return false;


            synchronized (mModelLock) {
            synchronized (mModelLock) {
                // Remove the entries for requested packages, and then update the fist with what we
                // Remove the entries for requested packages, and then update the fist with what we