Loading core/java/android/app/ContextImpl.java +24 −0 Original line number Diff line number Diff line Loading @@ -1444,6 +1444,14 @@ class ContextImpl extends Context { @Override public ComponentName startServiceAsUser(Intent service, UserHandle user) { try { if (service.getComponent() == null && service.getPackage() == null) { if (getApplicationInfo().targetSdkVersion >= Build.VERSION_CODES.KEY_LIME_PIE) { IllegalArgumentException ex = new IllegalArgumentException( "Service Intent must be explicit: " + service); Log.wtf(TAG, "This will become an error", ex); //throw ex; } } service.prepareToLeaveProcess(); ComponentName cn = ActivityManagerNative.getDefault().startService( mMainThread.getApplicationThread(), service, Loading @@ -1468,6 +1476,14 @@ class ContextImpl extends Context { @Override public boolean stopServiceAsUser(Intent service, UserHandle user) { try { if (service.getComponent() == null && service.getPackage() == null) { if (getApplicationInfo().targetSdkVersion >= Build.VERSION_CODES.KEY_LIME_PIE) { IllegalArgumentException ex = new IllegalArgumentException( "Service Intent must be explicit: " + service); Log.wtf(TAG, "This will become an error", ex); //throw ex; } } service.prepareToLeaveProcess(); int res = ActivityManagerNative.getDefault().stopService( mMainThread.getApplicationThread(), service, Loading Loading @@ -1503,6 +1519,14 @@ class ContextImpl extends Context { } else { throw new RuntimeException("Not supported in system context"); } if (service.getComponent() == null && service.getPackage() == null) { if (getApplicationInfo().targetSdkVersion >= Build.VERSION_CODES.KEY_LIME_PIE) { IllegalArgumentException ex = new IllegalArgumentException( "Service Intent must be explicit: " + service); Log.wtf(TAG, "This will become an error", ex); //throw ex; } } try { IBinder token = getActivityToken(); if (token == null && (flags&BIND_AUTO_CREATE) == 0 && mPackageInfo != null Loading core/java/android/bluetooth/BluetoothA2dp.java +12 −5 Original line number Diff line number Diff line Loading @@ -128,9 +128,7 @@ public final class BluetoothA2dp implements BluetoothProfile { try { if (mService == null) { if (VDBG) Log.d(TAG,"Binding service..."); if (!mContext.bindService(new Intent(IBluetoothA2dp.class.getName()), mConnection, 0)) { Log.e(TAG, "Could not bind to Bluetooth A2DP Service"); } doBind(); } } catch (Exception re) { Log.e(TAG,"",re); Loading @@ -157,9 +155,18 @@ public final class BluetoothA2dp implements BluetoothProfile { } } if (!context.bindService(new Intent(IBluetoothA2dp.class.getName()), mConnection, 0)) { Log.e(TAG, "Could not bind to Bluetooth A2DP Service"); doBind(); } boolean doBind() { Intent intent = new Intent(IBluetoothA2dp.class.getName()); ComponentName comp = intent.resolveSystemService(mContext.getPackageManager(), 0); intent.setComponent(comp); if (comp == null || !mContext.bindService(intent, mConnection, 0)) { Log.e(TAG, "Could not bind to Bluetooth A2DP Service with " + intent); return false; } return true; } /*package*/ void close() { Loading core/java/android/bluetooth/BluetoothHeadset.java +12 −5 Original line number Diff line number Diff line Loading @@ -241,9 +241,7 @@ public final class BluetoothHeadset implements BluetoothProfile { try { if (mService == null) { if (VDBG) Log.d(TAG,"Binding service..."); if (!mContext.bindService(new Intent(IBluetoothHeadset.class.getName()), mConnection, 0)) { Log.e(TAG, "Could not bind to Bluetooth Headset Service"); } doBind(); } } catch (Exception re) { Log.e(TAG,"",re); Loading @@ -270,9 +268,18 @@ public final class BluetoothHeadset implements BluetoothProfile { } } if (!context.bindService(new Intent(IBluetoothHeadset.class.getName()), mConnection, 0)) { Log.e(TAG, "Could not bind to Bluetooth Headset Service"); doBind(); } boolean doBind() { Intent intent = new Intent(IBluetoothHeadset.class.getName()); ComponentName comp = intent.resolveSystemService(mContext.getPackageManager(), 0); intent.setComponent(comp); if (comp == null || !mContext.bindService(intent, mConnection, 0)) { Log.e(TAG, "Could not bind to Bluetooth Headset Service with " + intent); return false; } return true; } /** Loading core/java/android/bluetooth/BluetoothHealth.java +12 −5 Original line number Diff line number Diff line Loading @@ -117,9 +117,7 @@ public final class BluetoothHealth implements BluetoothProfile { try { if (mService == null) { if (VDBG) Log.d(TAG,"Binding service..."); if (!mContext.bindService(new Intent(IBluetoothHealth.class.getName()), mConnection, 0)) { Log.e(TAG, "Could not bind to Bluetooth Health Service"); } doBind(); } } catch (Exception re) { Log.e(TAG,"",re); Loading Loading @@ -483,9 +481,18 @@ public final class BluetoothHealth implements BluetoothProfile { } } if (!context.bindService(new Intent(IBluetoothHealth.class.getName()), mConnection, 0)) { Log.e(TAG, "Could not bind to Bluetooth Health Service"); doBind(); } boolean doBind() { Intent intent = new Intent(IBluetoothHealth.class.getName()); ComponentName comp = intent.resolveSystemService(mContext.getPackageManager(), 0); intent.setComponent(comp); if (comp == null || !mContext.bindService(intent, mConnection, 0)) { Log.e(TAG, "Could not bind to Bluetooth Health Service with " + intent); return false; } return true; } /*package*/ void close() { Loading core/java/android/bluetooth/BluetoothInputDevice.java +12 −6 Original line number Diff line number Diff line Loading @@ -206,9 +206,7 @@ public final class BluetoothInputDevice implements BluetoothProfile { try { if (mService == null) { if (VDBG) Log.d(TAG,"Binding service..."); if (!mContext.bindService(new Intent(IBluetoothInputDevice.class.getName()), mConnection, 0)) { Log.e(TAG, "Could not bind to Bluetooth HID Service"); } doBind(); } } catch (Exception re) { Log.e(TAG,"",re); Loading Loading @@ -237,10 +235,18 @@ public final class BluetoothInputDevice implements BluetoothProfile { } } if (!context.bindService(new Intent(IBluetoothInputDevice.class.getName()), mConnection, 0)) { Log.e(TAG, "Could not bind to Bluetooth HID Service"); doBind(); } boolean doBind() { Intent intent = new Intent(IBluetoothInputDevice.class.getName()); ComponentName comp = intent.resolveSystemService(mContext.getPackageManager(), 0); intent.setComponent(comp); if (comp == null || !mContext.bindService(intent, mConnection, 0)) { Log.e(TAG, "Could not bind to Bluetooth HID Service with " + intent); return false; } return true; } /*package*/ void close() { Loading Loading
core/java/android/app/ContextImpl.java +24 −0 Original line number Diff line number Diff line Loading @@ -1444,6 +1444,14 @@ class ContextImpl extends Context { @Override public ComponentName startServiceAsUser(Intent service, UserHandle user) { try { if (service.getComponent() == null && service.getPackage() == null) { if (getApplicationInfo().targetSdkVersion >= Build.VERSION_CODES.KEY_LIME_PIE) { IllegalArgumentException ex = new IllegalArgumentException( "Service Intent must be explicit: " + service); Log.wtf(TAG, "This will become an error", ex); //throw ex; } } service.prepareToLeaveProcess(); ComponentName cn = ActivityManagerNative.getDefault().startService( mMainThread.getApplicationThread(), service, Loading @@ -1468,6 +1476,14 @@ class ContextImpl extends Context { @Override public boolean stopServiceAsUser(Intent service, UserHandle user) { try { if (service.getComponent() == null && service.getPackage() == null) { if (getApplicationInfo().targetSdkVersion >= Build.VERSION_CODES.KEY_LIME_PIE) { IllegalArgumentException ex = new IllegalArgumentException( "Service Intent must be explicit: " + service); Log.wtf(TAG, "This will become an error", ex); //throw ex; } } service.prepareToLeaveProcess(); int res = ActivityManagerNative.getDefault().stopService( mMainThread.getApplicationThread(), service, Loading Loading @@ -1503,6 +1519,14 @@ class ContextImpl extends Context { } else { throw new RuntimeException("Not supported in system context"); } if (service.getComponent() == null && service.getPackage() == null) { if (getApplicationInfo().targetSdkVersion >= Build.VERSION_CODES.KEY_LIME_PIE) { IllegalArgumentException ex = new IllegalArgumentException( "Service Intent must be explicit: " + service); Log.wtf(TAG, "This will become an error", ex); //throw ex; } } try { IBinder token = getActivityToken(); if (token == null && (flags&BIND_AUTO_CREATE) == 0 && mPackageInfo != null Loading
core/java/android/bluetooth/BluetoothA2dp.java +12 −5 Original line number Diff line number Diff line Loading @@ -128,9 +128,7 @@ public final class BluetoothA2dp implements BluetoothProfile { try { if (mService == null) { if (VDBG) Log.d(TAG,"Binding service..."); if (!mContext.bindService(new Intent(IBluetoothA2dp.class.getName()), mConnection, 0)) { Log.e(TAG, "Could not bind to Bluetooth A2DP Service"); } doBind(); } } catch (Exception re) { Log.e(TAG,"",re); Loading @@ -157,9 +155,18 @@ public final class BluetoothA2dp implements BluetoothProfile { } } if (!context.bindService(new Intent(IBluetoothA2dp.class.getName()), mConnection, 0)) { Log.e(TAG, "Could not bind to Bluetooth A2DP Service"); doBind(); } boolean doBind() { Intent intent = new Intent(IBluetoothA2dp.class.getName()); ComponentName comp = intent.resolveSystemService(mContext.getPackageManager(), 0); intent.setComponent(comp); if (comp == null || !mContext.bindService(intent, mConnection, 0)) { Log.e(TAG, "Could not bind to Bluetooth A2DP Service with " + intent); return false; } return true; } /*package*/ void close() { Loading
core/java/android/bluetooth/BluetoothHeadset.java +12 −5 Original line number Diff line number Diff line Loading @@ -241,9 +241,7 @@ public final class BluetoothHeadset implements BluetoothProfile { try { if (mService == null) { if (VDBG) Log.d(TAG,"Binding service..."); if (!mContext.bindService(new Intent(IBluetoothHeadset.class.getName()), mConnection, 0)) { Log.e(TAG, "Could not bind to Bluetooth Headset Service"); } doBind(); } } catch (Exception re) { Log.e(TAG,"",re); Loading @@ -270,9 +268,18 @@ public final class BluetoothHeadset implements BluetoothProfile { } } if (!context.bindService(new Intent(IBluetoothHeadset.class.getName()), mConnection, 0)) { Log.e(TAG, "Could not bind to Bluetooth Headset Service"); doBind(); } boolean doBind() { Intent intent = new Intent(IBluetoothHeadset.class.getName()); ComponentName comp = intent.resolveSystemService(mContext.getPackageManager(), 0); intent.setComponent(comp); if (comp == null || !mContext.bindService(intent, mConnection, 0)) { Log.e(TAG, "Could not bind to Bluetooth Headset Service with " + intent); return false; } return true; } /** Loading
core/java/android/bluetooth/BluetoothHealth.java +12 −5 Original line number Diff line number Diff line Loading @@ -117,9 +117,7 @@ public final class BluetoothHealth implements BluetoothProfile { try { if (mService == null) { if (VDBG) Log.d(TAG,"Binding service..."); if (!mContext.bindService(new Intent(IBluetoothHealth.class.getName()), mConnection, 0)) { Log.e(TAG, "Could not bind to Bluetooth Health Service"); } doBind(); } } catch (Exception re) { Log.e(TAG,"",re); Loading Loading @@ -483,9 +481,18 @@ public final class BluetoothHealth implements BluetoothProfile { } } if (!context.bindService(new Intent(IBluetoothHealth.class.getName()), mConnection, 0)) { Log.e(TAG, "Could not bind to Bluetooth Health Service"); doBind(); } boolean doBind() { Intent intent = new Intent(IBluetoothHealth.class.getName()); ComponentName comp = intent.resolveSystemService(mContext.getPackageManager(), 0); intent.setComponent(comp); if (comp == null || !mContext.bindService(intent, mConnection, 0)) { Log.e(TAG, "Could not bind to Bluetooth Health Service with " + intent); return false; } return true; } /*package*/ void close() { Loading
core/java/android/bluetooth/BluetoothInputDevice.java +12 −6 Original line number Diff line number Diff line Loading @@ -206,9 +206,7 @@ public final class BluetoothInputDevice implements BluetoothProfile { try { if (mService == null) { if (VDBG) Log.d(TAG,"Binding service..."); if (!mContext.bindService(new Intent(IBluetoothInputDevice.class.getName()), mConnection, 0)) { Log.e(TAG, "Could not bind to Bluetooth HID Service"); } doBind(); } } catch (Exception re) { Log.e(TAG,"",re); Loading Loading @@ -237,10 +235,18 @@ public final class BluetoothInputDevice implements BluetoothProfile { } } if (!context.bindService(new Intent(IBluetoothInputDevice.class.getName()), mConnection, 0)) { Log.e(TAG, "Could not bind to Bluetooth HID Service"); doBind(); } boolean doBind() { Intent intent = new Intent(IBluetoothInputDevice.class.getName()); ComponentName comp = intent.resolveSystemService(mContext.getPackageManager(), 0); intent.setComponent(comp); if (comp == null || !mContext.bindService(intent, mConnection, 0)) { Log.e(TAG, "Could not bind to Bluetooth HID Service with " + intent); return false; } return true; } /*package*/ void close() { Loading