Change default BOOT_COMPLETED Activity on Samsung Galaxy Camera

My question is about Samsung Galaxy Camera devices. It comes with a customized camera app. I think Samsung has developed its own. Since this device can be thought of as a camera instead of a camera phone, it looks like they decided that their camera app should start with a download, as opposed to other devices that go to the home screen after the download is complete.

Now, in our szenario, we ship a device with our own application, which has its own camera interface. We could run our application in kiosk mode, but we want to allow the user to use other applications that may be useful for their daily work.

Ideally, the device should start the home screen after the download is complete. The user can then decide to launch our application or another application. But if this is not possible, it would also be nice if our application was launched at boot instead of the home screen (since the user would have reached the home screen with the home button)

Since I don't see an option to make the home screen appear after the download is complete, I tried to launch my own default application. To implement this, I created a receiver with the following filter:

<intent-filter android:priority="1000">
<action android:name="android.intent.action.BOOT_COMPLETED"/>
</intent-filter> 

      

When the intent is received, I launch the main activity of our application.

As a result, after the device boots up, the default Samsung camera app will start first. You will see their main activity and the most annoying part: the camera lens will be fully extended. A second after that, our application starts automatically.

My guess is that the Samsung camera app also responds to the download complete event. Is there any chance we can prevent their application from running?

+3


source to share


3 answers


I believe this can be achieved - albeit in a convoluted manor - without rooting using the DevicePolicyManager. After creating an app by the device administrator and turning off the camera, the built-in camera app will not launch when the power is turned on (or press the camera button). Once your app has triggered, re-enable the camera and have fun.

I haven't had a chance to create the code (and will update this answer when I have), but I tested it using the DisableCameraDevice app from the play store. With this setup, the camera app doesn't start on startup and my app that gets BOOT_COMPLETE starts after a few seconds of business time.

It also doesn't stop camera button events (but stops the camera app), so you can do the same for that (which also seems to ignore android: priorities).



If you want to go further, you can even make the camera app respond to the ACTION_MAIN, CATEGORY_HOME actions mentioned by CommonsWare and aggressively select it as your desktop app.

Combined with a full screen app that doesn't display home / rear buttons, you're very well locked into a robust camera to give customers.

+1


source


The camera app uses the BOOT_COMPLETED permission attached to the receiver. It is a system application, so you need root to change it at the system level. If you are packaging your own firmware this won't be a problem. The stock launcher has no standard download permissions, but your app will. This will avoid the problem of downloading anything by simply removing that permission. Also, priority 499 is best placed under the 500 limit.



0


source


My guess is that the Samsung camera app also responds to the download complete event.

Or their camera app is their home screen.

UPDATE . Based on the comments, it looks like the Camera app is being launched by the firmware rather than launching the user's home screen. Hence, Samsung has allegedly reworked the launch sequence of this device.

Is there any chance we can prevent their application from running?

Not programmatically. Whether or not it is possible to sneak into the camera in any way to get roots and get confused with the built-in apps is the theme off for StackOverflow.

-1


source







All Articles