move oos cam oplus-fwk libs to hardware/oplus [2/2]
This commit is contained in:
25
oplus-fwk/src/android/app/OplusActivityManager.java
Normal file
25
oplus-fwk/src/android/app/OplusActivityManager.java
Normal 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();
|
||||
}
|
||||
}
|
||||
18
oplus-fwk/src/android/app/OplusWhiteListManager.java
Normal file
18
oplus-fwk/src/android/app/OplusWhiteListManager.java
Normal 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) {}
|
||||
}
|
||||
43
oplus-fwk/src/android/app/job/IJobInfoExt.java
Normal file
43
oplus-fwk/src/android/app/job/IJobInfoExt.java
Normal 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) {}
|
||||
}
|
||||
8
oplus-fwk/src/android/view/OplusWindowManager.java
Normal file
8
oplus-fwk/src/android/view/OplusWindowManager.java
Normal file
@@ -0,0 +1,8 @@
|
||||
package android.view;
|
||||
|
||||
public class OplusWindowManager {
|
||||
|
||||
public OplusWindowManager() {}
|
||||
|
||||
public void requestKeyguard(String command) {}
|
||||
}
|
||||
6
oplus-fwk/src/com/oplus/app/OplusAppEnterInfo.java
Normal file
6
oplus-fwk/src/com/oplus/app/OplusAppEnterInfo.java
Normal file
@@ -0,0 +1,6 @@
|
||||
package com.oplus.app;
|
||||
|
||||
public class OplusAppEnterInfo {
|
||||
|
||||
public OplusAppEnterInfo() {}
|
||||
}
|
||||
6
oplus-fwk/src/com/oplus/app/OplusAppExitInfo.java
Normal file
6
oplus-fwk/src/com/oplus/app/OplusAppExitInfo.java
Normal file
@@ -0,0 +1,6 @@
|
||||
package com.oplus.app;
|
||||
|
||||
public class OplusAppExitInfo {
|
||||
|
||||
public OplusAppExitInfo() {}
|
||||
}
|
||||
6
oplus-fwk/src/com/oplus/app/OplusAppInfo.java
Normal file
6
oplus-fwk/src/com/oplus/app/OplusAppInfo.java
Normal file
@@ -0,0 +1,6 @@
|
||||
package com.oplus.app;
|
||||
|
||||
public class OplusAppInfo {
|
||||
|
||||
public OplusAppInfo() {}
|
||||
}
|
||||
8
oplus-fwk/src/com/oplus/app/OplusAppSwitchConfig.java
Normal file
8
oplus-fwk/src/com/oplus/app/OplusAppSwitchConfig.java
Normal file
@@ -0,0 +1,8 @@
|
||||
package com.oplus.app;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class OplusAppSwitchConfig {
|
||||
|
||||
public void addAppConfig(int type, List<String> list) {}
|
||||
}
|
||||
37
oplus-fwk/src/com/oplus/app/OplusAppSwitchManager.java
Normal file
37
oplus-fwk/src/com/oplus/app/OplusAppSwitchManager.java
Normal 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);
|
||||
}
|
||||
}
|
||||
19
oplus-fwk/src/com/oplus/orms/OplusResourceManager.java
Normal file
19
oplus-fwk/src/com/oplus/orms/OplusResourceManager.java
Normal 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;
|
||||
}
|
||||
}
|
||||
8
oplus-fwk/src/com/oplus/orms/info/OrmsSaParam.java
Normal file
8
oplus-fwk/src/com/oplus/orms/info/OrmsSaParam.java
Normal file
@@ -0,0 +1,8 @@
|
||||
package com.oplus.orms.info;
|
||||
|
||||
public class OrmsSaParam {
|
||||
|
||||
public OrmsSaParam() {}
|
||||
|
||||
public OrmsSaParam(String scene, String action, int timeout) {}
|
||||
}
|
||||
8
oplus-fwk/src/com/oplus/os/OplusBuild.java
Normal file
8
oplus-fwk/src/com/oplus/os/OplusBuild.java
Normal file
@@ -0,0 +1,8 @@
|
||||
package com.oplus.os;
|
||||
|
||||
public class OplusBuild {
|
||||
|
||||
public static int getOplusOSVERSION() {
|
||||
return 23;
|
||||
}
|
||||
}
|
||||
105
oplus-fwk/src/com/oplus/os/OplusUsbEnvironment.java
Normal file
105
oplus-fwk/src/com/oplus/os/OplusUsbEnvironment.java
Normal 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));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package com.oplus.screenshot;
|
||||
|
||||
public class OplusLongshotCustomController {
|
||||
|
||||
public OplusLongshotCustomController(OplusLongshotViewBase view, String source) {}
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package com.oplus.screenshot;
|
||||
|
||||
public class OplusLongshowViewInfo {
|
||||
|
||||
public OplusLongshowViewInfo() {}
|
||||
}
|
||||
52
oplus-fwk/src/com/oplus/util/OplusChangeTextUtil.java
Normal file
52
oplus-fwk/src/com/oplus/util/OplusChangeTextUtil.java
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
40
oplus-fwk/src/com/oplus/util/OplusNetworkUtil.java
Normal file
40
oplus-fwk/src/com/oplus/util/OplusNetworkUtil.java
Normal 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;
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
package com.oplus.zoomwindow;
|
||||
|
||||
parcelable OplusZoomWindowInfo;
|
||||
37
oplus-fwk/src/com/oplus/zoomwindow/OplusZoomWindowInfo.java
Normal file
37
oplus-fwk/src/com/oplus/zoomwindow/OplusZoomWindowInfo.java
Normal 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) {}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
19
oplus-fwk/src/net/oneplus/odm/OpDeviceManagerInjector.java
Normal file
19
oplus-fwk/src/net/oneplus/odm/OpDeviceManagerInjector.java
Normal 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;
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user