Download seems to stop when screen is locked in Xiaomi device

I have a Xiaomi Redmi note 7 device global version which features MIUI .

Now I see the MIUI update, I press the download button and it starts downloading, I then leave it to download during night.

When I wake up I see it as it didn’t even move when I expect it to be finished, if I leave the screen on it seems to continue so probably a power saving feature.

I searched and searched, since my android version is 9 wi-fi sleep policy option disappeared and PieWifi app didn’t work.

People also said something about restricting background data usage which I think I found under Security -> Restrict Wi-fi but I can’t find the system updater app there.

I googled much and most options I see on internet I don’t find on my phone.

So how to make download work even if screen turns off ?

Android(Oreo) 8.1.0 Set DeviceOwer app causes “Workspace has been locked”

I’ve been using my app as a deviceOwner App since lollipop. I have a new device here which I want to be DeviceOwner too.

It is a Samsung galaxy Tab A 10.5(2018) SM-T590.

I am currently running this Version of the rom: T590XXU2ASC1.

I am not using NFC method. I usualy create the /data/system/device_owner.xml file by myself. But since it is not working I tryed this method:

1-Factory reset the tablet in recovery mode

2-Pass through the annoying startup menus

3-Set lock screen to none

4-Enable Usb Debugging

5-Install my app adb install MyApplicaton.apk

6-adb shell dpm set-device-owner com.example.myapplication/.MyApplicationReceiver It always says success when i execute the command.

7-Start my app, i can pin/unpin my app without problem.

8-Reboot, and then the famous message appears everytime: Workspace has been locked Unauthorized software has been installed on your device.Workspace has been locked to prevent any unauthorized access. Contact your admin.

Then if i press on the FACTORY DATA RESET button the workspace app crashes then pops back.

I tryed the kioskModeDemo app and the androidDeviceOwner sample app and they all do the same problem.

Anybody have any hints of why this is not working anymore on Android 8(oreo)?

Thanksenter image description here

How to stop access of notification bar and camera when phone is locked?

I have Realme2Pro. Its OPPO’s phone with ColorOS 5.2.

When the phone is locked, I want to stop access of notification bar and camera. I have gone through the link

How to lock camera and volume control when phone is locked

It was not more informative. Is it possible without unlocking bootloader or without rooting it?

If yes, let me know, how to do it?

Regards TekQ

How does one lock their own Bitcoins for X amount of blocks and prove that you locked it?

Is there a method of locking Bitcoins for X amount of blocks and also being able to prove its locked? How would one do this and with what wallet? Mobile wallet possible?

Reason why is I’d imagine one can build some interesting applications for this if you can PROVE you locked the coins for X amount of time. What if there was some type of bounty reward paid if X amount of bitcoins was locked for say 1-5 years?

Can a double checked locking be potentially locked by another double checked locking?

I’m trying to optimize my cache system for a custom entity list.

I have a GetEntity method that searches for an entity and when it find nothing, it adds the entity to the cached list. The cached list is available through a read only property named EntityList.

Either methods have a double check system to avoid useless entity reading or adding. The locker are intentionally different to allow a parallel execution of a reading and a getting/add operations.

In spite of this, I’m not sure that the use of the double check in the two crossed methods is always safe. Can I cause a deadlock this way? If yes, how can I avoid it?

public EntityUI GetEntity(int idEntity) {     // Get the entity from the cached list     EntityUI foundEntity = EntityList.Find(currEntity => currEntity != null && currEntity.IdEntity == idEntity);      // If the entity is not available load it from the DB     if (foundEntity == null)     {         var EntityFromDB = ... // [Get the entity from DB]          if (EntityFromDB != null)         {             lock (lockerEntityAdd)             {                 // Double check                 //-----------------------------------------------------------------------------------------------------                 // Here, while I'm locked, I'm reading from the EntityList which is subjected to another lock... can I create the deadlock here?                 // Consider that this piece of code is subjected to several requests per seconds from several users                 //-----------------------------------------------------------------------------------------------------                 foundEntity = EntityList.Find(currEntity => currEntity != null && currEntity.IdEntity == idEntity);                 if (foundEntity == null)                 {                     foundEntity = EntityDaDB;                     // Add the Entity to the cached list                     EntityList.Add(foundEntity);                 }             }         }     }     return foundEntity; }  private List<EntityUI> EntityList {     get     {         object o = HttpContext.Current.Cache[_CacheName];         if (o == null)         {             lock (lockerEntityList)             {                 o = HttpContext.Current.Cache[_CacheName];                 if (o == null)                 {                     o = new List<EntityUI>();                      CacheDependency d = new CacheDependency(GetCacheFile(Constants.CacheFilePath_Entity));                     HttpContext.Current.Cache.Insert(_CacheName, o, d, DateTime.Now.AddDays(Constants.CacheFileExpirationHours_Entity), Cache.NoSlidingExpiration);                 }             }         }         return (List<EntityUI>)o;     } }  

get rid of locked Word file on Mac

There is a file on my desktop called “~$ file.docx” and I can’t get rid of it.

I understand (at a very low level) it is a lock file for Word, and these files have certain properties. But I just want to delete it. I deleted “file.docx” but the damn lock file remains.

I can’t open it in Word. I can’t do anything with in terminal (e.g. rm). But if I ls -als in my Desktop it tells me I have full permissions:


How do I delete this file?

Update The output of ls -@e is the same as the simple ls. I just see “~$ file.docx”. If I try to remove it I get an error: No such file or directory.

Update Here is the output from ls -leO@:

-rw-r--r--@  1 UserName  staff  hidden       162 Jul 31  2018 ~file.docx           32          16           29