Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d200bbfb authored by Ivan Podogov's avatar Ivan Podogov
Browse files

Finish resolving conflict from 715cbb43

Test: Treehugger
Change-Id: If7fa9f7e300f3d810e41447369ccbbfbc3963b94
parent 875b7834
Loading
Loading
Loading
Loading
+28 −4
Original line number Original line Diff line number Diff line
@@ -23,6 +23,7 @@ import android.annotation.RequiresPermission;
import android.annotation.SdkConstant;
import android.annotation.SdkConstant;
import android.annotation.SdkConstant.SdkConstantType;
import android.annotation.SdkConstant.SdkConstantType;
import android.annotation.SystemApi;
import android.annotation.SystemApi;
import android.app.ActivityThread;
import android.bluetooth.le.BluetoothLeAdvertiser;
import android.bluetooth.le.BluetoothLeAdvertiser;
import android.bluetooth.le.BluetoothLeScanner;
import android.bluetooth.le.BluetoothLeScanner;
import android.bluetooth.le.ScanCallback;
import android.bluetooth.le.ScanCallback;
@@ -254,6 +255,29 @@ public final class BluetoothAdapter {
    public static final String ACTION_REQUEST_ENABLE =
    public static final String ACTION_REQUEST_ENABLE =
            "android.bluetooth.adapter.action.REQUEST_ENABLE";
            "android.bluetooth.adapter.action.REQUEST_ENABLE";


    /**
     * Activity Action: Show a system activity that allows the user to turn off
     * Bluetooth. This is used only if permission review is enabled which is for
     * apps targeting API less than 23 require a permission review before any of
     * the app's components can run.
     * <p>This system activity will return once Bluetooth has completed turning
     * off, or the user has decided not to turn Bluetooth off.
     * <p>Notification of the result of this activity is posted using the
     * {@link android.app.Activity#onActivityResult} callback. The
     * <code>resultCode</code>
     * will be {@link android.app.Activity#RESULT_OK} if Bluetooth has been
     * turned off or {@link android.app.Activity#RESULT_CANCELED} if the user
     * has rejected the request or an error has occurred.
     * <p>Applications can also listen for {@link #ACTION_STATE_CHANGED}
     * for global notification whenever Bluetooth is turned on or off.
     * <p>Requires {@link android.Manifest.permission#BLUETOOTH}
     *
     * @hide
     */
    @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
    public static final String ACTION_REQUEST_DISABLE =
            "android.bluetooth.adapter.action.REQUEST_DISABLE";

    /**
    /**
     * Activity Action: Show a system activity that allows user to enable BLE scans even when
     * Activity Action: Show a system activity that allows user to enable BLE scans even when
     * Bluetooth is turned off.<p>
     * Bluetooth is turned off.<p>
@@ -768,7 +792,7 @@ public final class BluetoothAdapter {
                return true;
                return true;
            }
            }
            if (DBG) Log.d(TAG, "enableBLE(): Calling enable");
            if (DBG) Log.d(TAG, "enableBLE(): Calling enable");
            return mManagerService.enable();
            return mManagerService.enable(ActivityThread.currentPackageName());
        } catch (RemoteException e) {
        } catch (RemoteException e) {
            Log.e(TAG, "", e);
            Log.e(TAG, "", e);
        }
        }
@@ -895,7 +919,7 @@ public final class BluetoothAdapter {
            return true;
            return true;
        }
        }
        try {
        try {
            return mManagerService.enable();
            return mManagerService.enable(ActivityThread.currentPackageName());
        } catch (RemoteException e) {Log.e(TAG, "", e);}
        } catch (RemoteException e) {Log.e(TAG, "", e);}
        return false;
        return false;
    }
    }
@@ -927,7 +951,7 @@ public final class BluetoothAdapter {
    @RequiresPermission(Manifest.permission.BLUETOOTH_ADMIN)
    @RequiresPermission(Manifest.permission.BLUETOOTH_ADMIN)
    public boolean disable() {
    public boolean disable() {
        try {
        try {
            return mManagerService.disable(true);
            return mManagerService.disable(ActivityThread.currentPackageName(), true);
        } catch (RemoteException e) {Log.e(TAG, "", e);}
        } catch (RemoteException e) {Log.e(TAG, "", e);}
        return false;
        return false;
    }
    }
@@ -945,7 +969,7 @@ public final class BluetoothAdapter {
    public boolean disable(boolean persist) {
    public boolean disable(boolean persist) {


        try {
        try {
            return mManagerService.disable(persist);
            return mManagerService.disable(ActivityThread.currentPackageName(), persist);
        } catch (RemoteException e) {Log.e(TAG, "", e);}
        } catch (RemoteException e) {Log.e(TAG, "", e);}
        return false;
        return false;
    }
    }
+2 −2
Original line number Original line Diff line number Diff line
@@ -34,9 +34,9 @@ interface IBluetoothManager
    void registerStateChangeCallback(in IBluetoothStateChangeCallback callback);
    void registerStateChangeCallback(in IBluetoothStateChangeCallback callback);
    void unregisterStateChangeCallback(in IBluetoothStateChangeCallback callback);
    void unregisterStateChangeCallback(in IBluetoothStateChangeCallback callback);
    boolean isEnabled();
    boolean isEnabled();
    boolean enable();
    boolean enable(String packageName);
    boolean enableNoAutoConnect();
    boolean enableNoAutoConnect();
    boolean disable(boolean persist);
    boolean disable(String packageName, boolean persist);
    int getState();
    int getState();
    IBluetoothGatt getBluetoothGatt();
    IBluetoothGatt getBluetoothGatt();