Skip to content
This repository was archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Bug 1132921 - Common device bits for shinano platform r=mwu
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandre Lissy committed Feb 16, 2015
0 parents commit 93c9ec3
Show file tree
Hide file tree
Showing 7 changed files with 1,188 additions and 0 deletions.
48 changes: 48 additions & 0 deletions BoardConfig.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Use default Gecko location if it's not provided in config files.
GECKO_PATH ?= gecko

B2G_SYSTEM_APPS := 1

BOARD_BOOTIMAGE_PARTITION_SIZE := 20971520
BOARD_SYSTEMIMAGE_PARTITION_SIZE := 2671771648
BOARD_USERDATAIMAGE_PARTITION_SIZE := 12656294912
BOARD_CACHEIMAGE_PARTITION_SIZE := 209715200

BOARD_USES_ALSA_AUDIO := true
AUDIO_FEATURE_DISABLED_SSR := true

# don't create SD card partition
BOARD_USBIMAGE_PARTITION_SIZE_KB :=

ENABLE_LIBRECOVERY := true
RECOVERY_EXTERNAL_STORAGE := /storage/sdcard1

TARGET_PROVIDES_INIT_RC := true

# hack to prevent llvm from building
BOARD_USE_QCOM_LLVM_CLANG_RS := true

TARGET_NO_BOOTLOADER := true
KERNEL_DEFCONFIG := shinano_aries_defconfig
BOARD_KERNEL_CMDLINE := androidboot.hardware=qcom user_debug=31 selinux=0 msm_rtb.filter=0xb7 ehci-hcd.park=3 dwc3.maximum_speed=high dwc3_msm.prop_chg_detect=Y

BOARD_HAVE_BLUETOOTH := true
BOARD_BLUETOOTH_DOES_NOT_USE_RFKILL := true
BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := $(LOCAL_PATH)/bluetooth \
$(GECKO_PATH)/dom/bluetooth/bluedroid
BOARD_HAS_QCOM_WLAN := true
BOARD_HAS_ATH_WLAN_AR6004 := true
BOARD_WLAN_DEVICE := qcwcn
BOARD_WPA_SUPPLICANT_DRIVER := NL80211
BOARD_HOSTAPD_DRIVER := NL80211
WIFI_DRIVER_MODULE_PATH := "/system/lib/modules/wlan.ko"
WIFI_DRIVER_MODULE_NAME := "wlan"
WIFI_DRIVER_MODULE_ARG := ""
WPA_SUPPLICANT_VERSION := VER_0_8_X
HOSTAPD_VERSION := VER_0_8_X
WIFI_DRIVER_FW_PATH_STA := "sta"
WIFI_DRIVER_FW_PATH_AP := "ap"
WIFI_DRIVER_FW_PATH_P2P := "p2p"
BOARD_HAS_CFG80211_KERNEL3_4 := true
BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_$(BOARD_WLAN_DEVICE)
BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_$(BOARD_WLAN_DEVICE)
25 changes: 25 additions & 0 deletions device.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
$(call inherit-product, device/qcom/msm8974/msm8974.mk)

PRODUCT_COPY_FILES := @inherit:device/qcom/common/common.mk

$(call inherit-product, $(SRC_TARGET_DIR)/product/generic.mk)

PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/rootdir/init.rc:root/init.rc \

PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/volume.cfg:system/etc/volume.cfg \
$(LOCAL_PATH)/media_profiles.xml:system/etc/media_profiles.xml \
system/bluetooth/data/main.le.conf:system/etc/bluetooth/main.conf \

PRODUCT_PROPERTY_OVERRIDES += \
ro.moz.nfc.enabled=true \
ro.moz.bluetooth.backend=bluetoothd \

PRODUCT_PACKAGES += \
bcm4339.ko \
fakebattery \
libandroid \
librecovery \
nfcd \
rilproxy \
23 changes: 23 additions & 0 deletions fakebattery/Android.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright (C) 2014 Mozilla Foundation
#
# 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.

LOCAL_PATH:= $(call my-dir)

include $(CLEAR_VARS)
LOCAL_MODULE := fakebattery
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := EXECUTABLES
LOCAL_SRC_FILES := fakebattery.cpp
LOCAL_SHARED_LIBRARIES := libbinder libutils
include $(BUILD_EXECUTABLE)
101 changes: 101 additions & 0 deletions fakebattery/fakebattery.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
/*
* Copyright (C) 2013 Mozilla Foundation
*
* 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.
*/

#include <binder/BinderService.h>
#include <binder/IPCThreadState.h>
#include <binder/ProcessState.h>
#include <binder/IInterface.h>

#include <android/log.h>
#define ALOGE(args...) __android_log_print(ANDROID_LOG_ERROR, "gonkbatteryinfo" , ## args)

namespace android {

class IBatteryStatsService : public IInterface
{
public:
DECLARE_META_INTERFACE(BatteryStatsService);

// Nothing implemented
};

class BnBatteryStatsService : public BnInterface<IBatteryStatsService>
{
public:
virtual status_t onTransact( uint32_t code,
const Parcel& data,
Parcel* reply,
uint32_t flags = 0);
};

// ----------------------------------------------------------------------

class BpBatteryStatsService : public BpInterface<IBatteryStatsService>
{
public:
BpBatteryStatsService(const sp<IBinder>& impl)
: BpInterface<IBatteryStatsService>(impl)
{
}
};

IMPLEMENT_META_INTERFACE(BatteryStatsService, "com.android.internal.app.IBatteryStats");

// ----------------------------------------------------------------------

status_t BnBatteryStatsService::onTransact(
uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags)
{
return BBinder::onTransact(code, data, reply, flags);
}

// ----------------------------------------------------------------------

class FakeBatteryStatsService :
public BinderService<FakeBatteryStatsService>,
public BnBatteryStatsService
{
public:
FakeBatteryStatsService();
virtual ~FakeBatteryStatsService();

static const char *getServiceName() {
return "batterystats";
}

virtual status_t dump(int fd, const Vector<String16>& args) {
return NO_ERROR;
}
};

FakeBatteryStatsService::FakeBatteryStatsService()
: BnBatteryStatsService()
{
}

FakeBatteryStatsService::~FakeBatteryStatsService()
{
}

}; // namespace android

using namespace android;

int main(int argc, char **argv)
{
FakeBatteryStatsService::publishAndJoinThreadPool();
return 0;
}
Loading

0 comments on commit 93c9ec3

Please sign in to comment.