Skip to content

Commit b5215bd

Browse files
committed
Merge remote-tracking branch 'public/r11.0' into r11.0
2 parents f66b42e + d1e2082 commit b5215bd

File tree

72 files changed

+10194
-315
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+10194
-315
lines changed

Android.bp

+1
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,7 @@ java_library {
387387
"com.android.sysprop.apex",
388388
"com.android.sysprop.init",
389389
"PlatformProperties",
390+
"vendor.lineage.livedisplay-V2.0-java",
390391
],
391392
sdk_version: "core_platform",
392393
installable: false,

core/java/android/app/IActivityManager.aidl

+5
Original file line numberDiff line numberDiff line change
@@ -683,4 +683,9 @@ interface IActivityManager {
683683
* Kills uid with the reason of permission change.
684684
*/
685685
void killUidForPermissionChange(int appId, int userId, String reason);
686+
687+
/**
688+
* Should disable touch if three fingers to screen shot is active?
689+
*/
690+
boolean isSwipeToScreenshotGestureActive();
686691
}

core/java/android/provider/Settings.java

+74
Original file line numberDiff line numberDiff line change
@@ -4904,6 +4904,69 @@ public static void setShowGTalkServiceStatusForUser(ContentResolver cr, boolean
49044904
*/
49054905
public static final String LOCKSCREEN_BATTERY_INFO = "lockscreen_battery_info";
49064906

4907+
/**
4908+
* Color temperature of the display during the day
4909+
*/
4910+
public static final String DISPLAY_TEMPERATURE_DAY = "display_temperature_day";
4911+
4912+
/**
4913+
* Color temperature of the display at night
4914+
*/
4915+
public static final String DISPLAY_TEMPERATURE_NIGHT = "display_temperature_night";
4916+
4917+
/**
4918+
* Display color temperature adjustment mode, one of DAY (default), NIGHT, or AUTO.
4919+
*/
4920+
public static final String DISPLAY_TEMPERATURE_MODE = "display_temperature_mode";
4921+
4922+
/**
4923+
* Automatic outdoor mode
4924+
* 0 = 0ff, 1 = on
4925+
*/
4926+
public static final String DISPLAY_AUTO_OUTDOOR_MODE = "display_auto_outdoor_mode";
4927+
4928+
/**
4929+
* Reader mode
4930+
* 0 = 0ff, 1 = on
4931+
*/
4932+
public static final String DISPLAY_READING_MODE = "display_reading_mode";
4933+
4934+
/**
4935+
* Use display power saving features such as CABC or CABL
4936+
* 0 = 0ff, 1 = on
4937+
*/
4938+
public static final String DISPLAY_CABC = "display_low_power";
4939+
4940+
/**
4941+
* Use color enhancement feature of display
4942+
* 0 = 0ff, 1 = on
4943+
*/
4944+
public static final String DISPLAY_COLOR_ENHANCE = "display_color_enhance";
4945+
4946+
/**
4947+
* Use auto contrast optimization feature of display
4948+
* 0 = 0ff, 1 = on
4949+
*/
4950+
public static final String DISPLAY_AUTO_CONTRAST = "display_auto_contrast";
4951+
4952+
/**
4953+
* Manual display color adjustments (RGB values as floats, separated by spaces)
4954+
*/
4955+
public static final String DISPLAY_COLOR_ADJUSTMENT = "display_color_adjustment";
4956+
4957+
/**
4958+
* The current custom picture adjustment values as a delimited string
4959+
*/
4960+
public static final String DISPLAY_PICTURE_ADJUSTMENT =
4961+
"display_picture_adjustment";
4962+
4963+
/**
4964+
* Did we tell about how they can stop breaking their eyes?
4965+
* @hide
4966+
*/
4967+
public static final String LIVE_DISPLAY_HINTED = "live_display_hinted";
4968+
4969+
49074970
/**
49084971
* Keys we no longer back up under the current schema, but want to continue to
49094972
* process when restoring historical backup datasets.
@@ -5037,6 +5100,17 @@ public static void setShowGTalkServiceStatusForUser(ContentResolver cr, boolean
50375100
PRIVATE_SETTINGS.add(KEY_APP_SWITCH_LONG_PRESS_ACTION);
50385101
PRIVATE_SETTINGS.add(LOCKSCREEN_MEDIA_ART);
50395102
PRIVATE_SETTINGS.add(POCKET_JUDGE);
5103+
PRIVATE_SETTINGS.add(DISPLAY_TEMPERATURE_DAY);
5104+
PRIVATE_SETTINGS.add(DISPLAY_TEMPERATURE_NIGHT);
5105+
PRIVATE_SETTINGS.add(DISPLAY_TEMPERATURE_MODE);
5106+
PRIVATE_SETTINGS.add(DISPLAY_AUTO_OUTDOOR_MODE);
5107+
PRIVATE_SETTINGS.add(DISPLAY_READING_MODE);
5108+
PRIVATE_SETTINGS.add(DISPLAY_CABC);
5109+
PRIVATE_SETTINGS.add(DISPLAY_COLOR_ENHANCE);
5110+
PRIVATE_SETTINGS.add(DISPLAY_AUTO_CONTRAST);
5111+
PRIVATE_SETTINGS.add(DISPLAY_COLOR_ADJUSTMENT);
5112+
PRIVATE_SETTINGS.add(DISPLAY_PICTURE_ADJUSTMENT);
5113+
PRIVATE_SETTINGS.add(LIVE_DISPLAY_HINTED);
50405114
}
50415115

50425116
/**

core/java/android/view/ViewRootImpl.java

+14
Original file line numberDiff line numberDiff line change
@@ -5996,6 +5996,11 @@ private int processKeyEvent(QueuedInputEvent q) {
59965996
private int processPointerEvent(QueuedInputEvent q) {
59975997
final MotionEvent event = (MotionEvent)q.mEvent;
59985998

5999+
if (event.getPointerCount() == 3 && isSwipeToScreenshotGestureActive()) {
6000+
event.setAction(MotionEvent.ACTION_CANCEL);
6001+
Log.d("teste", "canceling motionEvent because of threeGesture detecting");
6002+
}
6003+
59996004
mAttachInfo.mUnbufferedDispatchRequested = false;
60006005
mAttachInfo.mHandlingPointerEvent = true;
60016006
boolean handled = mView.dispatchPointerEvent(event);
@@ -9851,4 +9856,13 @@ boolean useBLAST() {
98519856
boolean isDrawingToBLASTTransaction() {
98529857
return mNextReportConsumeBLAST;
98539858
}
9859+
9860+
private boolean isSwipeToScreenshotGestureActive() {
9861+
try {
9862+
return ActivityManager.getService().isSwipeToScreenshotGestureActive();
9863+
} catch (RemoteException e) {
9864+
Log.e("teste", "isSwipeToScreenshotGestureActive exception", e);
9865+
return false;
9866+
}
9867+
}
98549868
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/**
2+
* Copyright (c) 2015, The CyanogenMod Project
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.android.internal.custom.app;
18+
19+
import android.annotation.SdkConstant;
20+
21+
/**
22+
* @hide
23+
* TODO: We need to somehow make these managers accessible via getSystemService
24+
*/
25+
public final class LineageContextConstants {
26+
27+
/**
28+
* @hide
29+
*/
30+
private LineageContextConstants() {
31+
// Empty constructor
32+
}
33+
34+
/**
35+
* Use with {@link android.content.Context#getSystemService} to retrieve a
36+
* {@link com.android.internal.custom.LineageHardwareManager} to manage the extended
37+
* hardware features of the device.
38+
*
39+
* @see android.content.Context#getSystemService
40+
* @see com.android.internal.custom.LineageHardwareManager
41+
*
42+
* @hide
43+
*/
44+
public static final String LINEAGE_HARDWARE_SERVICE = "lineagehardware";
45+
46+
/**
47+
* Manages display color adjustments
48+
*
49+
* @hide
50+
*/
51+
public static final String LINEAGE_LIVEDISPLAY_SERVICE = "lineagelivedisplay";
52+
53+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/*
2+
* Copyright (C) 2013 The CyanogenMod Project
3+
* Copyright (C) 2018 The LineageOS Project
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
package com.android.internal.custom.hardware;
19+
20+
import android.util.Log;
21+
22+
import com.android.internal.util.custom.FileUtils;
23+
24+
/**
25+
* Adaptive backlight support (this refers to technologies like NVIDIA SmartDimmer,
26+
* QCOM CABL or Samsung CABC).
27+
*/
28+
public class AdaptiveBacklight {
29+
30+
private static final String TAG = "AdaptiveBacklight";
31+
32+
private static final String FILE_CABC = "/sys/class/graphics/fb0/cabc";
33+
34+
/**
35+
* Whether device supports an adaptive backlight technology.
36+
*
37+
* @return boolean Supported devices must return always true
38+
*/
39+
public static boolean isSupported() {
40+
return FileUtils.isFileReadable(FILE_CABC) && FileUtils.isFileWritable(FILE_CABC);
41+
}
42+
43+
/**
44+
* This method return the current activation status of the adaptive backlight technology.
45+
*
46+
* @return boolean Must be false when adaptive backlight is not supported or not activated, or
47+
* the operation failed while reading the status; true in any other case.
48+
*/
49+
public static boolean isEnabled() {
50+
return Integer.parseInt(FileUtils.readOneLine(FILE_CABC)) > 0;
51+
}
52+
53+
/**
54+
* This method allows to setup adaptive backlight technology status.
55+
*
56+
* @param status The new adaptive backlight status
57+
* @return boolean Must be false if adaptive backlight is not supported or the operation
58+
* failed; true in any other case.
59+
*/
60+
public static boolean setEnabled(boolean status) {
61+
return FileUtils.writeLine(FILE_CABC, status ? "1" : "0");
62+
}
63+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
/*
2+
* Copyright (C) 2014 The CyanogenMod Project
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.android.internal.custom.hardware;
18+
19+
import com.android.internal.util.custom.FileUtils;
20+
21+
import android.util.Log;
22+
23+
/**
24+
* Auto Contrast Optimization
25+
*/
26+
public class AutoContrast {
27+
28+
private static final String TAG = "AutoContrast";
29+
30+
private static final String FILE_ACO = "/sys/class/graphics/fb0/aco";
31+
32+
/**
33+
* Whether device supports ACO
34+
*
35+
* @return boolean Supported devices must return always true
36+
*/
37+
public static boolean isSupported() {
38+
return FileUtils.isFileReadable(FILE_ACO) && FileUtils.isFileWritable(FILE_ACO);
39+
}
40+
41+
/**
42+
* This method return the current activation status of ACO
43+
*
44+
* @return boolean Must be false when ACO is not supported or not activated, or
45+
* the operation failed while reading the status; true in any other case.
46+
*/
47+
public static boolean isEnabled() {
48+
try {
49+
return Integer.parseInt(FileUtils.readOneLine(FILE_ACO)) > 0;
50+
} catch (Exception e) {
51+
Log.e(TAG, e.getMessage(), e);
52+
}
53+
return false;
54+
}
55+
56+
/**
57+
* This method allows to setup ACO
58+
*
59+
* @param status The new ACO status
60+
* @return boolean Must be false if ACO is not supported or the operation
61+
* failed; true in any other case.
62+
*/
63+
public static boolean setEnabled(boolean status) {
64+
return FileUtils.writeLine(FILE_ACO, status ? "1" : "0");
65+
}
66+
67+
/**
68+
* Whether adaptive backlight (CABL / CABC) is required to be enabled
69+
*
70+
* @return boolean False if adaptive backlight is not a dependency
71+
*/
72+
public static boolean isAdaptiveBacklightRequired() {
73+
return false;
74+
}
75+
}

0 commit comments

Comments
 (0)