add another perms request/rationale

This commit is contained in:
Eric House 2017-01-04 07:10:45 -08:00
parent 7c033ccdf1
commit d661f1d050
6 changed files with 51 additions and 13 deletions

View file

@ -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;
/** <string name="disable_nag_summary">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;
/**
<string name="phone_label">Connected number[s]:</string>
*/
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;
/** <string name="rename_group_label">Change the name of this group to:</string>
*/
public static final int rename_group_label=0x7f050273;
@ -6021,7 +6022,7 @@ XLATE-ME
/** <string name="sms_ready_text">Tap the receiving device now</string>
*/
public static final int sms_ready_text=0x7f050288;
public static final int sms_send_failed=0x7f050362;
public static final int sms_send_failed=0x7f050363;
/** <string name="square_tiles">Square rack tiles</string>
*/
public static final int square_tiles=0x7f050278;
@ -6890,7 +6891,7 @@ string name="str_robot_moved">O robô fez esta jogada:\u0020</string
feature is not yet supported on Android.)
*/
public static final int title_tile_picker=0x7f0501b4;
public static final int toast_no_permission=0x7f050364;
public static final int toast_no_permission=0x7f050365;
/** <string name="update_dicts_fmt">Updates are available for one or more
installed wordlists. Would you like to download the new
version[s] of %1$s now?</string>

View file

@ -2729,6 +2729,14 @@
temporary storage to keep what you\'re about to download.
</string>
<string name="dicts_storage_rationale">
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.
</string>
<string name="phone_state_rationale">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

View file

@ -2329,6 +2329,13 @@
<string name="download_rationale">Sdrowssorc sdeen ssecca ot
yraropmet egarots ot peek tahw uoy\'er tuoba ot daolnwod.
</string>
<string name="dicts_storage_rationale">
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.
</string>
<string name="phone_state_rationale">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

View file

@ -2329,6 +2329,13 @@
<string name="download_rationale">CROSSWORDS NEEDS ACCESS TO
TEMPORARY STORAGE TO KEEP WHAT YOU\'RE ABOUT TO DOWNLOAD.
</string>
<string name="dicts_storage_rationale">
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.
</string>
<string name="phone_state_rationale">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

View file

@ -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;
}

View file

@ -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 );
}