Skip to content

Commit

Permalink
sm8250-common: Add support for OnePlus Camera & Gallery
Browse files Browse the repository at this point in the history
* Camera repo: https://gitlab.com/cjh1249131356/vendor_oneplus_camera

Signed-off-by: cjh1249131356 <cjh1249131356@gmail.com>
  • Loading branch information
cjh1249131356 authored and utziacre committed Dec 2, 2023
1 parent 96ca846 commit e8c3528
Show file tree
Hide file tree
Showing 34 changed files with 599 additions and 0 deletions.
3 changes: 3 additions & 0 deletions BoardConfigCommon.mk
Expand Up @@ -57,6 +57,9 @@ BOARD_USES_ALSA_AUDIO := true
# Bootloader
TARGET_BOOTLOADER_BOARD_NAME := kona

# Camera
TARGET_USES_OPLUS_CAMERA := true

# Properties
TARGET_ODM_PROP += $(COMMON_PATH)/odm.prop
TARGET_PRODUCT_PROP += $(COMMON_PATH)/product.prop
Expand Down
11 changes: 11 additions & 0 deletions common.mk
Expand Up @@ -117,6 +117,7 @@ PRODUCT_PACKAGES += \
android.hardware.camera.provider@2.4-impl \
android.hardware.camera.provider@2.4-service_64 \
libcamera_metadata_shim \
libcamera2ndk_vendor \
vendor.qti.hardware.camera.postproc@1.0.vendor

PRODUCT_COPY_FILES += \
Expand Down Expand Up @@ -331,6 +332,13 @@ PRODUCT_PACKAGES += \
OPSoundTunerOverlay \
WifiResTarget

# Oplus-fwk
PRODUCT_PACKAGES += \
oplus-fwk

PRODUCT_BOOT_JARS += \
oplus-fwk

# Partitions
PRODUCT_USE_DYNAMIC_PARTITIONS := true

Expand Down Expand Up @@ -483,5 +491,8 @@ PRODUCT_PACKAGES += \
PRODUCT_BOOT_JARS += \
WfdCommon

# Inherit from the OnePlus Camera makefile.
$(call inherit-product, vendor/oneplus/camera/camera-vendor.mk)

# Inherit from the proprietary files makefile.
$(call inherit-product, vendor/oneplus/sm8250-common/sm8250-common-vendor.mk)
2 changes: 2 additions & 0 deletions init/init.qcom.rc
Expand Up @@ -62,6 +62,8 @@ on init
write /sys/kernel/icnss/wpss_boot 1
chmod 0660 /sys/fs/cgroup/memory/bg/tasks

setprop vendor.boot.project_name ${ro.boot.project_name}

on early-boot
# set RLIMIT_MEMLOCK to 64MB
setrlimit 8 67108864 67108864
Expand Down
5 changes: 5 additions & 0 deletions init/init.target.rc
Expand Up @@ -51,6 +51,11 @@ on fs
restorecon_recursive /mnt/vendor/persist
mkdir /mnt/vendor/persist/data 0700 system system

mkdir /mnt/vendor/dsp 0770 root root
copy /vendor/dsp/cdsp/fastrpc_shell_3 /mnt/vendor/dsp/fastrpc_shell_3
chmod 0644 /mnt/vendor/dsp/fastrpc_shell_3
mount none /mnt/vendor/dsp/fastrpc_shell_3 /vendor/dsp/cdsp/fastrpc_shell_3 bind

on post-fs
# set RLIMIT_MEMLOCK to 64MB
setrlimit 8 67108864 67108864
Expand Down
9 changes: 9 additions & 0 deletions oplus-fwk/Android.bp
@@ -0,0 +1,9 @@
java_library {
name: "oplus-fwk",
installable: true,

srcs: [
"src/**/*.aidl",
"src/**/*.java",
],
}
25 changes: 25 additions & 0 deletions oplus-fwk/src/android/app/OplusActivityManager.java
@@ -0,0 +1,25 @@
package android.app;

import android.os.RemoteException;

import com.oplus.app.OplusAppInfo;

import java.util.ArrayList;
import java.util.List;

public class OplusActivityManager {

private static OplusActivityManager sOplusActivityManager = null;
private static ArrayList<OplusAppInfo> sTopAppInfos = new ArrayList<OplusAppInfo>();

public static OplusActivityManager getInstance() {
if (sOplusActivityManager == null) {
sOplusActivityManager = new OplusActivityManager();
}
return sOplusActivityManager;
}

public List<OplusAppInfo> getAllTopAppInfos() throws RemoteException {
return (ArrayList<OplusAppInfo>) sTopAppInfos.clone();
}
}
43 changes: 43 additions & 0 deletions oplus-fwk/src/android/app/job/IJobInfoExt.java
@@ -0,0 +1,43 @@
package android.app.job;

public interface IJobInfoExt {

public final class JobBuilderExt {

public boolean mIsOplusJob;

public JobBuilderExt setRequiresBattIdle(boolean requiresBattIdle, int extra) {
return this;
}
}

default boolean getBooleanConstraint(String type, boolean defValue) {
return defValue;
}

default String getStringConstraint(String type, String defValue) {
return defValue;
}

default int getIntConstraint(String type, int defValue) {
return defValue;
}

default long getLongConstraint(String type, long defValue) {
return defValue;
}

default void setBooleanConstraint(String type, boolean value) {}

default void setStringConstraint(String type, String value) {}

default void setIntConstraint(String type, int value) {}

default void setLongConstraint(JobInfo job, String type, long value) {}

default void initJobInfo(Object in) {}

default void initJobInfoPure(JobBuilderExt jobBuilderExt) {}

default void writeToParcelJobInfo(Object out, int flags) {}
}
14 changes: 14 additions & 0 deletions oplus-fwk/src/android/common/IOplusCommonFeature.java
@@ -0,0 +1,14 @@
package android.common;

