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

Commit 16cce5c5 authored by Brint E. Kriebel's avatar Brint E. Kriebel
Browse files

Merge remote-tracking branch 'github/cm-11.0' into HEAD

parents b54b4844 086d3414
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -282,9 +282,12 @@ LOCAL_SRC_FILES += \
	media/java/android/media/IRingtonePlayer.aidl \
	telephony/java/com/android/internal/telephony/IPhoneStateListener.aidl \
	telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl \
	telephony/java/com/android/internal/telephony/msim/IPhoneSubInfoMSim.aidl \
	telephony/java/com/android/internal/telephony/ITelephony.aidl \
	telephony/java/com/android/internal/telephony/msim/ITelephonyMSim.aidl \
	telephony/java/com/android/internal/telephony/ISms.aidl \
	telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl \
	telephony/java/com/android/internal/telephony/ITelephonyRegistryMSim.aidl \
	telephony/java/com/android/internal/telephony/IWapPushManager.aidl \
	wifi/java/android/net/wifi/IWifiManager.aidl \
	wifi/java/android/net/wifi/p2p/IWifiP2pManager.aidl \
@@ -420,7 +423,9 @@ aidl_files := \
	frameworks/base/location/java/com/android/internal/location/ProviderRequest.aidl \
	frameworks/base/telephony/java/android/telephony/ServiceState.aidl \
	frameworks/base/telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl \
	frameworks/base/telephony/java/com/android/internal/telephony/msim/IPhoneSubInfoMSim.aidl \
	frameworks/base/telephony/java/com/android/internal/telephony/ITelephony.aidl \
    frameworks/base/telephony/java/com/android/internal/telephony/msim/ITelephonyMSim.aidl \
	frameworks/base/wifi/java/android/net/wifi/BatchedScanSettings.aidl \
	frameworks/base/wifi/java/android/net/wifi/BatchedScanResult.aidl \

+155 −51
Original line number Diff line number Diff line
/*
 * Copyright (c) 2013, The Linux Foundation. All rights reserved.
 * Not a Contribution.
 *
 * Copyright (C) 2012 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
@@ -18,6 +21,7 @@ package android.app;

import android.os.Binder;
import android.os.IBinder;
import android.os.SystemProperties;
import android.util.ArrayMap;
import com.android.internal.app.IAppOpsService;
import com.android.internal.app.IAppOpsCallback;
@@ -90,9 +94,15 @@ public class AppOpsManager {
     */
    public static final int MODE_ERRORED = 2;

    /** @hide This mode should never be returned to caller
     * Result from {@link #checkOp} the given caller is
     * not allowed to perform the given operation.
     */
    public static final int MODE_ASK = 3;

    // when adding one of these:
    //  - increment _NUM_OP
    //  - add rows to sOpToSwitch, sOpToString, sOpNames, sOpPerms, sOpDefaultMode
    //  - add rows to sOpToSwitch, sOpToString, sOpNames, sOpPerms, sOpDefaultMode, sOpDefaultStrictMode
    //  - add descriptive strings to Settings/res/values/arrays.xml
    //  - add the op to the appropriate template in AppOpsState.OpsTemplate (settings app)

