Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8b6bff42 authored by Daniel Rosenberg's avatar Daniel Rosenberg
Browse files

installd: Check for support before migrating obb

This prevents migrating the obb folder if the device's kernel does not
support the new location.

Test: Run script on kernel with support for the unshared_obb option, and
      without, i.e. P kernel and Q kernel
Bug: 136199978

Change-Id: I3ff3e7653d9c9c6cdda4d17bafc853b5602597cf
parent feb6af0e
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -20,6 +20,14 @@ if ! test -d /data/media/obb ; then
  exit 0
fi

rm -rf /data/media/0/Android/obb/test_probe
touch /sdcard/Android/obb/test_probe
if ! test -f /data/media/0/Android/obb/test_probe ; then
  log -p i -t migrate_legacy_obb_data "No support for 'unshared_obb'. Not migrating"
  rm -rf /data/media/0/Android/obb/test_probe
  exit 0
fi

log -p i -t migrate_legacy_obb_data "Migrating legacy obb data."
rm -rf /data/media/0/Android/obb
cp -F -p -R -P -d /data/media/obb /data/media/0/Android