0

I'm trying to start an app upon the first boot of the device before the keyguard appears. I need to ensure the first thing the user sees after the boot animation (which I've also changed) is this app. My app is just three screens of text in fullscreen mode with a next button in between them.

I realize that for most cases, this would be a terrible user experience. However, the phones we're shipping have a very specific purpose and because of this I need to meet the following criteria:

  • my app needs to be the first thing the user sees (after the boot animation of course) when they take the phone out of the box and power it on for the first time.
  • after the first boot, the phone should function as normal (i.e the keyguard should appear upon bootup instead of my app).
  • this only needs to work for lollipop since that's the android version we're shipping.
  • I can modify the Android framework if needed, but a solution where I don't have to is preferred.

My (Failed) Approach

Create an app that starts upon boot. Have the app dismiss the keyguard as the first thing it does.

The problem I found with this approach is the keyguard code is called before the app initialization code so the user sees the keyguard briefly and then sees my app.

A Possible Solution

I think the best way to do this is to add code in the framework to call my app before calling the keyguard. I'm imagining having a boolean that's used to keep track of whether it's the first time the device is powered on. If that boolean is true, open the app. If not, open the keyguard.

The problem is there's a lot of code in the android userspace boot process and I have a quickly-approaching deadline (don't we all?). How can I modify the framework code to show my app before the keyguard?

If there's a better way, please let me know that too!

Patrick
  • 11,552
  • 7
  • 29
  • 41
  • Thanks for the pointer @ChrisStratton. I'm looking at the file you mentioned and don't see an option for disabling the lock screen. Do you know which one it is? – Patrick Apr 23 '15 at 22:51
  • 2
    Sorry, that was the wrong place, should be frameworks/base/packages/SettingsProvider/res/values/defaults.xml specifically false which you can presuambly change to true. You may also be able to change it in /system/priv-app/SettingsProvider/SettingsProvider.apk on the device with modding tools if you don't feel like rebuilding. – Chris Stratton Apr 24 '15 at 02:23
  • @ChrisStratton It works! I changed the XML value, recompiled the whole build and flashed the system.img and userdata.img. But, because it's a change in XML, it's hard-coded. Any idea how to do the second part of my question-- getting the lockscreen back after the first boot? – Patrick Apr 28 '15 at 23:42
  • 1
    You would then change the system setting that this is the default for - see http://androidxref.com/5.1.0_r1/xref/frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java#2422 – Chris Stratton Apr 28 '15 at 23:51

0 Answers0