@@ -193,9 +203,15 @@ public class AppOpsManager {
    /** @hide */
    public static final int OP_ALARM_WAKEUP = 46;
    /** @hide */
    public static final int OP_BOOT_COMPLETED = 47;
    public static final int OP_SEND_MMS = 47;
    /** @hide */
    public static final int OP_READ_MMS = 48;
    /** @hide */
    public static final int _NUM_OP = 48;
    public static final int OP_WRITE_MMS = 49;
    /** @hide */
    public static final int OP_BOOT_COMPLETED = 50;
    /** @hide */
    public static final int _NUM_OP = 51;

    /** Access to coarse location information. */
    public static final String OPSTR_COARSE_LOCATION =
@@ -266,6 +282,9 @@ public class AppOpsManager {
            OP_BLUETOOTH_CHANGE,
            OP_DATA_CONNECT_CHANGE,
            OP_ALARM_WAKEUP,
            OP_SEND_MMS,
            OP_READ_MMS,
            OP_WRITE_MMS,
            OP_BOOT_COMPLETED,
    };

@@ -322,6 +341,9 @@ public class AppOpsManager {
            null,
            null,
            null,
            null,
            null,
            null,
    };

    /**
@@ -376,6 +398,9 @@ public class AppOpsManager {
            "BLUETOOTH_CHANGE",
            "DATA_CONNECT_CHANGE",
            "ALARM_WAKEUP",
            "SEND_MMS",
            "READ_MMS",
            "WRITE_MMS",
            "BOOT_COMPLETED",
    };

@@ -431,6 +456,9 @@ public class AppOpsManager {
            android.Manifest.permission.BLUETOOTH,
            android.Manifest.permission.CHANGE_NETWORK_STATE,
            null, // OP_ALARM_WAKEUP
            android.Manifest.permission.SEND_SMS,
            android.Manifest.permission.READ_SMS,
            android.Manifest.permission.WRITE_SMS,
            android.Manifest.permission.RECEIVE_BOOT_COMPLETED,
    };

@@ -438,56 +466,117 @@ public class AppOpsManager {
     * This specifies the default mode for each operation.
     */
    private static int[] sOpDefaultMode = new int[] {
            AppOpsManager.MODE_ALLOWED,
            AppOpsManager.MODE_ALLOWED,
            AppOpsManager.MODE_ALLOWED,
            AppOpsManager.MODE_ALLOWED,
            AppOpsManager.MODE_ALLOWED,
            AppOpsManager.MODE_ALLOWED,
            AppOpsManager.MODE_ALLOWED,
            AppOpsManager.MODE_ALLOWED,
            AppOpsManager.MODE_ALLOWED,
            AppOpsManager.MODE_ALLOWED,
            AppOpsManager.MODE_ALLOWED,
            AppOpsManager.MODE_ALLOWED,
            AppOpsManager.MODE_ALLOWED,
            AppOpsManager.MODE_ALLOWED,
            AppOpsManager.MODE_ALLOWED,
            AppOpsManager.MODE_ALLOWED, // OP_COARSE_LOCATION
            AppOpsManager.MODE_ALLOWED, // OP_FINE_LOCATION
            AppOpsManager.MODE_ALLOWED, // OP_GPS
            AppOpsManager.MODE_ALLOWED, // OP_VIBRATE
            AppOpsManager.MODE_ALLOWED, // OP_READ_CONTACTS
            AppOpsManager.MODE_ALLOWED, // OP_WRITE_CONTACTS
            AppOpsManager.MODE_ALLOWED, // OP_READ_CALL_LOG
            AppOpsManager.MODE_ALLOWED, // OP_WRITE_CALL_LOG
            AppOpsManager.MODE_ALLOWED, // OP_READ_CALENDAR
            AppOpsManager.MODE_ALLOWED, // OP_WRITE_CALENDAR
            AppOpsManager.MODE_ALLOWED, // OP_WIFI_SCAN
            AppOpsManager.MODE_ALLOWED, // OP_POST_NOTIFICATION
            AppOpsManager.MODE_ALLOWED, // OP_NEIGHBORING_CELLS
            AppOpsManager.MODE_ALLOWED, // OP_CALL_PHONE
            AppOpsManager.MODE_ALLOWED, // OP_READ_SMS
            AppOpsManager.MODE_IGNORED, // OP_WRITE_SMS
            AppOpsManager.MODE_ALLOWED,
            AppOpsManager.MODE_ALLOWED,
            AppOpsManager.MODE_ALLOWED,
            AppOpsManager.MODE_ALLOWED,
            AppOpsManager.MODE_ALLOWED,
            AppOpsManager.MODE_ALLOWED,
            AppOpsManager.MODE_ALLOWED,
            AppOpsManager.MODE_ALLOWED,
            AppOpsManager.MODE_ALLOWED,
            AppOpsManager.MODE_ALLOWED,
            AppOpsManager.MODE_ALLOWED,
            AppOpsManager.MODE_ALLOWED,
            AppOpsManager.MODE_ALLOWED,
            AppOpsManager.MODE_ALLOWED,
            AppOpsManager.MODE_ALLOWED,
            AppOpsManager.MODE_ALLOWED,
            AppOpsManager.MODE_ALLOWED,
            AppOpsManager.MODE_ALLOWED,
            AppOpsManager.MODE_ALLOWED,
            AppOpsManager.MODE_ALLOWED,
            AppOpsManager.MODE_ALLOWED,
            AppOpsManager.MODE_ALLOWED,
            AppOpsManager.MODE_ALLOWED,
            AppOpsManager.MODE_ALLOWED,
            AppOpsManager.MODE_ALLOWED,
            AppOpsManager.MODE_ALLOWED,
            AppOpsManager.MODE_ALLOWED,
            AppOpsManager.MODE_ALLOWED,
            AppOpsManager.MODE_ALLOWED,
            AppOpsManager.MODE_ALLOWED,
            AppOpsManager.MODE_ALLOWED,
            AppOpsManager.MODE_ALLOWED, // OP_RECEIVE_SMS
            AppOpsManager.MODE_ALLOWED, // OP_RECEIVE_EMERGECY_SMS
            AppOpsManager.MODE_ALLOWED, // OP_RECEIVE_MMS
            AppOpsManager.MODE_ALLOWED, // OP_RECEIVE_WAP_PUSH
            AppOpsManager.MODE_ALLOWED, // OP_SEND_SMS
            AppOpsManager.MODE_ALLOWED, // OP_READ_ICC_SMS
            AppOpsManager.MODE_ALLOWED, // OP_WRITE_ICC_SMS
            AppOpsManager.MODE_ALLOWED, // OP_WRITE_SETTINGS
            AppOpsManager.MODE_ALLOWED, // OP_SYSTEM_ALERT_WINDOW
            AppOpsManager.MODE_ALLOWED, // OP_ACCESS_NOTIFICATIONS
            AppOpsManager.MODE_ALLOWED, // OP_CAMERA
            AppOpsManager.MODE_ALLOWED, // OP_RECORD_AUDIO
            AppOpsManager.MODE_ALLOWED, // OP_PLAY_AUDIO
            AppOpsManager.MODE_ALLOWED, // OP_READ_CLIPBOARD
            AppOpsManager.MODE_ALLOWED, // OP_WRITE_CLIPBOARD
            AppOpsManager.MODE_ALLOWED, // OP_TAKE_MEDIA_BUTTONS
            AppOpsManager.MODE_ALLOWED, // OP_TAKE_AUDIO_FOCUS
            AppOpsManager.MODE_ALLOWED, // OP_AUDIO_MASTER_VOLUME
            AppOpsManager.MODE_ALLOWED, // OP_AUDIO_VOICE_VOLUME
            AppOpsManager.MODE_ALLOWED, // OP_AUDIO_RING_VOLUME
            AppOpsManager.MODE_ALLOWED, // OP_AUDIO_MEDIA_VOLUME
            AppOpsManager.MODE_ALLOWED, // OP_AUDIO_ALARM_VOLUME
            AppOpsManager.MODE_ALLOWED, // OP_AUDIO_NOTIFICATION_VOLUME
            AppOpsManager.MODE_ALLOWED, // OP_AUDIO_BLUETOOTH_VOLUME
            AppOpsManager.MODE_ALLOWED, // OP_WAKE_LOCK
            AppOpsManager.MODE_ALLOWED, // OP_MONITOR_LOCATION
            AppOpsManager.MODE_ALLOWED, // OP_MONITOR_HIGH_POWER_LOCATION
            AppOpsManager.MODE_ALLOWED, // OP_WIFI_CHANGE
            AppOpsManager.MODE_ALLOWED, // OP_BLUETOOTH_CHANGE
            AppOpsManager.MODE_ALLOWED, // OP_DATA_CHANGE
            AppOpsManager.MODE_ALLOWED, // OP_ALARM_WAKEUP
            AppOpsManager.MODE_ALLOWED, // OP_SEND_MMS
            AppOpsManager.MODE_ALLOWED, // OP_READ_MMS
            AppOpsManager.MODE_ALLOWED, // OP_WRITE_MMS
            AppOpsManager.MODE_ALLOWED, // OP_BOOT_COMPLETED
    };

    /**
     * This specifies the default mode for each strict operation.
     */
    private static int[] sOpDefaultStrictMode = new int[] {
            AppOpsManager.MODE_ASK,     // OP_COARSE_LOCATION
            AppOpsManager.MODE_ASK,     // OP_FINE_LOCATION
            AppOpsManager.MODE_ASK,     // OP_GPS
            AppOpsManager.MODE_ALLOWED, // OP_VIBRATE
            AppOpsManager.MODE_ASK,     // OP_READ_CONTACTS
            AppOpsManager.MODE_ASK,     // OP_WRITE_CONTACTS
            AppOpsManager.MODE_ASK,     // OP_READ_CALL_LOG
            AppOpsManager.MODE_ASK,     // OP_WRITE_CALL_LOG
            AppOpsManager.MODE_ALLOWED, // OP_READ_CALENDAR
            AppOpsManager.MODE_ALLOWED, // OP_WRITE_CALENDAR
            AppOpsManager.MODE_ASK,     // OP_WIFI_SCAN
            AppOpsManager.MODE_ALLOWED, // OP_POST_NOTIFICATION
            AppOpsManager.MODE_ALLOWED, // OP_NEIGHBORING_CELLS
            AppOpsManager.MODE_ASK,     // OP_CALL_PHONE
            AppOpsManager.MODE_ASK,     // OP_READ_SMS
            AppOpsManager.MODE_IGNORED, // OP_WRITE_SMS
            AppOpsManager.MODE_ASK,     // OP_RECEIVE_SMS
            AppOpsManager.MODE_ALLOWED, // OP_RECEIVE_EMERGECY_SMS
            AppOpsManager.MODE_ASK,     // OP_RECEIVE_MMS
            AppOpsManager.MODE_ALLOWED, // OP_RECEIVE_WAP_PUSH
            AppOpsManager.MODE_ASK,     // OP_SEND_SMS
            AppOpsManager.MODE_ALLOWED, // OP_READ_ICC_SMS
            AppOpsManager.MODE_ALLOWED, // OP_WRITE_ICC_SMS
            AppOpsManager.MODE_ALLOWED, // OP_WRITE_SETTINGS
            AppOpsManager.MODE_ALLOWED, // OP_SYSTEM_ALERT_WINDOW
            AppOpsManager.MODE_ALLOWED, // OP_ACCESS_NOTIFICATIONS
            AppOpsManager.MODE_ASK,     // OP_CAMERA
            AppOpsManager.MODE_ASK,     // OP_RECORD_AUDIO
            AppOpsManager.MODE_ALLOWED, // OP_PLAY_AUDIO
            AppOpsManager.MODE_ALLOWED, // OP_READ_CLIPBOARD
            AppOpsManager.MODE_ALLOWED, // OP_WRITE_CLIPBOARD
            AppOpsManager.MODE_ALLOWED, // OP_TAKE_MEDIA_BUTTONS
            AppOpsManager.MODE_ALLOWED, // OP_TAKE_AUDIO_FOCUS
            AppOpsManager.MODE_ALLOWED, // OP_AUDIO_MASTER_VOLUME
            AppOpsManager.MODE_ALLOWED, // OP_AUDIO_VOICE_VOLUME
            AppOpsManager.MODE_ALLOWED, // OP_AUDIO_RING_VOLUME
            AppOpsManager.MODE_ALLOWED, // OP_AUDIO_MEDIA_VOLUME
            AppOpsManager.MODE_ALLOWED, // OP_AUDIO_ALARM_VOLUME
            AppOpsManager.MODE_ALLOWED, // OP_AUDIO_NOTIFICATION_VOLUME
            AppOpsManager.MODE_ALLOWED, // OP_AUDIO_BLUETOOTH_VOLUME
            AppOpsManager.MODE_ALLOWED, // OP_WAKE_LOCK
            AppOpsManager.MODE_ALLOWED, // OP_MONITOR_LOCATION
            AppOpsManager.MODE_ASK,     // OP_MONITOR_HIGH_POWER_LOCATION
            AppOpsManager.MODE_ASK,     // OP_WIFI_CHANGE
            AppOpsManager.MODE_ASK,     // OP_BLUETOOTH_CHANGE
            AppOpsManager.MODE_ASK,     // OP_DATA_CHANGE
            AppOpsManager.MODE_ASK,     // OP_ALARM_WAKEUP
            AppOpsManager.MODE_ASK,     // OP_SEND_MMS
            AppOpsManager.MODE_ASK,     // OP_READ_MMS
            AppOpsManager.MODE_ASK,     // OP_WRITE_MMS
            AppOpsManager.MODE_ALLOWED, // OP_BOOT_COMPLETED
    };


    /**
     * This specifies whether each option is allowed to be reset
     * when resetting all app preferences.  Disable reset for
@@ -544,6 +633,9 @@ public class AppOpsManager {
            false,
            false,
            false,
            false,
            false,
            false,
    };

    private static HashMap<String, Integer> sOpStrToOp = new HashMap<String, Integer>();
@@ -571,6 +663,10 @@ public class AppOpsManager {
            throw new IllegalStateException("sOpDefaultMode length " + sOpDefaultMode.length
                    + " should be " + _NUM_OP);
        }
        if (sOpDefaultStrictMode.length != _NUM_OP) {
            throw new IllegalStateException("sOpDefaultStrictMode length " + sOpDefaultStrictMode.length
                    + " should be " + _NUM_OP);
        }
        if (sOpDisableReset.length != _NUM_OP) {
            throw new IllegalStateException("sOpDisableReset length " + sOpDisableReset.length
                    + " should be " + _NUM_OP);
@@ -623,7 +719,10 @@ public class AppOpsManager {
     * Retrieve the default mode for the operation.
     * @hide
     */
    public static int opToDefaultMode(int op) {
    public static int opToDefaultMode(int op, boolean strict) {
        if(strict)
            return sOpDefaultStrictMode[op];
        else
            return sOpDefaultMode[op];
    }

@@ -1230,4 +1329,9 @@ public class AppOpsManager {
        } catch (RemoteException e) {
        }
    }

    /** @hide */
    public static boolean isStrictEnable() {
        return SystemProperties.getBoolean("persist.sys.strict_op_enable", false);
    }
}
+8 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved.
 * Not a Contribution.
 * Copyright (C) 2006 The Android Open Source Project
 * This code has been modified.  Portions copyright (C) 2010, T-Mobile USA, Inc.
 *
