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

Commit c7d89b4b authored by Svetoslav Ganov's avatar Svetoslav Ganov Committed by Android (Google) Code Review
Browse files

Merge "Revert "Adjust default app op behavior based on feature state""

parents a9975449 0b9af26d
Loading
Loading
Loading
Loading
+0 −21
Original line number Diff line number Diff line
@@ -36,7 +36,6 @@ import android.os.Parcelable;
import android.os.Process;
import android.os.RemoteException;
import android.os.UserManager;
import android.provider.Settings;
import android.util.ArrayMap;

import com.android.internal.app.IAppOpsActiveCallback;
@@ -1609,26 +1608,6 @@ public class AppOpsManager {
     * @hide
     */
    public static int opToDefaultMode(int op) {
        // STOPSHIP b/118520006: Hardcode the default values once the feature is stable.
        switch (op) {
            // SMS permissions
            case AppOpsManager.OP_SEND_SMS:
            case AppOpsManager.OP_RECEIVE_SMS:
            case AppOpsManager.OP_READ_SMS:
            case AppOpsManager.OP_RECEIVE_WAP_PUSH:
            case AppOpsManager.OP_RECEIVE_MMS:
            case AppOpsManager.OP_READ_CELL_BROADCASTS:
            // CallLog permissions
            case AppOpsManager.OP_READ_CALL_LOG:
            case AppOpsManager.OP_WRITE_CALL_LOG:
            case AppOpsManager.OP_PROCESS_OUTGOING_CALLS: {
                // ActivityThread.currentApplication() is never null
                if (Settings.Global.getInt(ActivityThread.currentApplication().getContentResolver(),
                        Settings.Global.SMS_ACCESS_RESTRICTION_ENABLED, 0) == 1) {
                    return AppOpsManager.MODE_DEFAULT;
                }
            }
        }
        return sOpDefaultMode[op];
    }