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

Commit 7bbb9f64 authored by John Spurlock's avatar John Spurlock
Browse files

Sysui: Include shared prefs in service dump.

Also:
 - Remove obsolete Prefs helper.
 - Use common file for zen-mode prefs.

Bug: 18062541
Change-Id: I9a6a4733eac0ec1c55da5d359c996cb5fe3bb8af
parent a9a550dd
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -175,6 +175,7 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;

public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
        DragDownHelper.DragDownCallback, ActivityStarter {
@@ -2963,6 +2964,11 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
        if (mSecurityController != null) {
            mSecurityController.dump(fd, pw, args);
        }
        pw.println("SharedPreferences:");
        for (Map.Entry<String, ?> entry : mContext.getSharedPreferences(mContext.getPackageName(),
                Context.MODE_PRIVATE).getAll().entrySet()) {
            pw.print("  "); pw.print(entry.getKey()); pw.print("="); pw.println(entry.getValue());
        }
    }

    private String hunStateToString(Entry entry) {
+0 −32
Original line number Diff line number Diff line
/*
 * Copyright (C) 2010 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.systemui.statusbar.policy;

import android.content.Context;
import android.content.SharedPreferences;

public class Prefs {
    private static final String SHARED_PREFS_NAME = "status_bar";

    public static SharedPreferences read(Context context) {
        return context.getSharedPreferences(Prefs.SHARED_PREFS_NAME, Context.MODE_PRIVATE);
    }

    public static SharedPreferences.Editor edit(Context context) {
        return context.getSharedPreferences(Prefs.SHARED_PREFS_NAME, Context.MODE_PRIVATE).edit();
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -690,7 +690,7 @@ public class ZenModePanel extends LinearLayout {
        }

        private SharedPreferences prefs() {
            return mContext.getSharedPreferences(ZenModePanel.class.getSimpleName(), 0);
            return mContext.getSharedPreferences(mContext.getPackageName(), 0);
        }

        private void updateMinuteIndex() {