Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Understanding custom lock implementation on Android via home screen replacement technique

I've been researching about this question a lot. I asked a related question this week.The most helpful and relevant links in the area are this and this. I want to understand how it works and all, if implemented as home screen replacement app.

Quick questions:

  • If implemented which screen should be set as default? Our home screen replacement or original home screen?

  • Please read the comments after the answer of this question where asker figured out a way to do it. In the end he says:

    "Figured it out! Gotta disable the manifest intent filter by using setComponentEnabledSetting(), and then turn it back on when the activity pops up. Thanks for your help!"

What exactly does this mean? I don't quite understand the logic here. Please help?

  • Basically, I have same doubts as this asker (please see the comments below the answer by @CoffeeCrisp). But, I am unable to understand the solution and what exactly happened in here. Please help?
like image 562
Dev Dreamer Avatar asked Oct 21 '22 12:10

Dev Dreamer


1 Answers

  1. If you implemented a home screen replacement app, your app should be set as the default launcher/home screen.

  2. setComponentEnabledSetting() allows you to override the intent filters in the manifest and essentially disable them. It sounds like he overrode the filter for the launcher intent after the user unlocked so he could get the default home screen to show up.

That being said, I don't recommend writing a lock screen replacement, there are too many issues, it's hacky and insecure. Focus on lock screen widgets.

like image 84
Luke Avatar answered Nov 04 '22 20:11

Luke