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

Commit c9a40cd8 authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Add methods to probe current storage state.

Bug: 27811575
Change-Id: I2586fe3ec4d5c98c5b956f4b4a4cec425c81b0b1
parent bd91e2f3
Loading
Loading
Loading
Loading
+4 −3
Original line number Original line Diff line number Diff line
@@ -29896,6 +29896,8 @@ package android.preference {
    method public android.content.SharedPreferences getSharedPreferences();
    method public android.content.SharedPreferences getSharedPreferences();
    method public int getSharedPreferencesMode();
    method public int getSharedPreferencesMode();
    method public java.lang.String getSharedPreferencesName();
    method public java.lang.String getSharedPreferencesName();
    method public boolean isStorageDefault();
    method public boolean isStorageDeviceProtected();
    method public static void setDefaultValues(android.content.Context, int, boolean);
    method public static void setDefaultValues(android.content.Context, int, boolean);
    method public static void setDefaultValues(android.content.Context, java.lang.String, int, int, boolean);
    method public static void setDefaultValues(android.content.Context, java.lang.String, int, int, boolean);
    method public void setSharedPreferencesMode(int);
    method public void setSharedPreferencesMode(int);
@@ -34583,7 +34585,6 @@ package android.service.dreams {
    method public boolean onMenuOpened(int, android.view.Menu);
    method public boolean onMenuOpened(int, android.view.Menu);
    method public void onPanelClosed(int, android.view.Menu);
    method public void onPanelClosed(int, android.view.Menu);
    method public boolean onPreparePanel(int, android.view.View, android.view.Menu);
    method public boolean onPreparePanel(int, android.view.View, android.view.Menu);
    method public void onProvideKeyboardShortcuts(java.util.List<android.view.KeyboardShortcutGroup>, android.view.Menu, int);
    method public boolean onSearchRequested(android.view.SearchEvent);
    method public boolean onSearchRequested(android.view.SearchEvent);
    method public boolean onSearchRequested();
    method public boolean onSearchRequested();
    method public void onWakeUp();
    method public void onWakeUp();
@@ -36229,9 +36230,9 @@ package android.telecom {
    method public void onStateChanged(int);
    method public void onStateChanged(int);
    method public void onStopDtmfTone();
    method public void onStopDtmfTone();
    method public void onUnhold();
    method public void onUnhold();
    method public static java.lang.String propertiesToString(int);
    method public final void putExtras(android.os.Bundle);
    method public final void putExtras(android.os.Bundle);
    method public final void removeExtras(java.util.List<java.lang.String>);
    method public final void removeExtras(java.util.List<java.lang.String>);
    method public static java.lang.String propertiesToString(int);
    method public void sendConnectionEvent(java.lang.String, android.os.Bundle);
    method public void sendConnectionEvent(java.lang.String, android.os.Bundle);
    method public final void setActive();
    method public final void setActive();
    method public final void setAddress(android.net.Uri, int);
    method public final void setAddress(android.net.Uri, int);
@@ -36257,8 +36258,8 @@ package android.telecom {
    method public static java.lang.String stateToString(int);
    method public static java.lang.String stateToString(int);
    field public static final int CAPABILITY_CANNOT_DOWNGRADE_VIDEO_TO_AUDIO = 8388608; // 0x800000
    field public static final int CAPABILITY_CANNOT_DOWNGRADE_VIDEO_TO_AUDIO = 8388608; // 0x800000
    field public static final int CAPABILITY_CAN_PAUSE_VIDEO = 1048576; // 0x100000
    field public static final int CAPABILITY_CAN_PAUSE_VIDEO = 1048576; // 0x100000
    field public static final int CAPABILITY_CAN_SEND_RESPONSE_VIA_CONNECTION = 4194304; // 0x400000
    field public static final int CAPABILITY_CAN_PULL_CALL = 16777216; // 0x1000000
    field public static final int CAPABILITY_CAN_PULL_CALL = 16777216; // 0x1000000
    field public static final int CAPABILITY_CAN_SEND_RESPONSE_VIA_CONNECTION = 4194304; // 0x400000
    field public static final int CAPABILITY_CAN_UPGRADE_TO_VIDEO = 524288; // 0x80000
    field public static final int CAPABILITY_CAN_UPGRADE_TO_VIDEO = 524288; // 0x80000
    field public static final int CAPABILITY_DISCONNECT_FROM_CONFERENCE = 8192; // 0x2000
    field public static final int CAPABILITY_DISCONNECT_FROM_CONFERENCE = 8192; // 0x2000
    field public static final int CAPABILITY_HOLD = 1; // 0x1
    field public static final int CAPABILITY_HOLD = 1; // 0x1
+5 −3
Original line number Original line Diff line number Diff line
@@ -32208,6 +32208,9 @@ package android.preference {
    method public android.content.SharedPreferences getSharedPreferences();
    method public android.content.SharedPreferences getSharedPreferences();
    method public int getSharedPreferencesMode();
    method public int getSharedPreferencesMode();
    method public java.lang.String getSharedPreferencesName();
    method public java.lang.String getSharedPreferencesName();
    method public boolean isStorageCredentialProtected();
    method public boolean isStorageDefault();
    method public boolean isStorageDeviceProtected();
    method public static void setDefaultValues(android.content.Context, int, boolean);
    method public static void setDefaultValues(android.content.Context, int, boolean);
    method public static void setDefaultValues(android.content.Context, java.lang.String, int, int, boolean);
    method public static void setDefaultValues(android.content.Context, java.lang.String, int, int, boolean);
    method public void setSharedPreferencesMode(int);
    method public void setSharedPreferencesMode(int);
@@ -37031,7 +37034,6 @@ package android.service.dreams {
    method public boolean onMenuOpened(int, android.view.Menu);
    method public boolean onMenuOpened(int, android.view.Menu);
    method public void onPanelClosed(int, android.view.Menu);
    method public void onPanelClosed(int, android.view.Menu);
    method public boolean onPreparePanel(int, android.view.View, android.view.Menu);
    method public boolean onPreparePanel(int, android.view.View, android.view.Menu);
    method public void onProvideKeyboardShortcuts(java.util.List<android.view.KeyboardShortcutGroup>, android.view.Menu, int);
    method public boolean onSearchRequested(android.view.SearchEvent);
    method public boolean onSearchRequested(android.view.SearchEvent);
    method public boolean onSearchRequested();
    method public boolean onSearchRequested();
    method public void onWakeUp();
    method public void onWakeUp();
@@ -38803,9 +38805,9 @@ package android.telecom {
    method public void onStateChanged(int);
    method public void onStateChanged(int);
    method public void onStopDtmfTone();
    method public void onStopDtmfTone();
    method public void onUnhold();
    method public void onUnhold();
    method public static java.lang.String propertiesToString(int);
    method public final void putExtras(android.os.Bundle);
    method public final void putExtras(android.os.Bundle);
    method public final void removeExtras(java.util.List<java.lang.String>);
    method public final void removeExtras(java.util.List<java.lang.String>);
    method public static java.lang.String propertiesToString(int);
    method public void sendConnectionEvent(java.lang.String, android.os.Bundle);
    method public void sendConnectionEvent(java.lang.String, android.os.Bundle);
    method public final void setActive();
    method public final void setActive();
    method public final void setAddress(android.net.Uri, int);
    method public final void setAddress(android.net.Uri, int);
@@ -38831,8 +38833,8 @@ package android.telecom {
    method public static java.lang.String stateToString(int);
    method public static java.lang.String stateToString(int);
    field public static final int CAPABILITY_CANNOT_DOWNGRADE_VIDEO_TO_AUDIO = 8388608; // 0x800000
    field public static final int CAPABILITY_CANNOT_DOWNGRADE_VIDEO_TO_AUDIO = 8388608; // 0x800000
    field public static final int CAPABILITY_CAN_PAUSE_VIDEO = 1048576; // 0x100000
    field public static final int CAPABILITY_CAN_PAUSE_VIDEO = 1048576; // 0x100000
    field public static final int CAPABILITY_CAN_SEND_RESPONSE_VIA_CONNECTION = 4194304; // 0x400000
    field public static final int CAPABILITY_CAN_PULL_CALL = 16777216; // 0x1000000
    field public static final int CAPABILITY_CAN_PULL_CALL = 16777216; // 0x1000000
    field public static final int CAPABILITY_CAN_SEND_RESPONSE_VIA_CONNECTION = 4194304; // 0x400000
    field public static final int CAPABILITY_CAN_UPGRADE_TO_VIDEO = 524288; // 0x80000
    field public static final int CAPABILITY_CAN_UPGRADE_TO_VIDEO = 524288; // 0x80000
    field public static final int CAPABILITY_DISCONNECT_FROM_CONFERENCE = 8192; // 0x2000
    field public static final int CAPABILITY_DISCONNECT_FROM_CONFERENCE = 8192; // 0x2000
    field public static final int CAPABILITY_HOLD = 1; // 0x1
    field public static final int CAPABILITY_HOLD = 1; // 0x1
+4 −3
Original line number Original line Diff line number Diff line
@@ -29962,6 +29962,8 @@ package android.preference {
    method public android.content.SharedPreferences getSharedPreferences();
    method public android.content.SharedPreferences getSharedPreferences();
    method public int getSharedPreferencesMode();
    method public int getSharedPreferencesMode();
    method public java.lang.String getSharedPreferencesName();
    method public java.lang.String getSharedPreferencesName();
    method public boolean isStorageDefault();
    method public boolean isStorageDeviceProtected();
    method public static void setDefaultValues(android.content.Context, int, boolean);
    method public static void setDefaultValues(android.content.Context, int, boolean);
    method public static void setDefaultValues(android.content.Context, java.lang.String, int, int, boolean);
    method public static void setDefaultValues(android.content.Context, java.lang.String, int, int, boolean);
    method public void setSharedPreferencesMode(int);
    method public void setSharedPreferencesMode(int);
@@ -34655,7 +34657,6 @@ package android.service.dreams {
    method public boolean onMenuOpened(int, android.view.Menu);
    method public boolean onMenuOpened(int, android.view.Menu);
    method public void onPanelClosed(int, android.view.Menu);
    method public void onPanelClosed(int, android.view.Menu);
    method public boolean onPreparePanel(int, android.view.View, android.view.Menu);
    method public boolean onPreparePanel(int, android.view.View, android.view.Menu);
    method public void onProvideKeyboardShortcuts(java.util.List<android.view.KeyboardShortcutGroup>, android.view.Menu, int);
    method public boolean onSearchRequested(android.view.SearchEvent);
    method public boolean onSearchRequested(android.view.SearchEvent);
    method public boolean onSearchRequested();
    method public boolean onSearchRequested();
    method public void onWakeUp();
    method public void onWakeUp();
@@ -36301,9 +36302,9 @@ package android.telecom {
    method public void onStateChanged(int);
    method public void onStateChanged(int);
    method public void onStopDtmfTone();
    method public void onStopDtmfTone();
    method public void onUnhold();
    method public void onUnhold();
    method public static java.lang.String propertiesToString(int);
    method public final void putExtras(android.os.Bundle);
    method public final void putExtras(android.os.Bundle);
    method public final void removeExtras(java.util.List<java.lang.String>);
    method public final void removeExtras(java.util.List<java.lang.String>);
    method public static java.lang.String propertiesToString(int);
    method public void sendConnectionEvent(java.lang.String, android.os.Bundle);
    method public void sendConnectionEvent(java.lang.String, android.os.Bundle);
    method public final void setActive();
    method public final void setActive();
    method public final void setAddress(android.net.Uri, int);
    method public final void setAddress(android.net.Uri, int);
@@ -36329,8 +36330,8 @@ package android.telecom {
    method public static java.lang.String stateToString(int);
    method public static java.lang.String stateToString(int);
    field public static final int CAPABILITY_CANNOT_DOWNGRADE_VIDEO_TO_AUDIO = 8388608; // 0x800000
    field public static final int CAPABILITY_CANNOT_DOWNGRADE_VIDEO_TO_AUDIO = 8388608; // 0x800000
    field public static final int CAPABILITY_CAN_PAUSE_VIDEO = 1048576; // 0x100000
    field public static final int CAPABILITY_CAN_PAUSE_VIDEO = 1048576; // 0x100000
    field public static final int CAPABILITY_CAN_SEND_RESPONSE_VIA_CONNECTION = 4194304; // 0x400000
    field public static final int CAPABILITY_CAN_PULL_CALL = 16777216; // 0x1000000
    field public static final int CAPABILITY_CAN_PULL_CALL = 16777216; // 0x1000000
    field public static final int CAPABILITY_CAN_SEND_RESPONSE_VIA_CONNECTION = 4194304; // 0x400000
    field public static final int CAPABILITY_CAN_UPGRADE_TO_VIDEO = 524288; // 0x80000
    field public static final int CAPABILITY_CAN_UPGRADE_TO_VIDEO = 524288; // 0x80000
    field public static final int CAPABILITY_DISCONNECT_FROM_CONFERENCE = 8192; // 0x2000
    field public static final int CAPABILITY_DISCONNECT_FROM_CONFERENCE = 8192; // 0x2000
    field public static final int CAPABILITY_HOLD = 1; // 0x1
    field public static final int CAPABILITY_HOLD = 1; // 0x1
+35 −0
Original line number Original line Diff line number Diff line
@@ -411,6 +411,41 @@ public class PreferenceManager {
        setStorageCredentialProtected();
        setStorageCredentialProtected();
    }
    }


    /**
     * Indicates if the storage location used internally by this class is the
     * default provided by the hosting {@link Context}.
     *
     * @see #setStorageDefault()
     * @see #setStorageDeviceProtected()
     */
    public boolean isStorageDefault() {
        return mStorage == STORAGE_DEFAULT;
    }

    /**
     * Indicates if the storage location used internally by this class is backed
     * by device-protected storage.
     *
     * @see #setStorageDefault()
     * @see #setStorageDeviceProtected()
     */
    public boolean isStorageDeviceProtected() {
        return mStorage == STORAGE_DEVICE_PROTECTED;
    }

    /**
     * Indicates if the storage location used internally by this class is backed
     * by credential-protected storage.
     *
     * @see #setStorageDefault()
     * @see #setStorageDeviceProtected()
     * @hide
     */
    @SystemApi
    public boolean isStorageCredentialProtected() {
        return mStorage == STORAGE_CREDENTIAL_PROTECTED;
    }

    /**
    /**
     * Gets a SharedPreferences instance that preferences managed by this will
     * Gets a SharedPreferences instance that preferences managed by this will
     * use.
     * use.