move oos cam oplus-fwk libs to hardware/oplus [2/2]

This commit is contained in:
ppanzenboeck
2025-07-15 17:17:52 +02:00
committed by TechPanelGM
parent 885b44b3d9
commit 0244760a19
24 changed files with 514 additions and 4 deletions

View File

@@ -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();
}
}

View File

@@ -0,0 +1,18 @@
package android.app;
import android.content.Context;
import java.util.ArrayList;
public class OplusWhiteListManager {
public OplusWhiteListManager(Context context) {}
public ArrayList<String> getStageProtectListFromPkg(String calledPkg, int type) {
return new ArrayList<>();
}
public void addStageProtectInfo(String pkg, long timeout) {}
public void removeStageProtectInfo(String pkg) {}
}

View File

@@ -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) {}
}

View File

@@ -0,0 +1,8 @@
package android.view;
public class OplusWindowManager {
public OplusWindowManager() {}
public void requestKeyguard(String command) {}
}

View File

@@ -0,0 +1,6 @@
package com.oplus.app;
public class OplusAppEnterInfo {
public OplusAppEnterInfo() {}
}

View File

@@ -0,0 +1,6 @@
package com.oplus.app;
public class OplusAppExitInfo {
public OplusAppExitInfo() {}
}

View File

@@ -0,0 +1,6 @@
package com.oplus.app;
public class OplusAppInfo {
public OplusAppInfo() {}
}

View File

@@ -0,0 +1,8 @@
package com.oplus.app;
import java.util.List;
public class OplusAppSwitchConfig {
public void addAppConfig(int type, List<String> list) {}
}

View File

@@ -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);
}
}

View File

@@ -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;
}
}

View File

@@ -0,0 +1,8 @@
package com.oplus.orms.info;
public class OrmsSaParam {
public OrmsSaParam() {}
public OrmsSaParam(String scene, String action, int timeout) {}
}

View File

@@ -0,0 +1,8 @@
package com.oplus.os;
public class OplusBuild {
public static int getOplusOSVERSION() {
return 23;
}
}

View File

@@ -0,0 +1,105 @@
package com.oplus.os;
import android.content.Context;
import android.os.Environment;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.UserHandle;
import android.os.storage.DiskInfo;
import android.os.storage.IStorageManager;
import android.os.storage.StorageManager;
import android.os.storage.VolumeInfo;
import android.util.Log;
import java.util.ArrayList;
import java.util.List;
public class OplusUsbEnvironment extends Environment {
private static final String TAG = "OplusUsbEnvironment";
private static final String DEFAULT_INTERNAL_PATH = "/storage/emulated/0";
private static IStorageManager sMountService = null;
private static Object sLock = new Object();
private static String sExternalSdDir = null;
private static String sInternalSdDir = DEFAULT_INTERNAL_PATH;
private static ArrayList<String> sOtgPathes = new ArrayList<>();
private static void update(Context context) {
if (sMountService == null) {
sMountService = IStorageManager.Stub.asInterface(ServiceManager.getService("mount"));
}
getVolumes();
}
public static String getExternalPath(Context context) {
String path;
synchronized (sLock) {
update(context);
path = sExternalSdDir;
}
return path;
}
public static String getInternalPath(Context context) {
String path;
synchronized (sLock) {
update(context);
path = sInternalSdDir;
}
return path;
}
public static List<String> getOtgPath(Context context) {
synchronized (sLock) {
update(context);
if (sOtgPathes == null) {
return null;
}
return (ArrayList<String>) sOtgPathes.clone();
}
}
public static void getVolumes() {
if (sMountService == null) {
Log.e(TAG, "getVolumes: sMountService is null!!!");
return;
}
try {
final VolumeInfo[] vols = sMountService.getVolumes(0);
sExternalSdDir = null;
sOtgPathes.clear();
for (VolumeInfo vol : vols) {
final String path = vol.path;
if (vol.type == 2) {
final int userId = UserHandle.myUserId();
if (path != null) {
sInternalSdDir = path.concat("/").concat(Integer.toString(userId));
}
} else {
final DiskInfo diskInfo = vol.getDisk();
if (diskInfo != null) {
if (diskInfo.isSd() && path != null) {
sExternalSdDir = path;
}
if (diskInfo.isUsb() && path != null && !sOtgPathes.contains(path)) {
sOtgPathes.add(path);
}
}
}
}
} catch (RemoteException e) {
}
}
public static boolean isVolumeMounted(Context context, String path) {
synchronized (sLock) {
update(context);
}
final StorageManager sm = (StorageManager) context.getSystemService("storage");
if (path == null || sm == null) {
return false;
}
return "mounted".equals(sm.getVolumeState(path));
}
}

