Android->DeviceTest:add first time boot go to DeviceTest

This commit is contained in:
Firefly-RK3288
2016-06-23 12:01:13 +08:00
parent 0d7e51910e
commit 15807170cb
5 changed files with 39 additions and 0 deletions

View File

@ -169,3 +169,11 @@ service switch_ubuntu /system/bin/busybox sh /system/bin/switch_ubuntu.sh
on property:app.switch_ubuntu.start=1
start switch_ubuntu
service clear_test /system/bin/systemconfig clear_test
class main
disabled
oneshot
on property:app.firefly.config=1
start clear_test

View File

@ -388,6 +388,7 @@ public class RecoverySystem {
*/
public static void rebootWipeUserData(Context context, boolean shutdown, String reason)
throws IOException {
SystemProperties.set("app.firefly.config","1");
UserManager um = (UserManager) context.getSystemService(Context.USER_SERVICE);
if (um.hasUserRestriction(UserManager.DISALLOW_FACTORY_RESET)) {
throw new SecurityException("Wiping data is not allowed for this user.");

View File

@ -151,6 +151,11 @@ static int check_perms(const char *name, char *sctx)
return 1;
}
if(strcmp("app.firefly.config",name)==0)
{
return 1;
}
if(!strncmp(name, "ro.", 3))
name +=3;

View File

@ -0,0 +1,22 @@
#!/system/bin/sh
#copy /system/bin/
CLEAR_TEST="clear_test"
function clear_test()
{
mount -o remount,rw /system
rm -rf /system/media/devicetest
}
case "$1" in
"$CLEAR_TEST")
echo "system will get root..."
clear_test
;;
*)
echo "unexpected argument."
;;
esac

View File

@ -71,6 +71,9 @@ PRODUCT_PACKAGES += \
# $(LOCAL_PATH)/ituxd/lib/x86/libthermalJNI.so:system/lib/libthermalJNI.so
endif
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/DeviceTest/lib/systemconfig:system/bin/systemconfig
###########for box app ################
ifeq ($(strip $(TARGET_BOARD_PLATFORM_PRODUCT)), box)