diff options
4 files changed, 17 insertions, 15 deletions
diff --git a/services/core/java/com/android/server/BluetoothManagerService.java b/services/core/java/com/android/server/BluetoothManagerService.java index ebaebae63067..2297d4b7c617 100644 --- a/services/core/java/com/android/server/BluetoothManagerService.java +++ b/services/core/java/com/android/server/BluetoothManagerService.java @@ -873,7 +873,8 @@ class BluetoothManagerService extends IBluetoothManager.Stub { } /** - * Call IBluetooth.onLeServiceUp() to continue if Bluetooth should be on. + * Call IBluetooth.onLeServiceUp() to continue if Bluetooth should be on, + * call IBluetooth.onBrEdrDown() to disable if Bluetooth should be off. */ private void continueFromBleOnState() { if (DBG) { @@ -885,11 +886,10 @@ class BluetoothManagerService extends IBluetoothManager.Stub { Slog.e(TAG, "onBluetoothServiceUp: mBluetooth is null!"); return; } - if (!mEnableExternal && !isBleAppPresent() && isAirplaneModeOn()) { - // Airplane mode is turned on while enabling BLE only mode, disable - // BLE now. - disableBleScanMode(); - sendBrEdrDownCallback(); + if (!mEnableExternal && !isBleAppPresent()) { + Slog.i(TAG, "Bluetooth was disabled while enabling BLE, disable BLE now"); + mEnable = false; + mBluetooth.onBrEdrDown(); return; } if (isBluetoothPersistedStateOnBluetooth() || !isBleAppPresent()) { diff --git a/services/core/java/com/android/server/appop/AppOpsService.java b/services/core/java/com/android/server/appop/AppOpsService.java index 06f11a8efea6..ab2f2bc0f400 100644 --- a/services/core/java/com/android/server/appop/AppOpsService.java +++ b/services/core/java/com/android/server/appop/AppOpsService.java @@ -3948,8 +3948,9 @@ public class AppOpsService extends IAppOpsService.Stub { if (mNotedWatchers.size() > 0 && dumpMode < 0) { needSep = true; boolean printedHeader = false; - for (int i = 0; i < mNotedWatchers.size(); i++) { - final SparseArray<NotedCallback> notedWatchers = mNotedWatchers.valueAt(i); + for (int watcherNum = 0; watcherNum < mNotedWatchers.size(); watcherNum++) { + final SparseArray<NotedCallback> notedWatchers = + mNotedWatchers.valueAt(watcherNum); if (notedWatchers.size() <= 0) { continue; } @@ -3967,16 +3968,16 @@ public class AppOpsService extends IAppOpsService.Stub { } pw.print(" "); pw.print(Integer.toHexString(System.identityHashCode( - mNotedWatchers.keyAt(i)))); + mNotedWatchers.keyAt(watcherNum)))); pw.println(" ->"); pw.print(" ["); final int opCount = notedWatchers.size(); - for (i = 0; i < opCount; i++) { - if (i > 0) { + for (int opNum = 0; opNum < opCount; opNum++) { + if (opNum > 0) { pw.print(' '); } - pw.print(AppOpsManager.opToName(notedWatchers.keyAt(i))); - if (i < opCount - 1) { + pw.print(AppOpsManager.opToName(notedWatchers.keyAt(opNum))); + if (opNum < opCount - 1) { pw.print(','); } } diff --git a/test-base/api/current.txt b/test-base/api/current.txt index 750fb5988327..823e24db1782 100644 --- a/test-base/api/current.txt +++ b/test-base/api/current.txt @@ -7,8 +7,10 @@ package android.test { method @Deprecated public void assertReadingContentUriRequiresPermission(android.net.Uri, String); method @Deprecated public void assertWritingContentUriRequiresPermission(android.net.Uri, String); method @Deprecated public android.content.Context getContext(); + method @Deprecated public android.content.Context getTestContext(); method @Deprecated protected void scrubClass(Class<?>) throws java.lang.IllegalAccessException; method @Deprecated public void setContext(android.content.Context); + method @Deprecated public void setTestContext(android.content.Context); method @Deprecated @android.test.suitebuilder.annotation.Suppress public void testAndroidTestCaseSetupProperly(); field @Deprecated protected android.content.Context mContext; } diff --git a/test-base/src/android/test/AndroidTestCase.java b/test-base/src/android/test/AndroidTestCase.java index 1e6bd9c14fd9..d3e896be0832 100644 --- a/test-base/src/android/test/AndroidTestCase.java +++ b/test-base/src/android/test/AndroidTestCase.java @@ -71,14 +71,13 @@ public class AndroidTestCase extends TestCase { * latter is provided by the context set with the {@link #setContext} * method. * - * @hide */ public void setTestContext(Context context) { mTestContext = context; } /** - * @hide + * Returns the test context that was set via {@link #setTestContext(Context)}. */ public Context getTestContext() { return mTestContext; |