View File

@@ -0,0 +1,6 @@
package com.oplus.screenshot;
public class OplusLongshotCustomController {
public OplusLongshotCustomController(OplusLongshotViewBase view, String source) {}
}

View File

@@ -0,0 +1,20 @@
package com.oplus.screenshot;
import android.content.Context;
public interface OplusLongshotViewBase {
boolean canLongScroll();
int computeLongScrollExtent();
int computeLongScrollOffset();
int computeLongScrollRange();
boolean findViewsLongshotInfo(OplusLongshowViewInfo oplusLongshowViewInfo);
Context getContext();
boolean isLongshotVisibleToUser();
}

View File

@@ -0,0 +1,6 @@
package com.oplus.screenshot;
public class OplusLongshowViewInfo {
public OplusLongshowViewInfo() {}
}

View File

@@ -0,0 +1,52 @@
package com.oplus.util;
public class OplusChangeTextUtil {
private static final String TAG = "OplusChangeTextUtil";
private static final float H1 = 0.9f;
private static final float H2 = 1.0f;
private static final float H3 = 1.1f;
private static final float H4 = 1.25f;
private static final float H5 = 1.45f;
private static final float H6 = 1.65f;
public static final int G1 = 1;
public static final int G2 = 2;
public static final int G3 = 3;
public static final int G4 = 4;
public static final int G5 = 5;
public static final int G6 = 6;
public static final float[] SCALE_LEVEL = {H1, H2, H3, H4, H5, H6};
public static float getSuitableFontSize(float textSize, float scale, int level) {
if (level < 2) {
return textSize;
}
if (level > SCALE_LEVEL.length) {
level = SCALE_LEVEL.length;
}
final float textSizeNoScale = textSize / scale;
switch (level) {
case G2:
if (scale < H3) {
return H2 * textSizeNoScale;
}
return H3 * textSizeNoScale;
case G3:
if (scale < H3) {
return H2 * textSizeNoScale;
}
if (scale < H5) {
return H3 * textSizeNoScale;
}
return H4 * textSizeNoScale;
default:
if (scale > SCALE_LEVEL[level - 1]) {
return SCALE_LEVEL[level - 1] * textSizeNoScale;
}
return textSizeNoScale * scale;
}
}
}

View File

@@ -0,0 +1,40 @@
package com.oplus.util;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Uri;
public class OplusNetworkUtil {
private static final String DEFAULT_HTTP_URI = "http://connectivitycheck.gstatic.com/generate_204";
public static boolean isWifiConnected(Context context) {
final ConnectivityManager cm = context.getSystemService(ConnectivityManager.class);
if (cm != null) {
return cm.getNetworkInfo(ConnectivityManager.TYPE_WIFI).getState()
== NetworkInfo.State.CONNECTED;
}
return false;
}
public static boolean isMobileDataConnected(Context context) {
final ConnectivityManager cm = context.getSystemService(ConnectivityManager.class);
if (cm != null) {
return cm.getNetworkInfo(ConnectivityManager.TYPE_MOBILE).getState()
== NetworkInfo.State.CONNECTED;
}
return false;
}
public static void onClickLoginBtn(Context context) {
final Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(DEFAULT_HTTP_URI));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT);
context.startActivity(intent);
}
public static int getErrorString(Context context, String url) {
return 1;
}
}

