How to avoid Android Pie (call recordings BLOCKED!!!) with my security update?

My Huawei with Android 8 keeps pestering me constantly with “System Update Available for your device” and the choices are “download and install” and “later” but not “Leave me alone it’s my damn phone”. The update has a cryptic name like:

DRA-L21 1.0.0.151(C432)

Now, since Android 9 has made it impossible to record calls any more and that is the very most important feature in my phone, how can I be sure that this or any other update is not going to install Android 9 but only security patches?

Sources:

https://bitbucket.org/copluk/acr/issues/2418/kb-android-9-p-call-recording-issues

Android Pie makes it impossible to record calls with third-party apps

Android Pie blocks non-root call recording apps from working

https://www.androidpolice.com/2018/08/15/android-9-pie-puts-end-third-party-call-recording-apps/

Let me quote a paragraph from the first link, which explains the extent of the problem:

A quick search on the Google Play Store shows more than 200 million total installs for over 200 call recording apps. It is clear that there is a legitimate need for call recording support. We alone received many thank you emails from our customers telling us how call recording helped them to win legitimate court cases, recover financial losses, listen to voice of loved ones who are have passed away or even save their lives!

Avoid the modification of the date when an item is modified


Blockquote

In a custom list, I created a “STATUS” column with a Drop Down Menu :

To command commanded received

I also created a calculated column “CHANGE” with current date as result. The formula is the one below :

= IF( OR( [STATUS]=”To command”, [STATUS]=”commanded”, [STATUS]=”received”), Modified)

When I select an option of the Drop Down Menu of column “STATUS” CHANGE column is updated with the current date. It works. My problem is that the date is always updated when I modified another column in the list. How to update the date only if column STATUS is modified.

Blockquote

Encapsulating snprintf to avoid repetition of sizeof

Correct usage of snprintf involves very long and repetitive lines:

if (snprintf(buff, sizeof(buff), format, ...) >= (int)sizeof(buff))         goto err; 

I first encapsulated this macro: #define SSIZEOF(x) ((ssize_t)sizeof(x)). The result is I now have a slightly shorter line:

if (snprintf(buff, sizeof(buff), format, ...) >= SSIZEOF(buff))         goto err; 

But I’m not yet happy. Writing sizeof twice is still very long and annoying, and more if the buffer has a relatively long name.

I decided to do a macro that behaves this way (with the same exact safety) (The b in the name stands for buffer):

if (sbprintf(buff, format, ...))         goto err; 

It needs to be a macro to avoid the array decaying to a pointer, so that I can still use sizeof(buff) inside the macro.


sbprintf.h:

/******************************************************************************  ******* include guard ********************************************************  ******************************************************************************/ #ifndef ALX_STDIO_SBPRINTF_H #define ALX_STDIO_SBPRINTF_H   /******************************************************************************  ******* headers **************************************************************  ******************************************************************************/ #include <stdio.h>  #include "libalx/base/assert/assert.h" #include "libalx/base/compiler/size.h"   /******************************************************************************  ******* macros ***************************************************************  ******************************************************************************/ /* int  sbprintf(buff[restrict], const char *restrict format, ...); */ #define sbprintf(buff, format, ...)     (                               \ {                                                                       \         alx_static_assert_array(buff);                                  \                                                                         \         snprintf(buff, sizeof(buff), format, ##__VA_ARGS__) >= SSIZEOF(buff) \ }                                                                       \ )   /******************************************************************************  ******* include guard ********************************************************  ******************************************************************************/ #endif      /* libalx/base/stdio/sbprintf.h */ 

Used macros (defined in other headers from my library (libalx)):

#include <assert.h>  #include <sys/types.h>   #define alx_same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))  #define alx_static_assert_array(a)      do                              \ {                                                                       \         static_assert(!alx_same_type((a), &(a)[0]), "Not an array!");   \ } while (0)  #define SSIZEOF(x)      ((ssize_t)sizeof(x)) 

I use GCC8 and C17 (gcc -std=gnu17 -Wall -Wextra -Werror), but if there is any easy and not very ugly fix that helps portability, it is welcome. The same about C++: This is about C (I’ll ask the same question about C++ after this one has been answered), but if there is any fix that would improve compatibility with C++, it is also welcome.

What do you think about sbprintf? Feel free to comment the other macros, of course!


Related links:

  • How to make a variadic macro (variable number of arguments)

How to avoid duplicate vertex node on AgensGraph?

I want to create edge on two vertexes.

agens=# create (:v1{id:1}), (:v1{id:2}); GRAPH WRITE (INSERT VERTEX 2, INSERT EDGE 0) agens=# create (:v1{id:1})-[:e1{id:3}]->(:v1{id:2}); GRAPH WRITE (INSERT VERTEX 2, INSERT EDGE 1) agens=# match (n:v1) return n;         n          ------------------  v1[3.1]{"id": 1}  v1[3.2]{"id": 2}  v1[3.3]{"id": 1}  v1[3.4]{"id": 2} (4 rows) 

But, There is duplicated vertex on it.

How to avoid duplicate vertex node on AgensGraph?

Avoid toggle switch on any page with save button?

I’m currently working on a tool which more or less requires a submit/save button on every page. This is due to avoid any immediate effect on the end user who consumes the content.

Sometimes, it feels natural for me to throw in a toggle switch as a way to activate or disable a feature.

For example, if I have an image that has already been uploaded and is serving users, I then decide to update it with a watermark. In the image editor interface, should this be a toggle switch or a checkbox?

