jeudi 30 avril 2015

[Q] google camera - external storage - issue topic


hey everyone.
So, I am desperately trying to force/trick google camera to write to the sd card rather than to the internal card.
my sdcard is formatted as ext4 and in its root i created the directory: DCIM_sd.
now, using ssh (as root ofc) i navigated to: /data/media/0, deleted DCIM and re-created it. gave right ownership and permissions.
At this point I executed this command:

Code:


busybox mount --bind /storage/sdcard1/DCIM_sd/  DCIM

and followed by df -h just to confirm that it was successful:

Code:


localhost 0 # df -h
Filesystem                Size      Used Available Use% Mounted on
tmpfs                  415.8M    108.0K    415.7M  0% /dev
none                    415.8M    12.0K    415.8M  0% /sys/fs/cgroup
tmpfs                  415.8M        0    415.8M  0% /mnt/asec
tmpfs                  415.8M        0    415.8M  0% /mnt/obb
/dev/block/mmcblk0p3    19.7M    11.3M      8.3M  58% /efs
/dev/block/mmcblk0p9      1.5G    524.3M    987.6M  35% /system
/dev/block/mmcblk0p8  1007.9M    18.8M    989.1M  2% /cache
/dev/block/mmcblk0p10
                        551.2M      9.2M    542.0M  2% /preload
/dev/block/mmcblk0p12
                        11.3G      4.1G      7.3G  36% /data
/dev/fuse                11.3G      4.1G      7.3G  36% /mnt/shell/emulated
/dev/block/vold/179:49
                        29.0G    15.2G    12.4G  55% /mnt/media_rw/sdcard1
/dev/block/vold/179:49
                        29.0G    15.2G    12.4G  55% /mnt/secure/asec
/dev/fuse                29.0G    15.2G    12.4G  55% /storage/sdcard1
/dev/fuse                29.0G    15.2G    12.4G  55% /data/media/0/DCIM


At this point I launched google camera (fresh).
Unfortunately I have this toast message popping up:

Quote:









"Insert an SD card before using the camera."




My impression is that the app can't access the directory. For this reason I edited this file: /etc/permissions/platform.xml to look as the following:

Code:


<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2008 The Android Open Source Project

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->

<!-- This file is used to define the mappings between lower-level system
    user and group IDs and the higher-level permission names managed
    by the platform.

    Be VERY careful when editing this file!  Mistakes made here can open
    big security holes.
-->
<permissions>

    <!-- ================================================================== -->
    <!-- ================================================================== -->
    <!-- ================================================================== -->

    <!-- The following tags are associating low-level group IDs with
        permission names.  By specifying such a mapping, you are saying
        that any application process granted the given permission will
        also be running with the given group ID attached to its process,
        so it can perform any filesystem (read, write, execute) operations
        allowed for that group. -->

    <permission name="android.permission.BLUETOOTH_ADMIN" >
        <group gid="net_bt_admin" />
    </permission>

    <permission name="android.permission.BLUETOOTH" >
        <group gid="net_bt" />
    </permission>

    <permission name="android.permission.BLUETOOTH_STACK" >
        <group gid="net_bt_stack" />
    </permission>

    <permission name="android.permission.NET_TUNNELING" >
        <group gid="vpn" />
    </permission>

    <permission name="android.permission.INTERNET" >
        <group gid="inet" />
    </permission>

    <permission name="android.permission.READ_LOGS" >
        <group gid="log" />
    </permission>

    <permission name="android.permission.READ_EXTERNAL_STORAGE" >
        <group gid="sdcard_r" />
    </permission>

    <permission name="android.permission.WRITE_EXTERNAL_STORAGE" >
        <group gid="sdcard_r" />
        <group gid="sdcard_rw" />
        <group gid="media_rw" />
    </permission>

    <permission name="android.permission.ACCESS_ALL_EXTERNAL_STORAGE" >
        <group gid="sdcard_r" />
        <group gid="sdcard_rw" />
        <group gid="sdcard_all" />
    </permission>

    <permission name="android.permission.WRITE_MEDIA_STORAGE" >
        <group gid="media_rw" />
        <group gid="sdcard_rw" />
    </permission>

    <permission name="android.permission.ACCESS_MTP" >
        <group gid="mtp" />
    </permission>

    <permission name="android.permission.NET_ADMIN" >
        <group gid="net_admin" />
    </permission>

    <!-- The group that /cache belongs to, linked to the permission
        set on the applications that can access /cache -->
    <permission name="android.permission.ACCESS_CACHE_FILESYSTEM" >
        <group gid="cache" />
    </permission>

    <!-- RW permissions to any system resources owned by group 'diag'.
        This is for carrier and manufacture diagnostics tools that must be
        installable from the framework. Be careful. -->
    <permission name="android.permission.DIAGNOSTIC" >
        <group gid="input" />
        <group gid="diag" />
    </permission>

    <!-- Group that can read detailed network usage statistics -->
    <permission name="android.permission.READ_NETWORK_USAGE_HISTORY">
        <group gid="net_bw_stats" />
    </permission>

    <!-- Group that can modify how network statistics are accounted -->
    <permission name="android.permission.MODIFY_NETWORK_ACCOUNTING">
        <group gid="net_bw_acct" />
    </permission>

    <permission name="android.permission.LOOP_RADIO" >
        <group gid="loop_radio" />
    </permission>

    <!-- Hotword training apps sometimes need a GID to talk with low-level
        hardware; give them audio for now until full HAL support is added. -->
    <permission name="android.permission.MANAGE_VOICE_KEYPHRASES">
        <group gid="audio" />
    </permission>

    <permission name="android.permission.ACCESS_FM_RADIO" >
        <group gid="media" />
    </permission>

    <!-- ================================================================== -->
    <!-- ================================================================== -->
    <!-- ================================================================== -->

    <!-- The following tags are assigning high-level permissions to specific
        user IDs.  These are used to allow specific core system users to
        perform the given operations with the higher-level framework.  For
        example, we give a wide variety of permissions to the shell user
        since that is the user the adb shell runs under and developers and
        others should have a fairly open environment in which to
        interact with the system. -->

    <assign-permission name="android.permission.MODIFY_AUDIO_SETTINGS" uid="media" />
    <assign-permission name="android.permission.ACCESS_SURFACE_FLINGER" uid="media" />
    <assign-permission name="android.permission.WAKE_LOCK" uid="media" />
    <assign-permission name="android.permission.UPDATE_DEVICE_STATS" uid="media" />
    <assign-permission name="android.permission.UPDATE_APP_OPS_STATS" uid="media" />

    <assign-permission name="android.permission.ACCESS_SURFACE_FLINGER" uid="graphics" />

    <!-- This is a list of all the libraries available for application
        code to link against. -->

    <library name="android.test.runner"
            file="/system/framework/android.test.runner.jar" />
    <library name="javax.obex"
            file="/system/framework/javax.obex.jar"/>
    <library name="javax.btobex"
            file="/system/framework/javax.btobex.jar"/>

    <!-- These are the standard packages that are white-listed to always have internet
        access while in power save mode, even if they aren't in the foreground. -->
    <allow-in-power-save package="com.android.providers.downloads" />

</permissions>


Rebooted (and remounted...), but still same issue.

What am I doing wrong? What can I do to solve this issue?
my phone: Samsung i9300
running CM 12.1-20150426-UNOFFICIAL-i9300
android version: 5.1.1


Thanks,
Niko

xda-developers