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

Commit c55f89c6 authored by vadimt's avatar vadimt
Browse files

Moving processing data received from Wellbeing to a supress-all block

Bug: 144927220
Change-Id: I25f02d5844b32abb73c2b4b6fcdaa68f438e6aa4
parent 39a7760e
Loading
Loading
Loading
Loading
+25 −25
Original line number Diff line number Diff line
@@ -229,22 +229,14 @@ public final class WellbeingModel {
            params.putInt(EXTRA_MAX_NUM_ACTIONS_SHOWN, 1);
            // Perform wellbeing call .
            remoteActionBundle = client.call(METHOD_GET_ACTIONS, null, params);
        } catch (DeadObjectException e) {
            Log.i(TAG, "retrieveActions(): DeadObjectException");
            return false;
        } catch (Exception e) {
            Log.e(TAG, "Failed to retrieve data from " + contentUri + ": " + e);
            if (mIsInTest) throw new RuntimeException(e);
            return true;
        }

            synchronized (mModelLock) {
                // Remove the entries for requested packages, and then update the fist with what we
                // got from service
                Arrays.stream(packageNames).forEach(mPackageToActionId::remove);

            // The result consists of sub-bundles, each one is per a remote action. Each sub-bundle
            // has a RemoteAction and a list of packages to which the action applies.
                // The result consists of sub-bundles, each one is per a remote action. Each
                // sub-bundle has a RemoteAction and a list of packages to which the action applies.
                for (String actionId :
                        remoteActionBundle.getStringArray(EXTRA_ACTIONS)) {
                    final Bundle actionBundle = remoteActionBundle.getBundle(actionId);
@@ -262,6 +254,14 @@ public final class WellbeingModel {
                    }
                }
            }
        } catch (DeadObjectException e) {
            Log.i(TAG, "retrieveActions(): DeadObjectException");
            return false;
        } catch (Exception e) {
            Log.e(TAG, "Failed to retrieve data from " + contentUri + ": " + e);
            if (mIsInTest) throw new RuntimeException(e);
            return true;
        }
        if (DEBUG || mIsInTest) Log.i(TAG, "retrieveActions(): finished");
        return true;
    }