OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.chrome.browser.preferences.website; | 5 package org.chromium.chrome.browser.preferences.website; |
6 | 6 |
7 import android.annotation.SuppressLint; | 7 import android.annotation.SuppressLint; |
8 import android.annotation.TargetApi; | 8 import android.annotation.TargetApi; |
9 import android.app.ActivityManager; | 9 import android.app.ActivityManager; |
10 import android.content.Context; | 10 import android.content.Context; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 private Button mClearUnimportantButton; | 66 private Button mClearUnimportantButton; |
67 private Button mManageSiteDataButton; | 67 private Button mManageSiteDataButton; |
68 private Button mClearAllDataButton; | 68 private Button mClearAllDataButton; |
69 // Stored for testing. | 69 // Stored for testing. |
70 private AlertDialog mUnimportantDialog; | 70 private AlertDialog mUnimportantDialog; |
71 | 71 |
72 private static boolean sActivityNotExportedChecked; | 72 private static boolean sActivityNotExportedChecked; |
73 | 73 |
74 private boolean mIsNativeInitialized; | 74 private boolean mIsNativeInitialized; |
75 | 75 |
76 @SuppressLint("CommitPrefEdits") | 76 @SuppressLint({"ApplySharedPref", "CommitPrefEdits"}) |
77 @Override | 77 @Override |
78 protected void onCreate(Bundle savedInstanceState) { | 78 protected void onCreate(Bundle savedInstanceState) { |
79 ensureActivityNotExported(); | 79 ensureActivityNotExported(); |
80 | 80 |
81 setContentView(R.layout.manage_space_activity); | 81 setContentView(R.layout.manage_space_activity); |
82 Resources r = getResources(); | 82 Resources r = getResources(); |
83 setTitle(String.format(r.getString(R.string.storage_management_activity_
label), | 83 setTitle(String.format(r.getString(R.string.storage_management_activity_
label), |
84 r.getString(R.string.app_name))); | 84 r.getString(R.string.app_name))); |
85 | 85 |
86 mSiteDataSizeText = (TextView) findViewById(R.id.site_data_storage_size_
text); | 86 mSiteDataSizeText = (TextView) findViewById(R.id.site_data_storage_size_
text); |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 ActivityInfo activityInfo = getPackageManager().getActivityInfo(getC
omponentName(), 0); | 342 ActivityInfo activityInfo = getPackageManager().getActivityInfo(getC
omponentName(), 0); |
343 if (activityInfo.exported) { | 343 if (activityInfo.exported) { |
344 throw new IllegalStateException("ManageSpaceActivity must not be
exported."); | 344 throw new IllegalStateException("ManageSpaceActivity must not be
exported."); |
345 } | 345 } |
346 } catch (NameNotFoundException ex) { | 346 } catch (NameNotFoundException ex) { |
347 // Something terribly wrong has happened. | 347 // Something terribly wrong has happened. |
348 throw new RuntimeException(ex); | 348 throw new RuntimeException(ex); |
349 } | 349 } |
350 } | 350 } |
351 } | 351 } |
OLD | NEW |