Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

introduce pocket judge/lock #7

Open
wants to merge 51 commits into
base: eleven
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
01d8705
pocket: introduce pocket judge/lock
kaluoshi Oct 23, 2016
10ee40d
Pocket lock: Improve on fod devices
jhenrique09 Sep 12, 2020
e0e6d21
PocketJudge: allow register vendor pocket sensor
DennySPB May 28, 2020
e2136a6
PocketLock: Add config_pocketModeSupported overlay
jhenrique09 May 3, 2019
0284693
PocketLock: Make using light sensor optional
Laker87 Feb 5, 2021
a8401da
PocketJudge: Allow to register vendor proximity sensor
Hikari-no-Tenshi Jul 10, 2021
a96e828
Revert "Pocket lock: Improve on fod devices"
darknius09 Sep 30, 2022
76ec3e3
base: Remove PixelPropsUtils
palaych Sep 1, 2022
e26f2a3
base: Spoof build fingerprint for Google Play Services [1/2]
kdrag0n Oct 12, 2021
9479f0d
base: Alter model name to avoid SafetyNet HW attestation enforcement
kdrag0n Oct 12, 2021
0987076
base: Limit SafetyNet workarounds to unstable GMS process
kdrag0n Nov 2, 2021
5537264
core: pm: Wipe package cache on upgrade
krasCGQ Aug 27, 2022
25d6e8d
Fix duplicate permission privilege escalation
Apr 28, 2022
7499947
Parcel: recycle recycles
smore-lore Mar 30, 2022
bc142d8
Remove package name from SafetyNet logs
Jun 30, 2022
a79deb9
base: AttestationHooks: Spoof device as Pixel XL for Google Photos
adithya2306 Sep 8, 2022
869be13
Network Traffic [1/2]
Haus1 Jan 4, 2017
0c51001
Statusbar net monitor: stop the handler if screen is off
ezio84 Apr 9, 2018
a07bf6d
Move net monitor to expanded statusbar header
ezio84 Dec 9, 2018
73ed204
Net monitor: fix text color on light theme
ezio84 Dec 12, 2018
ffda1d6
Network traffic: fix indicator not hiding on lost connection
SpiritCroc Dec 24, 2018
e0440bc
Make sure that Network Traffic is disabled by default
nychitman1 Dec 19, 2019
1c21612
Network Traffic: Bring back traffic indicator for all
Jan 13, 2019
f8cc58f
Network Traffic: Move network indicator to the right
Miccia94 Dec 18, 2018
10c0d85
Network Traffic: OOS style network traffic indicator
ganeshi4u Mar 12, 2019
e421276
Network Traffic: Refactor text formatting
ganeshi4u Feb 6, 2020
c8ac0cf
Network Traffic: Adjust size/text style for extended statusbar
Feb 6, 2020
feb67f1
Traffic indicators: code cleanup and improvements
ezio84 Feb 9, 2020
32b4cae
Traffic indicators: use smaller and bold fonts in expanded statusbar
ezio84 Feb 9, 2020
535291b
Traffic indicators: add properly to statusbar icons
SpiritCroc Feb 11, 2020
6d629f9
Traffic indicators: hide in the keyguard
Feb 12, 2020
f243241
Traffic indicators: don't show two instances in expanded statusbar
ezio84 Feb 12, 2020
87b16a4
Traffic indicators: Prevent logspam caused by improperly calling requ…
ezio84 Feb 14, 2020
4ac7aa1
NetworkTraffic: Fix speed format for 10*KB
neobuddy89 Jun 14, 2020
ad323e3
Traffic indicators: Switch quick statusbar header to LinearLayout
ganeshi4u Oct 24, 2020
c52b0bf
SystemUI: NetworkTraffic: Add notch check and allow devices to override
adithya2306 Feb 13, 2021
f7f0f86
SystemUI: NetworkTraffic: Minor refinements
adithya2306 Feb 13, 2021
50b778b
SystemUI: Reduce statusbar network speed margins
adithya2306 Feb 24, 2021
12c4dbd
SystemUI: NetworkTrafficSB: Reduce font size a bit
adithya2306 Apr 10, 2021
1388e80
base: add MAC address firewall [1/2]
cjybyjk Jan 22, 2021
53e4d66
base: Add support for application downgrade
libxzr Mar 17, 2022
147cffa
base: Add support for window ignore secure
libxzr Mar 18, 2022
9b0c793
ResolveActivity scroll not Smooth
binhongwang Aug 2, 2022
685b9d8
SystemUI: Fix QS expand lag when VoLTE/VoWiFi icons are enabled
timjosten Jul 28, 2022
914450f
InputMethodUtils: Fix system bootloop when no IME found
neobuddy89 Dec 31, 2021
0827e7c
[1/2] Statusbar Clock background chip
StarkDroid Apr 9, 2023
390f116
ThemeOverlayManager: Apply wifi and signal icon styles last
neobuddy89 Jan 18, 2022
464804b
base: import ThemeUtils
darknius09 May 27, 2023
fcd92e7
base: Custom Statusbar Signal & Wi-Fi icons
darknius09 May 28, 2023
9ca83ee
Revert "ThemeOverlayManager: Apply wifi and signal icon styles last"
darknius09 May 28, 2023
fcf8867
Network Traffic: Fix up padding
darknius09 May 28, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
PocketLock: Add config_pocketModeSupported overlay
Change-Id: I6768c9f8cdd40b2a62df3bd9ddfa04022d69ce10
  • Loading branch information
