diff options
author | Mike Lockwood <lockwood@google.com> | 2013-11-15 11:01:47 -0800 |
---|---|---|
committer | Mike Lockwood <lockwood@google.com> | 2013-11-15 11:01:47 -0800 |
commit | ed8902d3b5452860d87aaa0ed7fba8abb73fc983 (patch) | |
tree | 6d05f5adb02619dae31133aa62aa22348825654f | |
parent | 30cb5c3ffa259f2a6df02a81a766c716477f4b92 (diff) | |
download | frameworks_base-ed8902d3b5452860d87aaa0ed7fba8abb73fc983.zip frameworks_base-ed8902d3b5452860d87aaa0ed7fba8abb73fc983.tar.gz frameworks_base-ed8902d3b5452860d87aaa0ed7fba8abb73fc983.tar.bz2 |
Remove obsolete "headless" support
Change-Id: I18e7a4c5166163372ec0a8abbef1063668a0f5b6
8 files changed, 13 insertions, 153 deletions
diff --git a/core/java/android/view/SurfaceControl.java b/core/java/android/view/SurfaceControl.java index b22d5cf..a06a20b 100644 --- a/core/java/android/view/SurfaceControl.java +++ b/core/java/android/view/SurfaceControl.java @@ -79,9 +79,6 @@ public class SurfaceControl { private final String mName; int mNativeObject; // package visibility only for Surface.java access - private static final boolean HEADLESS = "1".equals( - SystemProperties.get("ro.config.headless", "0")); - /* flags used in constructor (keep in sync with ISurfaceComposerClient.h) */ /** @@ -232,8 +229,6 @@ public class SurfaceControl { new Throwable()); } - checkHeadless(); - mName = name; mNativeObject = nativeCreate(session, name, w, h, format, flags); if (mNativeObject == 0) { @@ -619,10 +614,4 @@ public class SurfaceControl { } nativeScreenshot(display, consumer, width, height, minLayer, maxLayer, allLayers); } - - private static void checkHeadless() { - if (HEADLESS) { - throw new UnsupportedOperationException("Device is headless"); - } - } } diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java index 9917f2e..4d84984 100644 --- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java @@ -234,7 +234,6 @@ public class PhoneWindowManager implements WindowManagerPolicy { /** If true, hitting shift & menu will broadcast Intent.ACTION_BUG_REPORT */ boolean mEnableShiftMenuBugReports = false; - boolean mHeadless; boolean mSafeMode; WindowState mStatusBar = null; int mStatusBarHeight; @@ -847,7 +846,6 @@ public class PhoneWindowManager implements WindowManagerPolicy { mContext = context; mWindowManager = windowManager; mWindowManagerFuncs = windowManagerFuncs; - mHeadless = "1".equals(SystemProperties.get("ro.config.headless", "0")); mHandler = new PolicyHandler(); mOrientationListener = new MyOrientationListener(mContext, mHandler); try { @@ -3587,9 +3585,6 @@ public class PhoneWindowManager implements WindowManagerPolicy { /** {@inheritDoc} */ public void notifyLidSwitchChanged(long whenNanos, boolean lidOpen) { - // do nothing if headless - if (mHeadless) return; - // lid changed state final int newLidState = lidOpen ? LID_OPEN : LID_CLOSED; if (newLidState == mLidState) { @@ -3822,7 +3817,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { // the device some other way (which is why we have an exemption here for injected // events). int result; - if ((isScreenOn && !mHeadless) || (isInjected && !isWakeKey)) { + if (isScreenOn || (isInjected && !isWakeKey)) { // When the screen is on or if the key is injected pass the key to the application. result = ACTION_PASS_TO_USER; } else { @@ -4648,10 +4643,9 @@ public class PhoneWindowManager implements WindowManagerPolicy { /** {@inheritDoc} */ @Override public void systemReady() { - if (!mHeadless) { - mKeyguardDelegate = new KeyguardServiceDelegate(mContext, null); - mKeyguardDelegate.onSystemReady(); - } + mKeyguardDelegate = new KeyguardServiceDelegate(mContext, null); + mKeyguardDelegate.onSystemReady(); + synchronized (mLock) { updateOrientationListenerLp(); mSystemReady = true; @@ -4678,7 +4672,6 @@ public class PhoneWindowManager implements WindowManagerPolicy { /** {@inheritDoc} */ public void showBootMessage(final CharSequence msg, final boolean always) { - if (mHeadless) return; mHandler.post(new Runnable() { @Override public void run() { if (mBootMsgDialog == null) { diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java index e4af687..a6238d4 100644 --- a/services/java/com/android/server/SystemServer.java +++ b/services/java/com/android/server/SystemServer.java @@ -127,7 +127,6 @@ class ServerThread { String factoryTestStr = SystemProperties.get("ro.factorytest"); int factoryTest = "".equals(factoryTestStr) ? SystemServer.FACTORY_TEST_OFF : Integer.parseInt(factoryTestStr); - final boolean headless = "1".equals(SystemProperties.get("ro.config.headless", "0")); Installer installer = null; AccountManagerService accountManager = null; @@ -629,10 +628,8 @@ class ServerThread { R.bool.config_enableWallpaperService)) { try { Slog.i(TAG, "Wallpaper Service"); - if (!headless) { - wallpaper = new WallpaperManagerService(context); - ServiceManager.addService(Context.WALLPAPER_SERVICE, wallpaper); - } + wallpaper = new WallpaperManagerService(context); + ServiceManager.addService(Context.WALLPAPER_SERVICE, wallpaper); } catch (Throwable e) { reportWtf("starting Wallpaper Service", e); } @@ -949,9 +946,7 @@ class ServerThread { } catch (Throwable e) { reportWtf("observing native crashes", e); } - if (!headless) { - startSystemUi(contextF); - } + startSystemUi(contextF); try { if (mountServiceF != null) mountServiceF.systemReady(); } catch (Throwable e) { diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java index 253b6b3..265fe75 100644 --- a/services/java/com/android/server/am/ActivityManagerService.java +++ b/services/java/com/android/server/am/ActivityManagerService.java @@ -331,8 +331,6 @@ public final class ActivityManagerService extends ActivityManagerNative public IntentFirewall mIntentFirewall; - private final boolean mHeadless; - // Whether we should show our dialogs (ANR, crash, etc) or just perform their // default actuion automatically. Important for devices without direct input // devices. @@ -1984,8 +1982,6 @@ public final class ActivityManagerService extends ActivityManagerNative mGrantFile = new AtomicFile(new File(systemDir, "urigrants.xml")); - mHeadless = "1".equals(SystemProperties.get("ro.config.headless", "0")); - // User 0 is the first and only user that runs at boot. mStartedUsers.put(0, new UserStartedState(new UserHandle(0), true)); mUserLru.add(Integer.valueOf(0)); @@ -2852,13 +2848,6 @@ public final class ActivityManagerService extends ActivityManagerNative } boolean startHomeActivityLocked(int userId) { - if (mHeadless) { - // Added because none of the other calls to ensureBootCompleted seem to fire - // when running headless. - ensureBootCompleted(); - return false; - } - if (mFactoryTest == SystemServer.FACTORY_TEST_LOW_LEVEL && mTopAction == null) { // We are running in factory test mode, but unable to find @@ -5003,7 +4992,7 @@ public final class ActivityManagerService extends ActivityManagerNative // See if the top visible activity is waiting to run in this process... if (normalMode) { try { - if (mStackSupervisor.attachApplicationLocked(app, mHeadless)) { + if (mStackSupervisor.attachApplicationLocked(app)) { didSomething = true; } } catch (Exception e) { @@ -9502,10 +9491,6 @@ public final class ActivityManagerService extends ActivityManagerNative private boolean handleAppCrashLocked(ProcessRecord app, String shortMsg, String longMsg, String stackTrace) { - if (mHeadless) { - Log.e(TAG, "handleAppCrashLocked: " + app.processName); - return false; - } long now = SystemClock.uptimeMillis(); Long crashTime; @@ -14049,9 +14034,6 @@ public final class ActivityManagerService extends ActivityManagerNative */ boolean updateConfigurationLocked(Configuration values, ActivityRecord starting, boolean persistent, boolean initLocale) { - // do nothing if we are headless - if (mHeadless) return true; - int changes = 0; if (values != null) { diff --git a/services/java/com/android/server/am/ActivityStackSupervisor.java b/services/java/com/android/server/am/ActivityStackSupervisor.java index 483b4a0..f4ca324 100644 --- a/services/java/com/android/server/am/ActivityStackSupervisor.java +++ b/services/java/com/android/server/am/ActivityStackSupervisor.java @@ -366,7 +366,7 @@ public final class ActivityStackSupervisor { return resumedActivity; } - boolean attachApplicationLocked(ProcessRecord app, boolean headless) throws Exception { + boolean attachApplicationLocked(ProcessRecord app) throws Exception { boolean didSomething = false; final String processName = app.processName; for (int stackNdx = mStacks.size() - 1; stackNdx >= 0; --stackNdx) { @@ -379,10 +379,7 @@ public final class ActivityStackSupervisor { if (hr.app == null && app.uid == hr.info.applicationInfo.uid && processName.equals(hr.processName)) { try { - if (headless) { - Slog.e(TAG, "Starting activities not supported on headless device: " - + hr); - } else if (realStartActivityLocked(hr, app, true, true)) { + if (realStartActivityLocked(hr, app, true, true)) { didSomething = true; } } catch (Exception e) { diff --git a/services/java/com/android/server/display/DisplayManagerService.java b/services/java/com/android/server/display/DisplayManagerService.java index 02f26b3..85681c3 100644 --- a/services/java/com/android/server/display/DisplayManagerService.java +++ b/services/java/com/android/server/display/DisplayManagerService.java @@ -101,7 +101,6 @@ public final class DisplayManagerService extends IDisplayManager.Stub { // Otherwise WFD is enabled according to the value of config_enableWifiDisplay. private static final String FORCE_WIFI_DISPLAY_ENABLE = "persist.debug.wfd.enable"; - private static final String SYSTEM_HEADLESS = "ro.config.headless"; private static final long WAIT_FOR_DEFAULT_DISPLAY_TIMEOUT = 10000; private static final int MSG_REGISTER_DEFAULT_DISPLAY_ADAPTER = 1; @@ -115,7 +114,6 @@ public final class DisplayManagerService extends IDisplayManager.Stub { private static final int DISPLAY_BLANK_STATE_UNBLANKED = 2; private final Context mContext; - private final boolean mHeadless; private final DisplayManagerHandler mHandler; private final Handler mUiHandler; private final DisplayAdapterListener mDisplayAdapterListener; @@ -198,8 +196,6 @@ public final class DisplayManagerService extends IDisplayManager.Stub { public DisplayManagerService(Context context, Handler mainHandler) { mContext = context; - mHeadless = SystemProperties.get(SYSTEM_HEADLESS).equals("1"); - mHandler = new DisplayManagerHandler(mainHandler.getLooper()); mUiHandler = UiThread.getHandler(); mDisplayAdapterListener = new DisplayAdapterListener(); @@ -266,15 +262,6 @@ public final class DisplayManagerService extends IDisplayManager.Stub { } /** - * Returns true if the device is headless. - * - * @return True if the device is headless. - */ - public boolean isHeadless() { - return mHeadless; - } - - /** * Registers a display transaction listener to provide the client a chance to * update its surfaces within the same transaction as any display layout updates. * @@ -723,13 +710,8 @@ public final class DisplayManagerService extends IDisplayManager.Stub { private void registerDefaultDisplayAdapter() { // Register default display adapter. synchronized (mSyncRoot) { - if (mHeadless) { - registerDisplayAdapterLocked(new HeadlessDisplayAdapter( - mSyncRoot, mContext, mHandler, mDisplayAdapterListener)); - } else { - registerDisplayAdapterLocked(new LocalDisplayAdapter( - mSyncRoot, mContext, mHandler, mDisplayAdapterListener)); - } + registerDisplayAdapterLocked(new LocalDisplayAdapter( + mSyncRoot, mContext, mHandler, mDisplayAdapterListener)); } } @@ -1097,7 +1079,6 @@ public final class DisplayManagerService extends IDisplayManager.Stub { pw.println("DISPLAY MANAGER (dumpsys display)"); synchronized (mSyncRoot) { - pw.println(" mHeadless=" + mHeadless); pw.println(" mOnlyCode=" + mOnlyCore); pw.println(" mSafeMode=" + mSafeMode); pw.println(" mPendingTraversal=" + mPendingTraversal); diff --git a/services/java/com/android/server/display/HeadlessDisplayAdapter.java b/services/java/com/android/server/display/HeadlessDisplayAdapter.java deleted file mode 100644 index 7a104d7..0000000 --- a/services/java/com/android/server/display/HeadlessDisplayAdapter.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (C) 2012 The Android Open Source 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.server.display; - -import android.content.Context; -import android.os.Handler; -import android.util.DisplayMetrics; -import android.view.Display; - -/** - * Provides a fake default display for headless systems. - * <p> - * Display adapters are guarded by the {@link DisplayManagerService.SyncRoot} lock. - * </p> - */ -final class HeadlessDisplayAdapter extends DisplayAdapter { - private static final String TAG = "HeadlessDisplayAdapter"; - - // Called with SyncRoot lock held. - public HeadlessDisplayAdapter(DisplayManagerService.SyncRoot syncRoot, - Context context, Handler handler, Listener listener) { - super(syncRoot, context, handler, listener, TAG); - } - - @Override - public void registerLocked() { - super.registerLocked(); - sendDisplayDeviceEventLocked(new HeadlessDisplayDevice(), DISPLAY_DEVICE_EVENT_ADDED); - } - - private final class HeadlessDisplayDevice extends DisplayDevice { - private DisplayDeviceInfo mInfo; - - public HeadlessDisplayDevice() { - super(HeadlessDisplayAdapter.this, null); - } - - @Override - public DisplayDeviceInfo getDisplayDeviceInfoLocked() { - if (mInfo == null) { - mInfo = new DisplayDeviceInfo(); - mInfo.name = getContext().getResources().getString( - com.android.internal.R.string.display_manager_built_in_display_name); - mInfo.width = 640; - mInfo.height = 480; - mInfo.refreshRate = 60; - mInfo.densityDpi = DisplayMetrics.DENSITY_DEFAULT; - mInfo.xDpi = 160; - mInfo.yDpi = 160; - mInfo.flags = DisplayDeviceInfo.FLAG_DEFAULT_DISPLAY - | DisplayDeviceInfo.FLAG_SECURE - | DisplayDeviceInfo.FLAG_SUPPORTS_PROTECTED_BUFFERS; - mInfo.type = Display.TYPE_BUILT_IN; - mInfo.touch = DisplayDeviceInfo.TOUCH_NONE; - } - return mInfo; - } - } -} diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java index 865e72c..4feabf5 100644 --- a/services/java/com/android/server/wm/WindowManagerService.java +++ b/services/java/com/android/server/wm/WindowManagerService.java @@ -290,8 +290,6 @@ public class WindowManagerService extends IWindowManager.Stub final private KeyguardDisableHandler mKeyguardDisableHandler; - private final boolean mHeadless; - final BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { @@ -731,7 +729,6 @@ public class WindowManagerService extends IWindowManager.Stub com.android.internal.R.bool.config_sf_limitedAlpha); mInputManager = inputManager; // Must be before createDisplayContentLocked. mDisplayManagerService = displayManager; - mHeadless = displayManager.isHeadless(); mDisplaySettings = new DisplaySettings(context); mDisplaySettings.readSettingsLocked(); @@ -5249,7 +5246,7 @@ public class WindowManagerService extends IWindowManager.Stub public void performBootTimeout() { synchronized(mWindowMap) { - if (mDisplayEnabled || mHeadless) { + if (mDisplayEnabled) { return; } Slog.w(TAG, "***** BOOT TIMEOUT: forcing display enabled"); @@ -5433,7 +5430,6 @@ public class WindowManagerService extends IWindowManager.Stub // only allow disables from pids which have count on, etc. @Override public void showStrictModeViolation(boolean on) { - if (mHeadless) return; int pid = Binder.getCallingPid(); mH.sendMessage(mH.obtainMessage(H.SHOW_STRICT_MODE_VIOLATION, on ? 1 : 0, pid)); } |