@@ -103,6 +105,7 @@ import android.os.storage.IMountService;
import android.os.storage.StorageManager;
import android.print.IPrintManager;
import android.print.PrintManager;
import android.telephony.MSimTelephonyManager;
import android.telephony.TelephonyManager;
import android.content.ClipboardManager;
import android.util.AndroidRuntimeException;
@@ -509,6 +512,11 @@ class ContextImpl extends Context {
                    return new TelephonyManager(ctx.getOuterContext());
                }});

        registerService(MSIM_TELEPHONY_SERVICE, new ServiceFetcher() {
                public Object createService(ContextImpl ctx) {
                    return new MSimTelephonyManager(ctx.getOuterContext());
                }});

        registerService(UI_MODE_SERVICE, new ServiceFetcher() {
                public Object createService(ContextImpl ctx) {
                    return new UiModeManager();
+18 −0
Original line number Diff line number Diff line
@@ -117,6 +117,24 @@ public interface BluetoothProfile {
     */
    public static final int HANDSFREE_CLIENT = 10;

     /**
     * A2dp Source
     * @hide
     */
    public static final int PROFILE_A2DP_SRC = 1;

    /**
    * A2dp Sink
    * @hide
    */
    public static final int PROFILE_A2DP_SNK = 2;

    /**
    * Profile A2dp undefined
    * @hide
    */
    public static final int PROFILE_A2DP_UNDEFINED = -1;

    /**
     * DUN
     * @hide
+0 −1
Original line number Diff line number Diff line
@@ -524,7 +524,6 @@ public final class BluetoothSocket implements Closeable {
                    mSocket = null;
                }
                if(mPfd != null) {
                    mPfd.detachFd();
                    mPfd.close();
                    mPfd = null;
                }
Loading