Loading core/java/android/view/SurfaceControl.java +0 −11 Original line number Diff line number Diff line Loading @@ -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) */ /** Loading Loading @@ -232,8 +229,6 @@ public class SurfaceControl { new Throwable()); } checkHeadless(); mName = name; mNativeObject = nativeCreate(session, name, w, h, format, flags); if (mNativeObject == 0) { Loading Loading @@ -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"); } } } policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +4 −11 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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 { Loading Loading @@ -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) { Loading Loading @@ -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 { Loading Loading @@ -4648,10 +4643,9 @@ public class PhoneWindowManager implements WindowManagerPolicy { /** {@inheritDoc} */ @Override public void systemReady() { if (!mHeadless) { mKeyguardDelegate = new KeyguardServiceDelegate(mContext, null); mKeyguardDelegate.onSystemReady(); } synchronized (mLock) { updateOrientationListenerLp(); mSystemReady = true; Loading @@ -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) { Loading services/java/com/android/server/SystemServer.java +3 −8 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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); } } catch (Throwable e) { reportWtf("starting Wallpaper Service", e); } Loading Loading @@ -949,9 +946,7 @@ class ServerThread { } catch (Throwable e) { reportWtf("observing native crashes", e); } if (!headless) { startSystemUi(contextF); } try { if (mountServiceF != null) mountServiceF.systemReady(); } catch (Throwable e) { Loading services/java/com/android/server/am/ActivityManagerService.java +1 −19 Original line number Diff line number Diff line Loading @@ -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. Loading Loading @@ -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)); Loading Loading @@ -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 Loading Loading @@ -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) { Loading Loading @@ -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; Loading Loading @@ -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) { services/java/com/android/server/am/ActivityStackSupervisor.java +2 −5 Original line number Diff line number Diff line Loading @@ -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) { Loading @@ -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) { Loading Loading
core/java/android/view/SurfaceControl.java +0 −11 Original line number Diff line number Diff line Loading @@ -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) */ /** Loading Loading @@ -232,8 +229,6 @@ public class SurfaceControl { new Throwable()); } checkHeadless(); mName = name; mNativeObject = nativeCreate(session, name, w, h, format, flags); if (mNativeObject == 0) { Loading Loading @@ -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"); } } }
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +4 −11 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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 { Loading Loading @@ -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) { Loading Loading @@ -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 { Loading Loading @@ -4648,10 +4643,9 @@ public class PhoneWindowManager implements WindowManagerPolicy { /** {@inheritDoc} */ @Override public void systemReady() { if (!mHeadless) { mKeyguardDelegate = new KeyguardServiceDelegate(mContext, null); mKeyguardDelegate.onSystemReady(); } synchronized (mLock) { updateOrientationListenerLp(); mSystemReady = true; Loading @@ -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) { Loading
services/java/com/android/server/SystemServer.java +3 −8 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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); } } catch (Throwable e) { reportWtf("starting Wallpaper Service", e); } Loading Loading @@ -949,9 +946,7 @@ class ServerThread { } catch (Throwable e) { reportWtf("observing native crashes", e); } if (!headless) { startSystemUi(contextF); } try { if (mountServiceF != null) mountServiceF.systemReady(); } catch (Throwable e) { Loading
services/java/com/android/server/am/ActivityManagerService.java +1 −19 Original line number Diff line number Diff line Loading @@ -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. Loading Loading @@ -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)); Loading Loading @@ -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 Loading Loading @@ -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) { Loading Loading @@ -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; Loading Loading @@ -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) {
services/java/com/android/server/am/ActivityStackSupervisor.java +2 −5 Original line number Diff line number Diff line Loading @@ -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) { Loading @@ -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) { Loading