View File

@@ -0,0 +1,11 @@
package com.oplus.zoomwindow;
import com.oplus.zoomwindow.OplusZoomWindowInfo;
interface IOplusZoomWindowObserver {
void onInputMethodChanged(boolean z);
void onZoomWindowDied(String str);
void onZoomWindowHide(inout OplusZoomWindowInfo oplusZoomWindowInfo);
void onZoomWindowShow(inout OplusZoomWindowInfo oplusZoomWindowInfo);
}

View File

@@ -0,0 +1,3 @@
package com.oplus.zoomwindow;
parcelable OplusZoomWindowInfo;

View File

@@ -0,0 +1,37 @@
package com.oplus.zoomwindow;
import android.os.Parcel;
import android.os.Parcelable;
public class OplusZoomWindowInfo implements Parcelable {
public static final Parcelable.Creator<OplusZoomWindowInfo> CREATOR =
new Parcelable.Creator<OplusZoomWindowInfo>() {
@Override
public OplusZoomWindowInfo createFromParcel(Parcel source) {
return new OplusZoomWindowInfo(source);
}
@Override
public OplusZoomWindowInfo[] newArray(int size) {
return new OplusZoomWindowInfo[size];
}
};
public OplusZoomWindowInfo() {}
public OplusZoomWindowInfo(Parcel in) {}
public OplusZoomWindowInfo(OplusZoomWindowInfo in) {}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {}
public void readFromParcel(Parcel in) {}
}

View File

@@ -0,0 +1,21 @@
package com.oplus.zoomwindow;
public class OplusZoomWindowManager {
public static OplusZoomWindowManager sOplusZoomWindowManager = null;
public static OplusZoomWindowManager getInstance() {
if (sOplusZoomWindowManager == null) {
sOplusZoomWindowManager = new OplusZoomWindowManager();
}
return sOplusZoomWindowManager;
}
public boolean registerZoomWindowObserver(IOplusZoomWindowObserver observer) {
return false;
}
public boolean unregisterZoomWindowObserver(IOplusZoomWindowObserver observer) {
return false;
}
}

View File

@@ -0,0 +1,19 @@
package net.oneplus.odm;
import android.content.Context;
import java.util.Map;
public class OpDeviceManagerInjector {
private static OpDeviceManagerInjector sOpDeviceManagerInjector = null;
public void preserveAppData(Context a, String b, Map c, Map d) {}
public static OpDeviceManagerInjector getInstance() {
if (sOpDeviceManagerInjector == null) {
sOpDeviceManagerInjector = new OpDeviceManagerInjector();
}
return sOpDeviceManagerInjector;
}
}

View File

@@ -10,14 +10,12 @@ persist.sys.oplus.autotest. u:object_r:exported_system_prop:s0
persist.sys.bt.a2dp.pendingtime u:object_r:exported_system_prop:s0
# Camera
NA u:object_r:exported_system_prop:s0
cam.algo. u:object_r:exported_system_prop:s0
com.oplus.camera. u:object_r:exported_system_prop:s0
cam.algo. u:object_r:exported_system_prop:s0
com.oplus.camera. u:object_r:exported_system_prop:s0
oplus.camera. u:object_r:exported_system_prop:s0
oppo.camera. u:object_r:exported_system_prop:s0
persist.camera. u:object_r:exported_system_prop:s0
persist.camera. u:object_r:exported_system_prop:s0
persist.sys.camera.lao.enable u:object_r:exported_system_prop:s0
persist.vendor.aps.debug.framenum u:object_r:exported_system_prop:s0
persist.vendor.apsSN.algo.enable u:object_r:exported_system_prop:s0