OSDN Git Service

Update string for account manager failures
authorAlexandra Gherghina <alexgherghina@google.com>
Fri, 25 Jul 2014 12:47:58 +0000 (13:47 +0100)
committerAlexandra Gherghina <alexgherghina@google.com>
Mon, 28 Jul 2014 07:41:40 +0000 (07:41 +0000)
Bug: 14642886
Change-Id: I200e38c7a93990787a3d6e01a583fe8ba193a987

core/java/android/accounts/CantAddAccountActivity.java
core/res/res/layout/app_not_authorized.xml
core/res/res/values/strings.xml
core/res/res/values/symbols.xml

index 4ac2beb..f7f232e 100644 (file)
@@ -19,7 +19,6 @@ package android.accounts;
 import android.app.Activity;
 import android.os.Bundle;
 import android.view.View;
-import android.widget.TextView;
 
 import com.android.internal.R;
 
@@ -29,25 +28,11 @@ import com.android.internal.R;
  */
 public class CantAddAccountActivity extends Activity {
     public static final String EXTRA_ERROR_CODE = "android.accounts.extra.ERROR_CODE";
-    public static final int MISSING = -1;
 
     @Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.app_not_authorized);
-
-        int errorCode = getIntent().getIntExtra(EXTRA_ERROR_CODE, MISSING);
-        if (errorCode != MISSING) {
-            TextView errorText = (TextView) findViewById(R.id.description);
-            switch (errorCode) {
-                case AccountManager.ERROR_CODE_USER_RESTRICTED:
-                    errorText.setText(R.string.app_no_restricted_accounts);
-                    break;
-                default:
-                    // TODO: Get better message. See: http://b/14642886
-                    errorText.setText(R.string.error_message_title);
-            }
-        }
     }
 
     public void onCancelButtonClicked(View view) {
index bd40eeb..2188511 100644 (file)
@@ -32,7 +32,7 @@
         android:paddingBottom="16dip"
         android:paddingStart="16dip"
         android:paddingEnd="16dip"
-        android:text="@string/app_no_restricted_accounts"
+        android:text="@string/error_message_change_not_allowed"
     />
 
     <!-- Horizontal divider line -->
index 056c1a6..c6ee89f 100644 (file)
     <string name="owner_name" msgid="3879126011135546571">Owner</string>
     <!-- Error message title [CHAR LIMIT=35] -->
     <string name="error_message_title">Error</string>
-    <!-- Message informing user that app is not permitted to access accounts. [CHAR LIMIT=none] -->
-    <string name="app_no_restricted_accounts">This app doesn\'t support accounts for restricted profiles</string>
+    <!-- Message informing user that the change was disallowed by an administrator. [CHAR LIMIT=none] -->
+    <string name="error_message_change_not_allowed">This change isn\'t allowed by your administrator</string>
     <!-- Message informing user that the requested activity could not be found [CHAR LIMIT=none] -->
     <string name="app_not_found">No application found to handle this action</string>
     <string name="revoke">Revoke</string>
index e9b9889..30209e9 100644 (file)
   <java-symbol type="string" name="config_customResolverActivity" />
   <java-symbol type="string" name="config_appsAuthorizedForSharedAccounts" />
   <java-symbol type="string" name="error_message_title" />
-  <java-symbol type="string" name="app_no_restricted_accounts" />
+  <java-symbol type="string" name="error_message_change_not_allowed" />
   <java-symbol type="string" name="action_bar_home_description_format" />
   <java-symbol type="string" name="action_bar_home_subtitle_description_format" />
   <java-symbol type="string" name="wireless_display_route_description" />