import android.common.OplusFeatureList;

public interface IOplusCommonFeature {

default OplusFeatureList.OplusIndex index() {
return OplusFeatureList.OplusIndex.End;
}

default IOplusCommonFeature getDefault() {
return null;
}
}
8 changes: 8 additions & 0 deletions oplus-fwk/src/android/common/OplusFeatureList.java
@@ -0,0 +1,8 @@
package android.common;

public class OplusFeatureList {

public enum OplusIndex {
End
}
}
13 changes: 13 additions & 0 deletions oplus-fwk/src/android/common/OplusFrameworkFactory.java
@@ -0,0 +1,13 @@
package android.common;

public class OplusFrameworkFactory {

private static OplusFrameworkFactory sOplusFrameworkFactory = null;

public static OplusFrameworkFactory getInstance() {
if (sOplusFrameworkFactory == null) {
sOplusFrameworkFactory = new OplusFrameworkFactory();
}
return sOplusFrameworkFactory;
}
}
6 changes: 6 additions & 0 deletions oplus-fwk/src/android/view/OplusWindowManager.java
@@ -0,0 +1,6 @@
package android.view;

public class OplusWindowManager {

public OplusWindowManager() {}
}
6 changes: 6 additions & 0 deletions oplus-fwk/src/com/oplus/app/OplusAppEnterInfo.java
@@ -0,0 +1,6 @@
package com.oplus.app;

public class OplusAppEnterInfo {

public OplusAppEnterInfo() {}
}
6 changes: 6 additions & 0 deletions oplus-fwk/src/com/oplus/app/OplusAppExitInfo.java
@@ -0,0 +1,6 @@
package com.oplus.app;

public class OplusAppExitInfo {

public OplusAppExitInfo() {}
}
6 changes: 6 additions & 0 deletions oplus-fwk/src/com/oplus/app/OplusAppInfo.java
@@ -0,0 +1,6 @@
package com.oplus.app;

public class OplusAppInfo {

public OplusAppInfo() {}
}
8 changes: 8 additions & 0 deletions oplus-fwk/src/com/oplus/app/OplusAppSwitchConfig.java
@@ -0,0 +1,8 @@
package com.oplus.app;

import java.util.List;

public class OplusAppSwitchConfig {

public void addAppConfig(int type, List<String> list) {}
}
37 changes: 37 additions & 0 deletions oplus-fwk/src/com/oplus/app/OplusAppSwitchManager.java
@@ -0,0 +1,37 @@
package com.oplus.app;

import android.content.Context;

public class OplusAppSwitchManager {

private static OplusAppSwitchManager sOplusAppSwitchManager = null;

public static int APP_SWITCH_VERSION = 1;

public static OplusAppSwitchManager getInstance() {
if (sOplusAppSwitchManager == null) {
sOplusAppSwitchManager = new OplusAppSwitchManager();
}
return sOplusAppSwitchManager;
}

public boolean registerAppSwitchObserver(Context context,
OnAppSwitchObserver observer, OplusAppSwitchConfig config) {
return true;
}

public boolean unregisterAppSwitchObserver(Context context, OnAppSwitchObserver observer) {
return true;
}

public interface OnAppSwitchObserver {

void onActivityEnter(OplusAppEnterInfo oplusAppEnterInfo);

void onActivityExit(OplusAppExitInfo oplusAppExitInfo);

void onAppEnter(OplusAppEnterInfo oplusAppEnterInfo);

void onAppExit(OplusAppExitInfo oplusAppExitInfo);
}
}
17 changes: 17 additions & 0 deletions oplus-fwk/src/com/oplus/content/OplusFeatureConfigManager.java
@@ -0,0 +1,17 @@
package com.oplus.content;

public class OplusFeatureConfigManager {

public static OplusFeatureConfigManager sOplusFeatureConfigManager = null;

public static OplusFeatureConfigManager getInstance() {
if (sOplusFeatureConfigManager == null) {
sOplusFeatureConfigManager = new OplusFeatureConfigManager();
}
return sOplusFeatureConfigManager;
}

public boolean hasFeature(String name) {
return false;
}
}
19 changes: 19 additions & 0 deletions oplus-fwk/src/com/oplus/orms/OplusResourceManager.java
@@ -0,0 +1,19 @@
package com.oplus.orms;

import com.oplus.orms.info.OrmsSaParam;

public class OplusResourceManager {

private static OplusResourceManager sOplusResourceManager = null;

public static OplusResourceManager getInstance(Class clazz) {
if (sOplusResourceManager == null) {
sOplusResourceManager = new OplusResourceManager();
}
return sOplusResourceManager;
}

public long ormsSetSceneAction(OrmsSaParam ormsSaParam) {
return -1L;
}
}
8 changes: 8 additions & 0 deletions oplus-fwk/src/com/oplus/orms/info/OrmsSaParam.java
@@ -0,0 +1,8 @@
package com.oplus.orms.info;

public class OrmsSaParam {

public OrmsSaParam() {}

public OrmsSaParam(String scene, String action, int timeout) {}
}
8 changes: 8 additions & 0 deletions oplus-fwk/src/com/oplus/os/OplusBuild.java
@@ -0,0 +1,8 @@
package com.oplus.os;

public class OplusBuild {

public static int getOplusOSVERSION() {
return 23;
}
}

0 comments on commit e8c3528

Please sign in to comment.