libion: open /dev/ion read-only

/dev/ion driver does not recognize the write operation [1] so open it
read-only.

[1] http://lxr.free-electrons.com/source/drivers/staging/android/ion/ion.c?v=4.5#L1369

Test: Angler builds and boots
Bug: 32120194
Change-Id: I9b26d43ea32cb24426404668701df1f1648d336c
This commit is contained in:
Jeff Vander Stoep 2016-10-21 14:29:22 -07:00
parent 27d2d49f48
commit 1ba4e981db
2 changed files with 2 additions and 2 deletions

View file

@ -34,7 +34,7 @@
int ion_open()
{
int fd = open("/dev/ion", O_RDWR);
int fd = open("/dev/ion", O_RDONLY);
if (fd < 0)
ALOGE("open /dev/ion failed!\n");
return fd;

View file

@ -46,7 +46,7 @@ class Device : public IonAllHeapsTest {
void Device::SetUp()
{
IonAllHeapsTest::SetUp();
m_deviceFd = open("/dev/ion-test", O_RDWR);
m_deviceFd = open("/dev/ion-test", O_RDONLY);
ASSERT_GE(m_deviceFd, 0);
}