The answer would be a checkbox according to the guidelines found on Nielsen Norman (and also other sources). This is because toggle switches should never be used unless the effect is immediate, like turning on/off airplane mode on your phone. It also states that a checkbox should be used if it requires a submit button.

With that said, does this simply mean I should never use toggle switches as all of my pages requires a “save” before applying changes? Or could “immediate” also be interpreted for things that update the interface visually, even though it’s not saved? In the case of the example, a watermark being activated and shown (not yet saved).

Please note that I’m not actually working on an image editor, I’m mainly looking for a generic answer that could be applied anywhere.

Avoid too much dependencies for a Use Case in a Clean Architecture app


Context

I’m currently developing an application following the Clean Architecture principles (at least I’m trying really hard to follow these).

All my Dependency Injections are done manually, without any Framework.

One of my Use Case consists of the user being able to answer to a question he was asked.

  • If he/she is wrong, nothing happens, he can try again

  • If he/she is right, a list of things happens :

    • I get back his/her current session, and modify the state of that session. (Update session step – DB read)

    • I get back a contact record from the database (Get Contact step – DB read)

    • I send a mail into an in-app mailbox with this contact information (basically it’s a database insert of a message) (Send Mail step – DB write)

    • I save the updated session (Save session step – DB write)

    • I push an event into a custom Message Queue (Programm event step – Queue write)

Issue

All of the work described above are the steps I need to go through if the user answer to this question; it’s kind of an Application Logic. For that reason, I created a specific AnswerQuestionUseCase which do all of this.

Because of all these databases interactions, I now have 5 dependencies injected into my Use Case, and I’m starting to think this is a code smell of bad design. The unit test of this class is ugly, not quite readable with all these mocks.

Solution ?

I searched a bit how to deal with this issue, and I found that Function Composition might be a good way to avoid so many dependencies, but I’ve found that if a go that way, all of the Application Logic would go outside of my Use Case, deported into the presenter maybe.

I could also break my Use Case into smaller Use Cases, but that just hide the issue, pushing the dependencies elsewhere.

I thought the Use Case was a block of Application Logic which you couldn’t break apart for a specific use case of your app.

Is my understanding of what should be a Use Case any good ? How would you deal with that many dependencies ? How would you use Composition over DI to avoid so many mocks inside the unit test of this case ?

How to avoid triggering workflow on create when creating items through csom

I have a SharePoint Designer 2013 workflow that needs to be run on create. This workflow calls a Web Service method I have created, that creates a whole folder structure inside the folder that triggered the call. I want the new folders to NOT KICK the workflows on create. I thought running as System Account would do the trick, however the workflows still triggered. What am I doing wrong?

Are there any features that help with the roll to avoid the destruction of a Wand of Fireballs when using the last charge?

The Wand of Fireballs (as well as several other magic items that have charges1) has a chance of the item being lost forever when the last charge is expended:

If you expend the wand’s last charge, roll a d20. On a 1, the wand crumbles into ashes and is destroyed.

I am looking for ways to influence this roll to lower (or remove completely) the chance that the wand will be destroyed. Unfortunately, so far I have been unsuccessful (barring the usual “Wish can do anything”).

Things like Inspiration, the Divination Wizard’s Portent and the Lucky feat all specificy which rolls they apply to so can’t help with this particular d20 roll.

Are there any class features/abilities/spells/anything at all that are able to influence this d20 roll to avoid the destruction of the wand of fireballs?

Any official source will do, including UA as well.


1. Asking specifically for the wand of fireballs to avoid possible magic items that work differently, making this too broad

Online Game (Multi User Dungeon) – is it possible to avoid global data?

I need your precious advices 🙂

I am currently designing a Multi User Dungeon (MUD). For those who do not know what it is, they are the ancestors of MMORPGs. There is no graphics, everything is played in a console by typing commands. Players move into rooms, fight monsters, earn xp, and so on.

I am programming in C++ and use Boost. I am inspired by several examples of MUD that I found on the internet whose source code is available.

In each of the examples I found, global variables are often used: the list of players, the list of connected players, the list of rooms, etc. Indeed, these data are used absolutely everywhere in the program. They are at the heart of the game. 80% of the code consists in manipulating these data. I understand that others have been tempted to declare these data as global variables.

But I understand the danger of global variables and the problems that their use raises.

The problem is that I cannot imagine a viable solution that would prevent me from using global data.

I will try to give you a description of my architecture to illustrate my problem:

  • a class Server (linked to a list of sessions)
  • a class Session (linked to a connection instance)
  • a class Connection Instance (linked to a Player, a Session and a Context)
  • a class Player (linked to a Room)
  • a class Area (contains Rooms)
  • a class Room
  • a class Context (used to differentiate the different contexts: normal play, or when the player types his name and password, etc)
  • a class Command (for example, “kill a mob”)
  • many others…

I am not sure to know how I can have an access to every room/player/npc/object in the game in all these classes without passing everywhere a gigantic object containing the whole game as parameter.

For example, a player might have a “kill every player in the world” command. “KillEveryoneCommand” that would inherit “Command”. But where would this list of players be stored? How could it be accessed from the “Player” class or from the “KillEveryoneCommand” class?

Theoretically, a player could also have a command to ignite all the rooms of an area, or to communicate with another player from a distance… All these things are done without any problem with global data.

Would an online game with such central and shared data be a good exception for using global data?

I would love your opinions and your ideas because I am a little lost :p

Thank you!