-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'public/r11.0' into r11.0
- Loading branch information
Showing
72 changed files
with
10,194 additions
and
315 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
core/java/com/android/internal/custom/app/LineageContextConstants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/** | ||
* Copyright (c) 2015, The CyanogenMod Project | ||
* | ||
* 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. | ||
*/ | ||
|
||
package com.android.internal.custom.app; | ||
|
||
import android.annotation.SdkConstant; | ||
|
||
/** | ||
* @hide | ||
* TODO: We need to somehow make these managers accessible via getSystemService | ||
*/ | ||
public final class LineageContextConstants { | ||
|
||
/** | ||
* @hide | ||
*/ | ||
private LineageContextConstants() { | ||
// Empty constructor | ||
} | ||
|
||
/** | ||
* Use with {@link android.content.Context#getSystemService} to retrieve a | ||
* {@link com.android.internal.custom.LineageHardwareManager} to manage the extended | ||
* hardware features of the device. | ||
* | ||
* @see android.content.Context#getSystemService | ||
* @see com.android.internal.custom.LineageHardwareManager | ||
* | ||
* @hide | ||
*/ | ||
public static final String LINEAGE_HARDWARE_SERVICE = "lineagehardware"; | ||
|
||
/** | ||
* Manages display color adjustments | ||
* | ||
* @hide | ||
*/ | ||
public static final String LINEAGE_LIVEDISPLAY_SERVICE = "lineagelivedisplay"; | ||
|
||
} |
63 changes: 63 additions & 0 deletions
63
core/java/com/android/internal/custom/hardware/AdaptiveBacklight.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/* | ||
* Copyright (C) 2013 The CyanogenMod Project | ||
* Copyright (C) 2018 The LineageOS Project | ||
* | ||
* 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. | ||
*/ | ||
|
||
package com.android.internal.custom.hardware; | ||
|
||
import android.util.Log; | ||
|
||
import com.android.internal.util.custom.FileUtils; | ||
|
||
/** | ||
* Adaptive backlight support (this refers to technologies like NVIDIA SmartDimmer, | ||
* QCOM CABL or Samsung CABC). | ||
*/ | ||
public class AdaptiveBacklight { | ||
|
||
private static final String TAG = "AdaptiveBacklight"; | ||
|
||
private static final String FILE_CABC = "/sys/class/graphics/fb0/cabc"; | ||
|
||
/** | ||
* Whether device supports an adaptive backlight technology. | ||
* | ||
* @return boolean Supported devices must return always true | ||
*/ | ||
public static boolean isSupported() { | ||
return FileUtils.isFileReadable(FILE_CABC) && FileUtils.isFileWritable(FILE_CABC); | ||
} | ||
|
||
/** | ||
* This method return the current activation status of the adaptive backlight technology. | ||
* | ||
* @return boolean Must be false when adaptive backlight is not supported or not activated, or | ||
* the operation failed while reading the status; true in any other case. | ||
*/ | ||
public static boolean isEnabled() { | ||
return Integer.parseInt(FileUtils.readOneLine(FILE_CABC)) > 0; | ||
} | ||
|
||
/** | ||
* This method allows to setup adaptive backlight technology status. | ||
* | ||
* @param status The new adaptive backlight status | ||
* @return boolean Must be false if adaptive backlight is not supported or the operation | ||
* failed; true in any other case. | ||
*/ | ||
public static boolean setEnabled(boolean status) { | ||
return FileUtils.writeLine(FILE_CABC, status ? "1" : "0"); | ||
} | ||
} |
75 changes: 75 additions & 0 deletions
75
core/java/com/android/internal/custom/hardware/AutoContrast.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/* | ||
* Copyright (C) 2014 The CyanogenMod Project | ||
* | ||
* 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. | ||
*/ | ||
|
||
package com.android.internal.custom.hardware; | ||
|
||
import com.android.internal.util.custom.FileUtils; | ||
|
||
import android.util.Log; | ||
|
||
/** | ||
* Auto Contrast Optimization | ||
*/ | ||
public class AutoContrast { | ||
|
||
private static final String TAG = "AutoContrast"; | ||
|
||
private static final String FILE_ACO = "/sys/class/graphics/fb0/aco"; | ||
|
||
/** | ||
* Whether device supports ACO | ||
* | ||
* @return boolean Supported devices must return always true | ||
*/ | ||
public static boolean isSupported() { | ||
return FileUtils.isFileReadable(FILE_ACO) && FileUtils.isFileWritable(FILE_ACO); | ||
} | ||
|
||
/** | ||
* This method return the current activation status of ACO | ||
* | ||
* @return boolean Must be false when ACO is not supported or not activated, or | ||
* the operation failed while reading the status; true in any other case. | ||
*/ | ||
public static boolean isEnabled() { | ||
try { | ||
return Integer.parseInt(FileUtils.readOneLine(FILE_ACO)) > 0; | ||
} catch (Exception e) { | ||
Log.e(TAG, e.getMessage(), e); | ||
} | ||
return false; | ||
} | ||
|
||
/** | ||
* This method allows to setup ACO | ||
* | ||
* @param status The new ACO status | ||
* @return boolean Must be false if ACO is not supported or the operation | ||
* failed; true in any other case. | ||
*/ | ||
public static boolean setEnabled(boolean status) { | ||
return FileUtils.writeLine(FILE_ACO, status ? "1" : "0"); | ||
} | ||
|
||
/** | ||
* Whether adaptive backlight (CABL / CABC) is required to be enabled | ||
* | ||
* @return boolean False if adaptive backlight is not a dependency | ||
*/ | ||
public static boolean isAdaptiveBacklightRequired() { | ||
return false; | ||
} | ||
} |
Oops, something went wrong.