Tue, 06 Jan 2015 21:39:09 +0100
Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim:set ts=2 sw=2 sts=2 et cindent: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
7 //#define LOG_NDEBUG 0
8 #define LOG_TAG "IMediaResourceManagerClient"
9 #include <utils/Log.h>
11 #include <stdint.h>
12 #include <sys/types.h>
14 #include <binder/Parcel.h>
16 #include "IMediaResourceManagerClient.h"
18 namespace android {
20 enum {
21 STATUS_CHANGED = IBinder::FIRST_CALL_TRANSACTION
22 };
24 class BpMediaResourceManagerClient : public BpInterface<IMediaResourceManagerClient>
25 {
26 public:
27 BpMediaResourceManagerClient(const sp<IBinder>& impl)
28 : BpInterface<IMediaResourceManagerClient>(impl)
29 {
30 }
32 void statusChanged(int event)
33 {
34 Parcel data, reply;
35 data.writeInterfaceToken(IMediaResourceManagerClient::getInterfaceDescriptor());
36 data.writeInt32(event);
37 remote()->transact(STATUS_CHANGED, data, &reply, IBinder::FLAG_ONEWAY);
38 }
39 };
41 IMPLEMENT_META_INTERFACE(MediaResourceManagerClient, "android.media.IMediaResourceManagerClient");
43 // ----------------------------------------------------------------------
45 status_t BnMediaResourceManagerClient::onTransact(
46 uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags)
47 {
48 switch(code) {
49 case STATUS_CHANGED: {
50 CHECK_INTERFACE(IMediaResourceManagerClient, data, reply);
51 int event = data.readInt32();
52 statusChanged(event);
53 return NO_ERROR;
54 } break;
55 default:
56 return BBinder::onTransact(code, data, reply, flags);
57 }
58 }
60 // ----------------------------------------------------------------------------
62 }; // namespace android