jhenrique09 authored and darknius09 committed Sep 30, 2022

Verified

This commit was signed with the committer’s verified signature.
commit e2136a6c8198a86bad00f822a67eb78b8f190b3c
3 changes: 3 additions & 0 deletions core/res/res/values/custom_config.xml
Original file line number Diff line number Diff line change
@@ -221,4 +221,7 @@
<!-- Defines custom OEM sensor for pocket detection. -->
<string name="config_pocketJudgeVendorSensorName"></string>

<!-- Pocket Lock -->
<bool name="config_pocketModeSupported">true</bool>

</resources>
1 change: 1 addition & 0 deletions core/res/res/values/custom_symbols.xml
Original file line number Diff line number Diff line change
@@ -158,5 +158,6 @@
<java-symbol type="id" name="pocket_hint_message" />
<java-symbol type="string" name="config_pocketBridgeSysfsInpocket" />
<java-symbol type="string" name="config_pocketJudgeVendorSensorName" />
<java-symbol type="bool" name="config_pocketModeSupported" />

</resources>
Original file line number Diff line number Diff line change
@@ -73,6 +73,9 @@ public void onStateChanged(boolean isDeviceInPocket, int reason) {
}
};

// Custom methods
private boolean mSupportedByDevice;

public PocketBridgeService(Context context) {
super(context);
mContext = context;
@@ -81,9 +84,13 @@ public PocketBridgeService(Context context) {
mHandler = new PocketBridgeHandler(handlerThread.getLooper());
mPocketManager = (PocketManager)
context.getSystemService(Context.POCKET_SERVICE);
mSupportedByDevice = mContext.getResources().getBoolean(
com.android.internal.R.bool.config_pocketModeSupported);
mObserver = new PocketBridgeObserver(mHandler);
mObserver.onChange(true);
mObserver.register();
if (mSupportedByDevice){
mObserver.onChange(true);
mObserver.register();
}
}

@Override
@@ -98,7 +105,7 @@ private void setEnabled(boolean enabled) {
}

private void update() {
if (mPocketManager == null) return;
if (!mSupportedByDevice || mPocketManager == null) return;

if (mEnabled) {
mPocketManager.addCallback(mPocketCallback);
25 changes: 23 additions & 2 deletions services/core/java/com/android/server/pocket/PocketService.java
Original file line number Diff line number Diff line change
@@ -162,6 +162,7 @@ public class PocketService extends SystemService implements IBinder.DeathRecipie

// Custom methods
private boolean mPocketLockVisible;
private boolean mSupportedByDevice;

public PocketService(Context context) {
super(context);
@@ -181,9 +182,13 @@ public PocketService(Context context) {
mLightMaxRange = mLightSensor.getMaximumRange();
}
mVendorSensor = getSensor(mSensorManager, mVendorPocketSensor);
mSupportedByDevice = mContext.getResources().getBoolean(
com.android.internal.R.bool.config_pocketModeSupported);
mObserver = new PocketObserver(mHandler);
mObserver.onChange(true);
mObserver.register();
if (mSupportedByDevice){
mObserver.onChange(true);
mObserver.register();
}
}

private class PocketObserver extends ContentObserver {
@@ -452,6 +457,10 @@ public void onAccuracyChanged(Sensor sensor, int i) { }
};

private boolean isDeviceInPocket() {
if (!mSupportedByDevice){
return false;
}

if (mVendorSensorState != VENDOR_SENSOR_UNKNOWN) {
return mVendorSensorState == VENDOR_SENSOR_IN_POCKET;
}
@@ -464,6 +473,9 @@ private boolean isDeviceInPocket() {
}

private void setEnabled(boolean enabled) {
if (!mSupportedByDevice){
return;
}
if (enabled != mEnabled) {
mEnabled = enabled;
mHandler.removeCallbacksAndMessages(null);
@@ -472,6 +484,9 @@ private void setEnabled(boolean enabled) {
}

private void update() {
if (!mSupportedByDevice){
return;
}
if (!mEnabled || mInteractive) {
if (mEnabled && isDeviceInPocket()) {
// if device is judged to be in pocket while switching
@@ -486,12 +501,18 @@ private void update() {
}

private void registerSensorListeners() {
if (!mSupportedByDevice){
return;
}
startListeningForVendorSensor();
startListeningForProximity();
startListeningForLight();
}

private void unregisterSensorListeners() {
if (!mSupportedByDevice){
return;
}
stopListeningForVendorSensor();
stopListeningForProximity();
stopListeningForLight();