Loading service/Android.bp +2 −0 Original line number Diff line number Diff line Loading @@ -44,6 +44,8 @@ java_defaults { "-Xep:ClassCanBeStatic:ERROR", "-Xep:EqualsIncompatibleType:ERROR", "-Xep:ReferenceEquality:ERROR", "-Xep:UnusedMethod:ERROR", "-Xep:UnusedVariable:ERROR", ], }, Loading service/src/com/android/server/bluetooth/BluetoothAirplaneModeListener.java +0 −4 Original line number Diff line number Diff line Loading @@ -66,7 +66,6 @@ class BluetoothAirplaneModeListener extends Handler { // keeps track of whether user enabling bt notification was shown public static final String APM_BT_ENABLED_NOTIFICATION = "apm_bt_enabled_notification"; private static final int MSG_AIRPLANE_MODE_CHANGED = 0; public static final int NOTIFICATION_NOT_SHOWN = 0; public static final int NOTIFICATION_SHOWN = 1; public static final int UNUSED = 0; Loading Loading @@ -356,9 +355,6 @@ class BluetoothAirplaneModeListener extends Handler { // waive WRITE_SECURE_SETTINGS permission check final long callingIdentity = Binder.clearCallingIdentity(); try { Context userContext = mContext.createContextAsUser( UserHandle.of(ActivityManager.getCurrentUser()), 0); return mAirplaneHelper.getSettingsSecureInt(name, NOTIFICATION_NOT_SHOWN) == NOTIFICATION_NOT_SHOWN; } finally { Loading service/src/com/android/server/bluetooth/BluetoothManagerService.java +1 −15 Original line number Diff line number Diff line Loading @@ -108,13 +108,9 @@ import java.util.concurrent.locks.ReentrantReadWriteLock; class BluetoothManagerService { private static final String TAG = BluetoothManagerService.class.getSimpleName(); private static final String BLUETOOTH_PRIVILEGED = android.Manifest.permission.BLUETOOTH_PRIVILEGED; private static final int ACTIVE_LOG_MAX_SIZE = 20; private static final int CRASH_LOG_MAX_SIZE = 100; private static final int DEFAULT_REBIND_COUNT = 3; // Maximum msec to wait for a bind private static final int TIMEOUT_BIND_MS = 3000 * SystemProperties.getInt("ro.hw_timeout_multiplier", 1); Loading Loading @@ -177,9 +173,6 @@ class BluetoothManagerService { // and Airplane mode will have higher priority. @VisibleForTesting static final int BLUETOOTH_ON_AIRPLANE = 2; private static final int FLAGS_SYSTEM_APP = ApplicationInfo.FLAG_SYSTEM | ApplicationInfo.FLAG_UPDATED_SYSTEM_APP; // APM enhancement feature is enabled by default // Set this value to 0 to disable the feature private static final int DEFAULT_APM_ENHANCEMENT_STATE = 1; Loading @@ -189,11 +182,6 @@ class BluetoothManagerService { private final UserManager mUserManager; // -3 match with Userhandle.USER_CURRENT_OR_SELF private static final UserHandle USER_HANDLE_CURRENT_OR_SELF = UserHandle.of(-3); // -10000 match with Userhandle.USER_NULL private static final UserHandle USER_HANDLE_NULL = UserHandle.of(-10000); // Locks are not provided for mName and mAddress. // They are accessed in handler or broadcast receiver, same thread context. private String mAddress = null; Loading Loading @@ -299,8 +287,6 @@ class BluetoothManagerService { private final boolean mIsHearingAidProfileSupported; private volatile boolean mUnbindingAll = false; private final IBluetoothCallback mBluetoothCallback = new IBluetoothCallback.Stub() { @Override Loading Loading @@ -2023,7 +2009,7 @@ class BluetoothManagerService { android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED }) private void restartForNewUser(UserHandle newUser) { private void restartForNewUser(UserHandle unusedNewUser) { mAdapterLock.readLock().lock(); try { if (mAdapter != null) { Loading service/src/com/android/server/bluetooth/BluetoothServiceBinder.java +3 −3 Original line number Diff line number Diff line Loading @@ -56,12 +56,12 @@ class BluetoothServiceBinder extends IBluetoothManager.Stub { private final AppOpsManager mAppOpsManager; private final PermissionManager mPermissionManager; private final BtPermissionUtils mPermissionUtils; private final Looper mLooper; private final Looper unusedmLooper; BluetoothServiceBinder( BluetoothManagerService bms, Looper looper, Context ctx, UserManager userManager) { mBluetoothManagerService = bms; mLooper = looper; unusedmLooper = looper; mContext = ctx; mUserManager = userManager; mAppOpsManager = Loading Loading @@ -312,7 +312,7 @@ class BluetoothServiceBinder extends IBluetoothManager.Stub { @NonNull ParcelFileDescriptor out, @NonNull ParcelFileDescriptor err, @NonNull String[] args) { return new BluetoothShellCommand(mBluetoothManagerService, mContext) return new BluetoothShellCommand(mBluetoothManagerService) .exec( this, in.getFileDescriptor(), Loading service/src/com/android/server/bluetooth/BluetoothShellCommand.java +1 −4 Original line number Diff line number Diff line Loading @@ -20,7 +20,6 @@ import static java.util.Objects.requireNonNull; import android.bluetooth.BluetoothAdapter; import android.content.AttributionSource; import android.content.Context; import android.os.Binder; import android.os.Process; import android.os.RemoteException; Loading @@ -34,7 +33,6 @@ class BluetoothShellCommand extends BasicShellCommandHandler { private static final String TAG = BluetoothShellCommand.class.getSimpleName(); private final BluetoothManagerService mManagerService; private final Context mContext; @VisibleForTesting final BluetoothCommand[] mBluetoothCommands = { Loading Loading @@ -154,9 +152,8 @@ class BluetoothShellCommand extends BasicShellCommandHandler { } } BluetoothShellCommand(BluetoothManagerService managerService, Context context) { BluetoothShellCommand(BluetoothManagerService managerService) { mManagerService = managerService; mContext = context; } @Override Loading Loading
service/Android.bp +2 −0 Original line number Diff line number Diff line Loading @@ -44,6 +44,8 @@ java_defaults { "-Xep:ClassCanBeStatic:ERROR", "-Xep:EqualsIncompatibleType:ERROR", "-Xep:ReferenceEquality:ERROR", "-Xep:UnusedMethod:ERROR", "-Xep:UnusedVariable:ERROR", ], }, Loading
service/src/com/android/server/bluetooth/BluetoothAirplaneModeListener.java +0 −4 Original line number Diff line number Diff line Loading @@ -66,7 +66,6 @@ class BluetoothAirplaneModeListener extends Handler { // keeps track of whether user enabling bt notification was shown public static final String APM_BT_ENABLED_NOTIFICATION = "apm_bt_enabled_notification"; private static final int MSG_AIRPLANE_MODE_CHANGED = 0; public static final int NOTIFICATION_NOT_SHOWN = 0; public static final int NOTIFICATION_SHOWN = 1; public static final int UNUSED = 0; Loading Loading @@ -356,9 +355,6 @@ class BluetoothAirplaneModeListener extends Handler { // waive WRITE_SECURE_SETTINGS permission check final long callingIdentity = Binder.clearCallingIdentity(); try { Context userContext = mContext.createContextAsUser( UserHandle.of(ActivityManager.getCurrentUser()), 0); return mAirplaneHelper.getSettingsSecureInt(name, NOTIFICATION_NOT_SHOWN) == NOTIFICATION_NOT_SHOWN; } finally { Loading
service/src/com/android/server/bluetooth/BluetoothManagerService.java +1 −15 Original line number Diff line number Diff line Loading @@ -108,13 +108,9 @@ import java.util.concurrent.locks.ReentrantReadWriteLock; class BluetoothManagerService { private static final String TAG = BluetoothManagerService.class.getSimpleName(); private static final String BLUETOOTH_PRIVILEGED = android.Manifest.permission.BLUETOOTH_PRIVILEGED; private static final int ACTIVE_LOG_MAX_SIZE = 20; private static final int CRASH_LOG_MAX_SIZE = 100; private static final int DEFAULT_REBIND_COUNT = 3; // Maximum msec to wait for a bind private static final int TIMEOUT_BIND_MS = 3000 * SystemProperties.getInt("ro.hw_timeout_multiplier", 1); Loading Loading @@ -177,9 +173,6 @@ class BluetoothManagerService { // and Airplane mode will have higher priority. @VisibleForTesting static final int BLUETOOTH_ON_AIRPLANE = 2; private static final int FLAGS_SYSTEM_APP = ApplicationInfo.FLAG_SYSTEM | ApplicationInfo.FLAG_UPDATED_SYSTEM_APP; // APM enhancement feature is enabled by default // Set this value to 0 to disable the feature private static final int DEFAULT_APM_ENHANCEMENT_STATE = 1; Loading @@ -189,11 +182,6 @@ class BluetoothManagerService { private final UserManager mUserManager; // -3 match with Userhandle.USER_CURRENT_OR_SELF private static final UserHandle USER_HANDLE_CURRENT_OR_SELF = UserHandle.of(-3); // -10000 match with Userhandle.USER_NULL private static final UserHandle USER_HANDLE_NULL = UserHandle.of(-10000); // Locks are not provided for mName and mAddress. // They are accessed in handler or broadcast receiver, same thread context. private String mAddress = null; Loading Loading @@ -299,8 +287,6 @@ class BluetoothManagerService { private final boolean mIsHearingAidProfileSupported; private volatile boolean mUnbindingAll = false; private final IBluetoothCallback mBluetoothCallback = new IBluetoothCallback.Stub() { @Override Loading Loading @@ -2023,7 +2009,7 @@ class BluetoothManagerService { android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED }) private void restartForNewUser(UserHandle newUser) { private void restartForNewUser(UserHandle unusedNewUser) { mAdapterLock.readLock().lock(); try { if (mAdapter != null) { Loading
service/src/com/android/server/bluetooth/BluetoothServiceBinder.java +3 −3 Original line number Diff line number Diff line Loading @@ -56,12 +56,12 @@ class BluetoothServiceBinder extends IBluetoothManager.Stub { private final AppOpsManager mAppOpsManager; private final PermissionManager mPermissionManager; private final BtPermissionUtils mPermissionUtils; private final Looper mLooper; private final Looper unusedmLooper; BluetoothServiceBinder( BluetoothManagerService bms, Looper looper, Context ctx, UserManager userManager) { mBluetoothManagerService = bms; mLooper = looper; unusedmLooper = looper; mContext = ctx; mUserManager = userManager; mAppOpsManager = Loading Loading @@ -312,7 +312,7 @@ class BluetoothServiceBinder extends IBluetoothManager.Stub { @NonNull ParcelFileDescriptor out, @NonNull ParcelFileDescriptor err, @NonNull String[] args) { return new BluetoothShellCommand(mBluetoothManagerService, mContext) return new BluetoothShellCommand(mBluetoothManagerService) .exec( this, in.getFileDescriptor(), Loading
service/src/com/android/server/bluetooth/BluetoothShellCommand.java +1 −4 Original line number Diff line number Diff line Loading @@ -20,7 +20,6 @@ import static java.util.Objects.requireNonNull; import android.bluetooth.BluetoothAdapter; import android.content.AttributionSource; import android.content.Context; import android.os.Binder; import android.os.Process; import android.os.RemoteException; Loading @@ -34,7 +33,6 @@ class BluetoothShellCommand extends BasicShellCommandHandler { private static final String TAG = BluetoothShellCommand.class.getSimpleName(); private final BluetoothManagerService mManagerService; private final Context mContext; @VisibleForTesting final BluetoothCommand[] mBluetoothCommands = { Loading Loading @@ -154,9 +152,8 @@ class BluetoothShellCommand extends BasicShellCommandHandler { } } BluetoothShellCommand(BluetoothManagerService managerService, Context context) { BluetoothShellCommand(BluetoothManagerService managerService) { mManagerService = managerService; mContext = context; } @Override Loading