Remove WindowManager references in Stk

Bug: 65884891
Bug: 143536562
Change-Id: Iaeb07569534a501b66f381f68c6341270529231b
Fix: 143536562
Test: Build
This commit is contained in:
Peter Wang
2020-01-27 12:31:07 +08:00
parent 70156bd8fe
commit 26d8cb3860
8 changed files with 7 additions and 57 deletions

View File

@@ -557,12 +557,6 @@ interface IWindowManager
*/
boolean isWindowTraceEnabled();
/**
* Requests that the WindowManager sends
* WindowManagerPolicyConstants#ACTION_USER_ACTIVITY_NOTIFICATION on the next user activity.
*/
void requestUserActivityNotification();
/**
* Notify WindowManager that it should not override the info in DisplayManager for the specified
* display. This can disable letter- or pillar-boxing applied in DisplayManager when the metrics

View File

@@ -65,12 +65,6 @@ public interface WindowManagerPolicyConstants {
String NAV_BAR_MODE_2BUTTON_OVERLAY = "com.android.internal.systemui.navbar.twobutton";
String NAV_BAR_MODE_GESTURAL_OVERLAY = "com.android.internal.systemui.navbar.gestural";
/**
* Broadcast sent when a user activity is detected.
*/
String ACTION_USER_ACTIVITY_NOTIFICATION =
"android.intent.action.USER_ACTIVITY_NOTIFICATION";
/**
* Sticky broadcast of the current HDMI plugged state.
*/

View File

@@ -94,7 +94,6 @@
<protected-broadcast android:name="android.intent.action.OVERLAY_CHANGED" />
<protected-broadcast android:name="android.intent.action.OVERLAY_REMOVED" />
<protected-broadcast android:name="android.intent.action.OVERLAY_PRIORITY_CHANGED" />
<protected-broadcast android:name="android.intent.action.USER_ACTIVITY_NOTIFICATION" />
<protected-broadcast android:name="android.intent.action.MY_PACKAGE_SUSPENDED" />
<protected-broadcast android:name="android.intent.action.MY_PACKAGE_UNSUSPENDED" />

View File

@@ -333,8 +333,6 @@ public class PhoneWindowManager implements WindowManagerPolicy {
KeyEvent.KEYCODE_CALCULATOR, Intent.CATEGORY_APP_CALCULATOR);
}
private static final int USER_ACTIVITY_NOTIFICATION_DELAY = 200;
/** Amount of time (in milliseconds) to wait for windows drawn before powering on. */
static final int WAITING_FOR_DRAWN_TIMEOUT = 1000;
@@ -487,7 +485,6 @@ public class PhoneWindowManager implements WindowManagerPolicy {
private boolean mPendingKeyguardOccluded;
private boolean mKeyguardOccludedChanged;
private boolean mNotifyUserActivity;
SleepToken mScreenOffSleepToken;
volatile boolean mKeyguardOccluded;
@@ -627,8 +624,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
private static final int MSG_LAUNCH_ASSIST = 23;
private static final int MSG_LAUNCH_ASSIST_LONG_PRESS = 24;
private static final int MSG_POWER_VERY_LONG_PRESS = 25;
private static final int MSG_NOTIFY_USER_ACTIVITY = 26;
private static final int MSG_RINGER_TOGGLE_CHORD = 27;
private static final int MSG_RINGER_TOGGLE_CHORD = 26;
private class PolicyHandler extends Handler {
@Override
@@ -708,13 +704,6 @@ public class PhoneWindowManager implements WindowManagerPolicy {
case MSG_HANDLE_ALL_APPS:
launchAllAppsAction();
break;
case MSG_NOTIFY_USER_ACTIVITY:
removeMessages(MSG_NOTIFY_USER_ACTIVITY);
Intent intent = new Intent(ACTION_USER_ACTIVITY_NOTIFICATION);
intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY);
mContext.sendBroadcastAsUser(intent, UserHandle.ALL,
android.Manifest.permission.USER_ACTIVITY);
break;
case MSG_RINGER_TOGGLE_CHORD:
handleRingerChordGesture();
break;
@@ -4892,13 +4881,6 @@ public class PhoneWindowManager implements WindowManagerPolicy {
mHandler.sendEmptyMessage(MSG_HIDE_BOOT_MESSAGE);
}
@Override
public void requestUserActivityNotification() {
if (!mNotifyUserActivity && !mHandler.hasMessages(MSG_NOTIFY_USER_ACTIVITY)) {
mNotifyUserActivity = true;
}
}
/** {@inheritDoc} */
@Override
public void userActivity() {
@@ -4920,12 +4902,6 @@ public class PhoneWindowManager implements WindowManagerPolicy {
mHandler.postDelayed(mScreenLockTimeout, mLockScreenTimeout);
}
}
if (mDefaultDisplayPolicy.isAwake() && mNotifyUserActivity) {
mHandler.sendEmptyMessageDelayed(MSG_NOTIFY_USER_ACTIVITY,
USER_ACTIVITY_NOTIFICATION_DELAY);
mNotifyUserActivity = false;
}
}
class ScreenLockTimeout implements Runnable {

View File

@@ -1437,12 +1437,6 @@ public interface WindowManagerPolicy extends WindowManagerPolicyConstants {
}
}
/**
* Requests that the WindowManager sends
* WindowManagerPolicyConstants#ACTION_USER_ACTIVITY_NOTIFICATION on the next user activity.
*/
public void requestUserActivityNotification();
/**
* Registers an IDisplayFoldListener.
*/

View File

@@ -7032,15 +7032,6 @@ public class WindowManagerService extends IWindowManager.Stub
mPolicy.registerShortcutKey(shortcutCode, shortcutKeyReceiver);
}
@Override
public void requestUserActivityNotification() {
if (!checkCallingPermission(android.Manifest.permission.USER_ACTIVITY,
"requestUserActivityNotification()")) {
throw new SecurityException("Requires USER_ACTIVITY permission");
}
mPolicy.requestUserActivityNotification();
}
private final class LocalService extends WindowManagerInternal {
@Override

View File

@@ -405,10 +405,6 @@ class TestWindowManagerPolicy implements WindowManagerPolicy {
return true;
}
@Override
public void requestUserActivityNotification() {
}
@Override
public boolean setAodShowing(boolean aodShowing) {
return false;

View File

@@ -315,4 +315,10 @@ public class TelephonyIntents {
*/
public static final String ACTION_LINE1_NUMBER_ERROR_DETECTED =
"com.android.internal.telephony.ACTION_LINE1_NUMBER_ERROR_DETECTED";
/**
* Broadcast sent when a user activity is detected.
*/
public static final String ACTION_USER_ACTIVITY_NOTIFICATION =
"android.intent.action.USER_ACTIVITY_NOTIFICATION";
}