From d661f1d050b07cfd240ec4df6923fe9683bbd43a Mon Sep 17 00:00:00 2001 From: Eric House Date: Wed, 4 Jan 2017 07:10:45 -0800 Subject: [PATCH] add another perms request/rationale --- xwords4/android/XWords4/archive/R.java | 23 ++++++++++--------- .../android/XWords4/res/values/strings.xml | 8 +++++++ .../XWords4/res_src/values-ba_CK/strings.xml | 7 ++++++ .../XWords4/res_src/values-ca_PS/strings.xml | 7 ++++++ .../org/eehouse/android/xw4/DelegateBase.java | 7 ++++++ .../eehouse/android/xw4/DictsDelegate.java | 12 ++++++++-- 6 files changed, 51 insertions(+), 13 deletions(-) diff --git a/xwords4/android/XWords4/archive/R.java b/xwords4/android/XWords4/archive/R.java index 2406369b9..3ab225644 100644 --- a/xwords4/android/XWords4/archive/R.java +++ b/xwords4/android/XWords4/archive/R.java @@ -1988,8 +1988,8 @@ XLATE-ME */ public static final int connstat_unsucc=0x7f050237; - public static final int contact_not_found=0x7f050361; - public static final int contacts_rationale=0x7f05035e; + public static final int contact_not_found=0x7f050362; + public static final int contacts_rationale=0x7f05035f; /** title of dialog brought up in response to the board_menu_game_counts menu. The dialog lists all tiles in the language being used for the game together with how many @@ -2288,6 +2288,7 @@ XLATE-ME will use is substituted in for "%s". */ public static final int dicts_list_prompt_fmt=0x7f0500df; + public static final int dicts_storage_rationale=0x7f05035a; public static final int disable_dualpane=0x7f050355; public static final int disable_nag_solo_title=0x7f0502fe; /** Do not notify me no matter @@ -3831,7 +3832,7 @@ XLATE-ME depending on the current location of the wordlist.) */ public static final int move_dict_fmt=0x7f0500b2; - public static final int move_dict_rationale=0x7f05035f; + public static final int move_dict_rationale=0x7f050360; /** ############################################################ # :Dialogs: @@ -5042,21 +5043,21 @@ XLATE-ME explanation of the above */ public static final int peek_other_summary=0x7f05015d; - public static final int perms_rationale_title=0x7f050363; + public static final int perms_rationale_title=0x7f050364; /** Connected number[s]: */ public static final int phone_label=0x7f050223; - public static final int phone_lookup_rationale=0x7f05035b; + public static final int phone_lookup_rationale=0x7f05035c; /** Case where SMS is the only way the game can communicate */ - public static final int phone_lookup_rationale_drop=0x7f05035c; + public static final int phone_lookup_rationale_drop=0x7f05035d; /** Case where SMS is NOT the only way the game can communicate */ - public static final int phone_lookup_rationale_others=0x7f05035d; - public static final int phone_state_rationale=0x7f05035a; + public static final int phone_lookup_rationale_others=0x7f05035e; + public static final int phone_state_rationale=0x7f05035b; /** Don't warn, but simply force to skip turn (give 0 points) when user attempts to play word not in the wordlist. Don't warn, but simply force to skip turn (give 0 points) @@ -5813,7 +5814,7 @@ XLATE-ME */ public static final int remote_undone=0x7f050226; - public static final int remove_sms=0x7f050360; + public static final int remove_sms=0x7f050361; /** Change the name of this group to: */ public static final int rename_group_label=0x7f050273; @@ -6021,7 +6022,7 @@ XLATE-ME /** Tap the receiving device now */ public static final int sms_ready_text=0x7f050288; - public static final int sms_send_failed=0x7f050362; + public static final int sms_send_failed=0x7f050363; /** Square rack tiles */ public static final int square_tiles=0x7f050278; @@ -6890,7 +6891,7 @@ string name="str_robot_moved">O robĂ´ fez esta jogada:\u0020Updates are available for one or more installed wordlists. Would you like to download the new version[s] of %1$s now? diff --git a/xwords4/android/XWords4/res/values/strings.xml b/xwords4/android/XWords4/res/values/strings.xml index adcdd14c1..9faa24618 100644 --- a/xwords4/android/XWords4/res/values/strings.xml +++ b/xwords4/android/XWords4/res/values/strings.xml @@ -2729,6 +2729,14 @@ temporary storage to keep what you\'re about to download. + + Crosswords can store and read wordlists in your device\'s + Downloads area but it needs permission to access them + there.\n\nYou can safely deny this permission if you will never + download wordlists except from inside Crosswords and have not + previously stored any there. + + Crosswords wants to offer you the option of exchanging moves via SMS \"data\" messages. In order to determine if your device can send SMS Crosswords needs permission diff --git a/xwords4/android/XWords4/res_src/values-ba_CK/strings.xml b/xwords4/android/XWords4/res_src/values-ba_CK/strings.xml index 7ce252d84..4e8e7313c 100644 --- a/xwords4/android/XWords4/res_src/values-ba_CK/strings.xml +++ b/xwords4/android/XWords4/res_src/values-ba_CK/strings.xml @@ -2329,6 +2329,13 @@ Sdrowssorc sdeen ssecca ot yraropmet egarots ot peek tahw uoy\'er tuoba ot daolnwod. + + Sdrowssorc nac erots dna daer stsildrow ni ruoy ecived\'s + Sdaolnwod aera tub ti sdeen noissimrep ot ssecca meht + ereht.\n\nUoy nac ylefas yned siht noissimrep fi uoy lliw reven + daolnwod stsildrow tpecxe morf edisni Sdrowssorc dna evah ton + ylsuoiverp derots yna ereht. + Sdrowssorc stnaw ot reffo uoy eht noitpo fo gnignahcxe sevom aiv SMS \"atad\" segassem. Ni redro ot enimreted fi ruoy ecived nac dnes SMS Sdrowssorc sdeen noissimrep diff --git a/xwords4/android/XWords4/res_src/values-ca_PS/strings.xml b/xwords4/android/XWords4/res_src/values-ca_PS/strings.xml index ad895fb5e..a042c5089 100644 --- a/xwords4/android/XWords4/res_src/values-ca_PS/strings.xml +++ b/xwords4/android/XWords4/res_src/values-ca_PS/strings.xml @@ -2329,6 +2329,13 @@ CROSSWORDS NEEDS ACCESS TO TEMPORARY STORAGE TO KEEP WHAT YOU\'RE ABOUT TO DOWNLOAD. + + CROSSWORDS CAN STORE AND READ WORDLISTS IN YOUR DEVICE\'S + DOWNLOADS AREA BUT IT NEEDS PERMISSION TO ACCESS THEM + THERE.\n\nYOU CAN SAFELY DENY THIS PERMISSION IF YOU WILL NEVER + DOWNLOAD WORDLISTS EXCEPT FROM INSIDE CROSSWORDS AND HAVE NOT + PREVIOUSLY STORED ANY THERE. + CROSSWORDS WANTS TO OFFER YOU THE OPTION OF EXCHANGING MOVES VIA SMS \"DATA\" MESSAGES. IN ORDER TO DETERMINE IF YOUR DEVICE CAN SEND SMS CROSSWORDS NEEDS PERMISSION diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DelegateBase.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DelegateBase.java index 0ca490edd..a3a50780f 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DelegateBase.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DelegateBase.java @@ -105,6 +105,12 @@ public class DelegateBase implements DlgClickNotify, protected void requestWindowFeature( int feature ) {} + protected void tryGetPerms( Perms23.Perm perm, int rationale, + Action action, Object... params ) + { + Perms23.tryGetPerms( this, perm, rationale, action, this, params ); + } + // Fragments only protected View inflateView( LayoutInflater inflater, ViewGroup container ) { @@ -653,6 +659,7 @@ public class DelegateBase implements DlgClickNotify, handled = true; break; default: + DbgUtils.logd( TAG, "unhandled action %s", action.toString() ); Assert.fail(); break; } diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DictsDelegate.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DictsDelegate.java index 7729ba06f..77c2788b8 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DictsDelegate.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DictsDelegate.java @@ -534,6 +534,9 @@ public class DictsDelegate extends ListDelegateBase makeNotAgainBuilder( R.string.not_again_dicts, R.string.key_na_dicts ) .show(); + + tryGetPerms( Perm.STORAGE, R.string.dicts_storage_rationale, + Action.STORAGE_CONFIRMED ); } // init @Override @@ -654,8 +657,8 @@ public class DictsDelegate extends ListDelegateBase private void moveDicts( XWListItem[] selItems, DictLoc toLoc ) { if ( DictUtils.needsStoragePermission( toLoc ) ) { - Perms23.tryGetPerms( this, Perm.STORAGE, R.string.move_dict_rationale, - Action.MOVE_CONFIRMED, this, selItems, toLoc ); + tryGetPerms( Perm.STORAGE, R.string.move_dict_rationale, + Action.MOVE_CONFIRMED, selItems, toLoc ); } else { moveDictsWithPermission( selItems, toLoc ); } @@ -935,6 +938,11 @@ public class DictsDelegate extends ListDelegateBase moveDictsWithPermission( params ); } break; + case STORAGE_CONFIRMED: + if ( positive ) { + mkListAdapter(); + } + break; default: super.dlgButtonClicked( action, which, params ); }