Loading packages/SystemUI/src/com/android/systemui/clipboardoverlay/ClipboardListener.java +2 −6 Original line number Original line Diff line number Diff line Loading @@ -27,7 +27,7 @@ import static com.google.android.setupcompat.util.WizardManagerHelper.SETTINGS_S import android.content.ClipData; import android.content.ClipData; import android.content.ClipboardManager; import android.content.ClipboardManager; import android.content.Context; import android.content.Context; import android.os.SystemProperties; import android.os.Build; import android.provider.Settings; import android.provider.Settings; import android.util.Log; import android.util.Log; Loading Loading @@ -87,7 +87,7 @@ public class ClipboardListener implements String clipSource = mClipboardManager.getPrimaryClipSource(); String clipSource = mClipboardManager.getPrimaryClipSource(); ClipData clipData = mClipboardManager.getPrimaryClip(); ClipData clipData = mClipboardManager.getPrimaryClip(); if (shouldSuppressOverlay(clipData, clipSource, isEmulator())) { if (shouldSuppressOverlay(clipData, clipSource, Build.IS_EMULATOR)) { Log.i(TAG, "Clipboard overlay suppressed."); Log.i(TAG, "Clipboard overlay suppressed."); return; return; } } Loading Loading @@ -141,10 +141,6 @@ public class ClipboardListener implements return true; return true; } } private static boolean isEmulator() { return SystemProperties.getBoolean("ro.boot.qemu", false); } private boolean isUserSetupComplete() { private boolean isUserSetupComplete() { return Settings.Secure.getInt(mContext.getContentResolver(), return Settings.Secure.getInt(mContext.getContentResolver(), SETTINGS_SECURE_USER_SETUP_COMPLETE, 0) == 1; SETTINGS_SECURE_USER_SETUP_COMPLETE, 0) == 1; Loading packages/SystemUI/src/com/android/systemui/usb/UsbDebuggingActivity.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -25,6 +25,7 @@ import android.content.Intent; import android.content.IntentFilter; import android.content.IntentFilter; import android.debug.IAdbManager; import android.debug.IAdbManager; import android.hardware.usb.UsbManager; import android.hardware.usb.UsbManager; import android.os.Build; import android.os.Bundle; import android.os.Bundle; import android.os.IBinder; import android.os.IBinder; import android.os.ServiceManager; import android.os.ServiceManager; Loading Loading @@ -69,8 +70,7 @@ public class UsbDebuggingActivity extends AlertActivity super.onCreate(icicle); super.onCreate(icicle); // Emulator does not support reseating the usb cable to reshow the dialog. // Emulator does not support reseating the usb cable to reshow the dialog. boolean isEmulator = SystemProperties.get("ro.boot.qemu").equals("1"); if (SystemProperties.getInt("service.adb.tcp.port", 0) == 0 && !Build.IS_EMULATOR) { if (SystemProperties.getInt("service.adb.tcp.port", 0) == 0 && !isEmulator) { mDisconnectedReceiver = new UsbDisconnectedReceiver(this); mDisconnectedReceiver = new UsbDisconnectedReceiver(this); IntentFilter filter = new IntentFilter(UsbManager.ACTION_USB_STATE); IntentFilter filter = new IntentFilter(UsbManager.ACTION_USB_STATE); mBroadcastDispatcher.registerReceiver(mDisconnectedReceiver, filter); mBroadcastDispatcher.registerReceiver(mDisconnectedReceiver, filter); Loading services/core/java/com/android/server/clipboard/ClipboardService.java +2 −4 Original line number Original line Diff line number Diff line Loading @@ -54,6 +54,7 @@ import android.graphics.drawable.Drawable; import android.hardware.display.DisplayManager; import android.hardware.display.DisplayManager; import android.net.Uri; import android.net.Uri; import android.os.Binder; import android.os.Binder; import android.os.Build; import android.os.Bundle; import android.os.Bundle; import android.os.Handler; import android.os.Handler; import android.os.HandlerThread; import android.os.HandlerThread; Loading @@ -65,7 +66,6 @@ import android.os.Parcel; import android.os.RemoteCallbackList; import android.os.RemoteCallbackList; import android.os.RemoteException; import android.os.RemoteException; import android.os.ServiceManager; import android.os.ServiceManager; import android.os.SystemProperties; import android.os.UserHandle; import android.os.UserHandle; import android.os.UserManager; import android.os.UserManager; import android.provider.DeviceConfig; import android.provider.DeviceConfig; Loading Loading @@ -114,8 +114,6 @@ import java.util.function.Consumer; public class ClipboardService extends SystemService { public class ClipboardService extends SystemService { private static final String TAG = "ClipboardService"; private static final String TAG = "ClipboardService"; private static final boolean IS_EMULATOR = SystemProperties.getBoolean("ro.boot.qemu", false); @VisibleForTesting @VisibleForTesting public static final long DEFAULT_CLIPBOARD_TIMEOUT_MILLIS = 3600000; public static final long DEFAULT_CLIPBOARD_TIMEOUT_MILLIS = 3600000; Loading Loading @@ -190,7 +188,7 @@ public class ClipboardService extends SystemService { mAutofillInternal = LocalServices.getService(AutofillManagerInternal.class); mAutofillInternal = LocalServices.getService(AutofillManagerInternal.class); final IBinder permOwner = mUgmInternal.newUriPermissionOwner("clipboard"); final IBinder permOwner = mUgmInternal.newUriPermissionOwner("clipboard"); mPermissionOwner = permOwner; mPermissionOwner = permOwner; if (IS_EMULATOR) { if (Build.IS_EMULATOR) { mEmulatorClipboardMonitor = new EmulatorClipboardMonitor((clip) -> { mEmulatorClipboardMonitor = new EmulatorClipboardMonitor((clip) -> { synchronized (mLock) { synchronized (mLock) { setPrimaryClipInternalLocked(getClipboardLocked(0, DEVICE_ID_DEFAULT), clip, setPrimaryClipInternalLocked(getClipboardLocked(0, DEVICE_ID_DEFAULT), clip, Loading services/java/com/android/server/SystemServer.java +1 −3 Original line number Original line Diff line number Diff line Loading @@ -1451,8 +1451,6 @@ public final class SystemServer implements Dumpable { boolean disableCameraService = SystemProperties.getBoolean("config.disable_cameraservice", boolean disableCameraService = SystemProperties.getBoolean("config.disable_cameraservice", false); false); boolean isEmulator = SystemProperties.get("ro.boot.qemu").equals("1"); boolean isWatch = context.getPackageManager().hasSystemFeature( boolean isWatch = context.getPackageManager().hasSystemFeature( PackageManager.FEATURE_WATCH); PackageManager.FEATURE_WATCH); Loading Loading @@ -2261,7 +2259,7 @@ public final class SystemServer implements Dumpable { if (mPackageManager.hasSystemFeature(PackageManager.FEATURE_USB_HOST) if (mPackageManager.hasSystemFeature(PackageManager.FEATURE_USB_HOST) || mPackageManager.hasSystemFeature( || mPackageManager.hasSystemFeature( PackageManager.FEATURE_USB_ACCESSORY) PackageManager.FEATURE_USB_ACCESSORY) || isEmulator) { || Build.IS_EMULATOR) { // Manage USB host and device support // Manage USB host and device support t.traceBegin("StartUsbService"); t.traceBegin("StartUsbService"); mSystemServiceManager.startService(USB_SERVICE_CLASS); mSystemServiceManager.startService(USB_SERVICE_CLASS); Loading Loading
packages/SystemUI/src/com/android/systemui/clipboardoverlay/ClipboardListener.java +2 −6 Original line number Original line Diff line number Diff line Loading @@ -27,7 +27,7 @@ import static com.google.android.setupcompat.util.WizardManagerHelper.SETTINGS_S import android.content.ClipData; import android.content.ClipData; import android.content.ClipboardManager; import android.content.ClipboardManager; import android.content.Context; import android.content.Context; import android.os.SystemProperties; import android.os.Build; import android.provider.Settings; import android.provider.Settings; import android.util.Log; import android.util.Log; Loading Loading @@ -87,7 +87,7 @@ public class ClipboardListener implements String clipSource = mClipboardManager.getPrimaryClipSource(); String clipSource = mClipboardManager.getPrimaryClipSource(); ClipData clipData = mClipboardManager.getPrimaryClip(); ClipData clipData = mClipboardManager.getPrimaryClip(); if (shouldSuppressOverlay(clipData, clipSource, isEmulator())) { if (shouldSuppressOverlay(clipData, clipSource, Build.IS_EMULATOR)) { Log.i(TAG, "Clipboard overlay suppressed."); Log.i(TAG, "Clipboard overlay suppressed."); return; return; } } Loading Loading @@ -141,10 +141,6 @@ public class ClipboardListener implements return true; return true; } } private static boolean isEmulator() { return SystemProperties.getBoolean("ro.boot.qemu", false); } private boolean isUserSetupComplete() { private boolean isUserSetupComplete() { return Settings.Secure.getInt(mContext.getContentResolver(), return Settings.Secure.getInt(mContext.getContentResolver(), SETTINGS_SECURE_USER_SETUP_COMPLETE, 0) == 1; SETTINGS_SECURE_USER_SETUP_COMPLETE, 0) == 1; Loading
packages/SystemUI/src/com/android/systemui/usb/UsbDebuggingActivity.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -25,6 +25,7 @@ import android.content.Intent; import android.content.IntentFilter; import android.content.IntentFilter; import android.debug.IAdbManager; import android.debug.IAdbManager; import android.hardware.usb.UsbManager; import android.hardware.usb.UsbManager; import android.os.Build; import android.os.Bundle; import android.os.Bundle; import android.os.IBinder; import android.os.IBinder; import android.os.ServiceManager; import android.os.ServiceManager; Loading Loading @@ -69,8 +70,7 @@ public class UsbDebuggingActivity extends AlertActivity super.onCreate(icicle); super.onCreate(icicle); // Emulator does not support reseating the usb cable to reshow the dialog. // Emulator does not support reseating the usb cable to reshow the dialog. boolean isEmulator = SystemProperties.get("ro.boot.qemu").equals("1"); if (SystemProperties.getInt("service.adb.tcp.port", 0) == 0 && !Build.IS_EMULATOR) { if (SystemProperties.getInt("service.adb.tcp.port", 0) == 0 && !isEmulator) { mDisconnectedReceiver = new UsbDisconnectedReceiver(this); mDisconnectedReceiver = new UsbDisconnectedReceiver(this); IntentFilter filter = new IntentFilter(UsbManager.ACTION_USB_STATE); IntentFilter filter = new IntentFilter(UsbManager.ACTION_USB_STATE); mBroadcastDispatcher.registerReceiver(mDisconnectedReceiver, filter); mBroadcastDispatcher.registerReceiver(mDisconnectedReceiver, filter); Loading
services/core/java/com/android/server/clipboard/ClipboardService.java +2 −4 Original line number Original line Diff line number Diff line Loading @@ -54,6 +54,7 @@ import android.graphics.drawable.Drawable; import android.hardware.display.DisplayManager; import android.hardware.display.DisplayManager; import android.net.Uri; import android.net.Uri; import android.os.Binder; import android.os.Binder; import android.os.Build; import android.os.Bundle; import android.os.Bundle; import android.os.Handler; import android.os.Handler; import android.os.HandlerThread; import android.os.HandlerThread; Loading @@ -65,7 +66,6 @@ import android.os.Parcel; import android.os.RemoteCallbackList; import android.os.RemoteCallbackList; import android.os.RemoteException; import android.os.RemoteException; import android.os.ServiceManager; import android.os.ServiceManager; import android.os.SystemProperties; import android.os.UserHandle; import android.os.UserHandle; import android.os.UserManager; import android.os.UserManager; import android.provider.DeviceConfig; import android.provider.DeviceConfig; Loading Loading @@ -114,8 +114,6 @@ import java.util.function.Consumer; public class ClipboardService extends SystemService { public class ClipboardService extends SystemService { private static final String TAG = "ClipboardService"; private static final String TAG = "ClipboardService"; private static final boolean IS_EMULATOR = SystemProperties.getBoolean("ro.boot.qemu", false); @VisibleForTesting @VisibleForTesting public static final long DEFAULT_CLIPBOARD_TIMEOUT_MILLIS = 3600000; public static final long DEFAULT_CLIPBOARD_TIMEOUT_MILLIS = 3600000; Loading Loading @@ -190,7 +188,7 @@ public class ClipboardService extends SystemService { mAutofillInternal = LocalServices.getService(AutofillManagerInternal.class); mAutofillInternal = LocalServices.getService(AutofillManagerInternal.class); final IBinder permOwner = mUgmInternal.newUriPermissionOwner("clipboard"); final IBinder permOwner = mUgmInternal.newUriPermissionOwner("clipboard"); mPermissionOwner = permOwner; mPermissionOwner = permOwner; if (IS_EMULATOR) { if (Build.IS_EMULATOR) { mEmulatorClipboardMonitor = new EmulatorClipboardMonitor((clip) -> { mEmulatorClipboardMonitor = new EmulatorClipboardMonitor((clip) -> { synchronized (mLock) { synchronized (mLock) { setPrimaryClipInternalLocked(getClipboardLocked(0, DEVICE_ID_DEFAULT), clip, setPrimaryClipInternalLocked(getClipboardLocked(0, DEVICE_ID_DEFAULT), clip, Loading
services/java/com/android/server/SystemServer.java +1 −3 Original line number Original line Diff line number Diff line Loading @@ -1451,8 +1451,6 @@ public final class SystemServer implements Dumpable { boolean disableCameraService = SystemProperties.getBoolean("config.disable_cameraservice", boolean disableCameraService = SystemProperties.getBoolean("config.disable_cameraservice", false); false); boolean isEmulator = SystemProperties.get("ro.boot.qemu").equals("1"); boolean isWatch = context.getPackageManager().hasSystemFeature( boolean isWatch = context.getPackageManager().hasSystemFeature( PackageManager.FEATURE_WATCH); PackageManager.FEATURE_WATCH); Loading Loading @@ -2261,7 +2259,7 @@ public final class SystemServer implements Dumpable { if (mPackageManager.hasSystemFeature(PackageManager.FEATURE_USB_HOST) if (mPackageManager.hasSystemFeature(PackageManager.FEATURE_USB_HOST) || mPackageManager.hasSystemFeature( || mPackageManager.hasSystemFeature( PackageManager.FEATURE_USB_ACCESSORY) PackageManager.FEATURE_USB_ACCESSORY) || isEmulator) { || Build.IS_EMULATOR) { // Manage USB host and device support // Manage USB host and device support t.traceBegin("StartUsbService"); t.traceBegin("StartUsbService"); mSystemServiceManager.startService(USB_SERVICE_CLASS); mSystemServiceManager.startService(USB_SERVICE_CLASS); Loading